

function CarregaAjax(vNomeRet, vStrCampo, vEndSubmit){
	window.document.getElementById(vNomeRet).innerHTML	= "<font class=\"cA11\" color=\"#FF0000\" style=\"padding-left: 15px;\">Carregando...</font>";

	try{
		xmlhttp = new XMLHttpRequest();
	} catch(ee){
		try{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e){
			try{
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(E){
				xmlhttp = false;
			}
		}
	}
	xmlhttp.onreadystatechange = function(){
		if(xmlhttp.readyState == 4){
	        if(xmlhttp.status == 200){
				window.document.getElementById(vNomeRet).innerHTML	= unescape(xmlhttp.responseText.replace(/\+/g, " "));
				delete xmlhttp;
			}
			//ELSE PARA VIZUALIZAÇÃO DE ERROS
			else{
				window.document.getElementById(vNomeRet).innerHTML	= unescape(xmlhttp.responseText.replace(/\+/g, " "));
			}
		}
	}

	xmlhttp.open("POST", vEndSubmit, true);
	xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=ISO-8859-1");
	xmlhttp.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
	xmlhttp.setRequestHeader("Cache-Control", "post-check=0, pre-check=0");
	xmlhttp.setRequestHeader("Pragma", "no-cache");
	/* with(window.document.forms[0]){
		xmlhttp.send(vStrCampo);//"TxtModalidade=" + escape(CboBuscaRef.value)
	}*/
	xmlhttp.send();
}

