//Ajax
function getXML()
{
    var xmlhttp;
    
    try
    {
    	xmlhttp = new XMLHttpRequest(); //Este código estava comentado e sem ele ajax no firefox não funciona
	}
	catch(k)
	{
	    try
	    {
			xmlhttp = CreateObject("MSXML2.ServerXMLHTTP.4.0");
	    }
	    catch(ee)
	    {
	        try
	        {
	            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");            
	        }
	        catch(e)
	        {
	            try
	            {
	                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");            
	            }
	            catch(E)
	            {
	                xmlhttp = false;
	            }
	        }
		}
   }   
   return xmlhttp;
}

function GetUrl(url)
{		
	var saida = ''
	objxml = new getXML();
	//essa precisa ser sincrona para retornar o conteudo da pagina na funcao
   	/*if (navigator.appName=="Netscape")
   	{
	    objxml.open("POST",url,false);
	}    
    else
    {*/
	    objxml.open("GET",url,false);
	//}    
	
	objxml.onreadystatechange = function(){
									if (objxml.readyState == 4) {	
										saida = objxml.responseText;
									}
								}
	objxml.send(null);

	return saida;
}

function GetUrlOVD(url)
{
	var saida = ''
	objxml = new getXML();	
	rand = Math.random();
	cola = '?';
	if(inStr(url, '?'))	
	{
		cola = '&';
	}
	else 
	{
		cola = '?';
	}
	url += cola+"rand=" + rand;	
   	
   	/*/
   	if (navigator.appName=="Netscape")
   	{
	    objxml.open("POST",url,false);
	}    
	else
	{*/
		objxml.open("GET",url,false);
	//}
		
	objxml.onreadystatechange = function(){
									if (objxml.readyState == 4) {										
										if (objxml.status == 200) {
											saida = objxml.responseText;
										}										
									}
								}
	objxml.send(null);

	return saida;
}

function LoadUrl(url, layerN)
{
    var layerA = new getObj(layerN);
    layerA.obj.innerHTML = "<span style='background-color:#FFF;color:#000'>Carregando...</span>";			
	objxml = new getXML();
	rand = Math.random();
	cola = '?';
	if(inStr(url, '?'))	
	{
		cola = '&';
	}
	else 
	{
		cola = '?';
	}
	url += cola+"rand=" + rand;
   	
   	/*/
   	if (navigator.appName=="Netscape")
   	{
	    objxml.open("POST",url,false);
	}    
	else
	{*/
		objxml.open("GET",url,true);
	//}
	
	objxml.onreadystatechange = function(){
									if (objxml.readyState == 4) {		
										layerA.obj.innerHTML = objxml.responseText;
									}
								}
	objxml.send(null);
}
