function Session(id_imoveis)
{
	xmlHttp=GetXmlHttpObject();
	url="session.asp";
	
	var id_imoveis = id_imoveis;
	var excluir = document.getElementById(id_imoveis+"_excluir").value;
	
	url = url + "?sid=" + Math.random();
	url = url + "&id_imoveis="+ id_imoveis;
	url = url + "&excluir="+ excluir;
	
	xmlHttp.onreadystatechange=CriaSession;
	
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
 	
	if (xmlHttp.readyState == 1){
		
		if (excluir == 0){ 
			document.getElementById(id_imoveis).className = "estrelaCurrent";
			document.getElementById(id_imoveis+"_excluir").value = "1"
		}
		else if(excluir == 1){ 
			document.getElementById(id_imoveis).className = "estrela";
			document.getElementById(id_imoveis+"_excluir").value = "0"
		}
		else {
			document.getElementById(id_imoveis).style.display = "none";
		}
	}

	function CriaSession(){ 
		if (xmlHttp.readyState==4){ 
			document.getElementById('contagem').innerHTML = xmlHttp.responseText;
		}
	}

}

function GetXmlHttpObject()
	{
	 if (window.XMLHttpRequest) {   
			   a=new XMLHttpRequest(); } //Objeto nativo (FF/Safari/Opera7.6+)  
		   else {  
			 try {   
				a=new ActiveXObject("Msxml2.XMLHTTP");  //activeX (IE5.5+/MSXML2+)  
			 }	 
			 catch(e) {  
			   try {   
				  a=new ActiveXObject("Microsoft.XMLHTTP"); //activeX (IE5+/MSXML1)  
			   }	 
			   catch(e) { /* O navegador não tem suporte */   
				  a=false;   
			   }  
			 }  
		   }   
		   return a;  
	}
