var xmlHttp
var id_global


function rate(rating,id)  {
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	 {
	 alert ("Browser does not support HTTP Request")
	 return
	 }
	
	var url='http://www.clubhotel-marotta.com/rateupdate.php?rating='+rating+'&id='+id
	rating = (rating * 25);
	var varia='current-rating_'+id;
	document.getElementById(varia).style.width = rating+'px';
	id_global=id;
	
xmlHttp.onreadystatechange=stateChanged_rate
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged_rate(){ 
 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
	var a = xmlHttp.responseText;
	var varia='starbox_change_'+id_global
	document.getElementById(varia).innerHTML=a;
 }
} 


function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }

return xmlHttp;
}
