// a funcao abaixo funciona em qualquer
 // browser ou versão.  
 function createXMLHTTP() 
 {
  var ajax;
  try 
  {
   ajax = new ActiveXObject("Microsoft.XMLHTTP");
  } 
  catch(e) 
  {
   try 
   {
    ajax = new ActiveXObject("Msxml2.XMLHTTP");
    alert(ajax);
   }
   catch(ex) 
   {
    try 
    {
     ajax = new XMLHttpRequest();
    }
    catch(exc) 
    {
      alert("Esse browser não tem recursos para uso do Ajax");
      ajax = null;
    }
   }
   return ajax;
  }
 
 
     var arrSignatures = ["MSXML2.XMLHTTP.5.0", "MSXML2.XMLHTTP.4.0",
           "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP",
           "Microsoft.XMLHTTP"];
     for (var i=0; i < arrSignatures.length; i++) 
     {
    try 
    {
     var oRequest = new ActiveXObject(arrSignatures[i]);
     return oRequest;
    } 
    catch (oError) 
    {
       }
     }
  
      throw new Error("MSXML is not installed on your system.");
 }

function showHide(id) {
	var obj = document.getElementById(id);
	if(obj.className == "") {
		obj.className = "ocultaObj";
	} else {
		obj.className = "";
	}
}




function Contador(field,MaxLength) {
	  obj = document.all(field);
	  alert("e0" );
      if (MaxLength !=0) {
	    	alert("e1" );
         if (obj.value.length > MaxLength)  {
		 	alert("e2" );
            obj.value = obj.value.substring(0, MaxLength);
            }
      }
      document.frm2.contador.value = obj.value.length + '/255';
	  alert(document.frm2.contador.value);
   } 


// nova janela popup
function new_window() {
winwidth = 300; // width of the new window
winheight = 200; // height of the new window
winleft   = 200; // just dummie values (nao alterar)
wintop    = 200; // just dummie values (nao alterar)
 
if(parseInt(navigator.appVersion)>=4)
{winleft = (screen.width / 2) - (winwidth / 2); // center the window right to left
wintop = (screen.height / 2) - (winheight / 2); // center the window top to bottom
// the values get inserted into the features parameter of the window.open command...
}
window.open("enviada.php",null,"top=" + wintop + ",left=" + winleft + ",height=" + winheight + ",width=" + winwidth+",status=no,titlebar=0,statusbar=0,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,directories=no");
}

function w3alertbox_sucesso() {
		var codHTML = '<p><strong>Obrigado ! </strong> Coment&aacute;rio <strong>enviado</strong> com Sucesso !</p><hr /><p>Em caso de dúvidas: <a href="mailto:contato@livsoftweb.com" title="Nosso Email" class="classe2">contato@livsoftweb.com</a></p>';
		w3AlertBox.show(codHTML,'Mensagem LivsoftWEB',true);
	}


