//Ajax
function getXML(){
    var xmlhttp;
    try{
        xmlhttp = new XMLHttpRequest();
    }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
	objxml.open("GET",url,false);
	objxml.onreadystatechange = function(){
									if (objxml.readyState == 4) {	
										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;
	objxml.open("GET",url,true);
	objxml.onreadystatechange = function(){
									if (objxml.readyState == 4) {		
										layerA.obj.innerHTML = objxml.responseText;
									}
								}
	objxml.send(null);
}
