    try{  
        xmlhttp = new XMLHttpRequest();  
     }catch(ee){  
         try{  
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");  
         }catch(e){  
             try{  
               xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");  
            }catch(E){  
                 xmlhttp = false;  
            }  
        }  
     }  



fila=[];

ifila=0;

 meuAjax = function (){  
     try{  
        xmlhttp = new XMLHttpRequest();  
     }catch(ee){  
         try{  
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");  
         }catch(e){  
             try{  
               xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");  
            }catch(E){  
                 xmlhttp = false;  
            }  
        }  
     }  
 }       
	

function carrega(url, destino){

document.getElementById(destino).innerHTML="Carregando ...";

fila[fila.length]=[url,destino];

if((ifila+1)==fila.length)ajaxRun();

}



function ajaxRun(){

url = fila[ifila][0];

destino = fila[ifila][1];

xmlhttp.open("GET", url, true);

xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");

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){
	texto=unescape(xmlhttp.responseText.replace(/\+/g," "));
if(xmlhttp.status == 200)
{
document.getElementById(destino).innerHTML = texto;
}
else
{
document.getElementById(destino).innerHTML = "Ocorreu algum erro... avise o suporte minhaos.com.br";
} 

//alert(destino);

ifila++;

if(ifila<fila.length)setTimeout("ajaxRun()",20);

}

}

xmlhttp.send(url);

}


function enviaForm(frmNome, url, destino){
alert("teste");
f = document.getElementById(frmNome);

var query=url;


for (i=0;i<f.elements.length;i++){

query += i==0 ? '?' : '&';

query += f.elements[i].name + '=' + f.elements[i].value;

}

carrega(query, destino);

}



	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 dados(frmNome, url, destino)
{
	 //  var arr = new String(form1.grupo.value);
ajaxGet(url, destino );

}

  ajaxGet = function( nomeUrl, divRetorno ){  
  divInsereResposta = document.getElementById( divRetorno );    
  meuAjax();  
  xmlhttp.abort();  
  xmlhttp.open("GET", nomeUrl ,true);  
  xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
  xmlhttp.onreadystatechange = function() {  
  if( xmlhttp.readyState == 4 ){    
                var valorRetorno = xmlhttp.responseText;  

                divInsereResposta .innerHTML = valorRetorno;                     
             }  
      }    
      xmlhttp.send(null);     
  }  	