function enviaPage(url, metodo, modo, tagId, parametros) {
	
	goAjax( url+"?"+parametros+"&rnd"+ Math.random(), metodo, modo , tagId);
}

function goAjax(url, metodo, modo, tagRetorno, parametros) {
        document.getElementById(tagRetorno).innerHTML='<div align="center" class="carregando"><br />carregando...</div>'
			xmlhttp = getHTTPObjectUser();
            if(metodo == "GET") {
                xmlhttp.open("GET", url, modo);
            } else {        
                xmlhttp.open("POST", url, modo);
                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");
            }    
            
            xmlhttp.onreadystatechange = function() {
                if(xmlhttp.readyState == 4) {
                    retorno=xmlhttp.responseText
                    document.getElementById(tagRetorno).innerHTML=retorno
                    //findScript(retorno)
                }
            }
            if(metodo == "GET") {
                xmlhttp.send(null);
            } else {        
                xmlhttp.send(parametros);
            }
}


function getHTTPObjectUser() {
var xmlhttp;
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
try {xmlhttp = new XMLHttpRequest();} catch (e) {xmlhttp = false;}
}

if(!xmlhttp && typeof ActiveXObject != "undefined"){
   try{ xmlhttp=new ActiveXObject("MSXML2.XMLHTTP"); }catch(e){xmlhttp=false;}
   if(!xmlhttp)try{ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }catch(e){xmlhttp=false;}
  }

return xmlhttp;
}