var xmlHttp;
/****** Voting Req************/
function getVote(int,id)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="/ajax/poll_vote.php";
var param = 'vote=' + int +'&n=' + id
xmlHttp.onreadystatechange=stateChangedVote 
xmlHttp.open("post",url,true)
xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlHttp.send(param);
} 

function stateChangedVote() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 		
	/*document.getElementById("poll").innerHTML='Thank you for voting!';*/
	document.getElementById("poll").innerHTML=xmlHttp.responseText;	
 } else
 {	
	document.getElementById("poll").innerHTML='Recording...';
	/*document.getElementById("star").innerHTML='Updating...';*/
 }
} 
/****** End Voting Req **********/

/******* Star Req ********/
function getStar(url)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url= url
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateChanged() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 	
	document.getElementById("star").innerHTML=xmlHttp.responseText;	
 } else
 {
	document.getElementById("star").innerHTML='Updating...';	
 }
} 
/******* End Star Req ********/

/******* View Req ********/
function getView(url)
{
Http=GetXmlHttpObject()
if (Http==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url= url
Http.onreadystatechange=stateView 
Http.open("GET",url,true)
Http.send(null)
} 

function stateView() 
{ 
 if (Http.readyState==4 || Http.readyState=="complete")
 { 	
	document.getElementById("view").innerHTML=Http.responseText;	
 } else
 {
	document.getElementById("view").innerHTML='Updating...';	
 }
} 

function statsRating(url)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url= url
	xmlHttp.onreadystatechange=stateRating
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 

function stateRating() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 	
	document.getElementById("star").innerHTML=xmlHttp.responseText;	
 } else
 {
	document.getElementById("star").innerHTML='Updating...';	
 }
} 

function getRating(int,id)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="/ajax/poll_rating.php";
	var param = 'vote=' + int +'&n=' + id
	xmlHttp.onreadystatechange=stateChangedRating
	xmlHttp.open("post",url,true)
	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xmlHttp.send(param);
} 

function stateChangedRating() 
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 		
		document.getElementById("poll").innerHTML=xmlHttp.responseText;	
	} else
	{	
		document.getElementById("poll").innerHTML='Recording...';
	}
}  
/******* End View Req ********/

/*last played function*/
function lastplayed(url)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url= url
xmlHttp.onreadystatechange=stateLast 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateLast() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 	
	document.getElementById("last").innerHTML=xmlHttp.responseText;	
 } else
 {
	document.getElementById("last").innerHTML='<center>Updating...</center>';	
 }
} 

/*end last played function*/

function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
 {
 objXMLHttp=new XMLHttpRequest()
 }
else if (window.ActiveXObject)
 {
 objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
 }
return objXMLHttp
}