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 ajaxRequisicao(arquivo,enviar,saida) {
	var req1 = createXMLHTTP();
	
	req1.open("post",arquivo, true);
	req1.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=iso-8859-1");
	req1.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
	req1.setRequestHeader("Cache-Control", "post-check=0, pre-check=0");
	req1.setRequestHeader("Pragma", "no-cache");
	req1.onreadystatechange=function(){
	  if (req1.readyState==4){ 
		saida.innerHTML = req1.responseText;
	  }
	} 
	req1.send(enviar);

}

function popup(url, intWi, intHei, scr, nome, intTop, intLeft) {
	if (intLeft == null){
		intLeft = 10
		intTop = 10
	}
	var janela = null
	janela=window.open(url,nome,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+scr+',resizable=no,menubar=no,width=' + intWi + ',height=' + intHei+ ', left=' + intLeft + ', top=' + intTop + '');
}