var xmlHttp

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;
}


/*function saveModel(id) {
	
	//,guest,app,build,bb	
	
	//alert('he');
	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	 {
	 alert ("Browser does not support HTTP Request")
	 return
	 } 


	//alert('h'+minimum);

	var url="includes/sesh.php"
	url=url+"?var="+Math.random()
	url=url+"&id="+id
	
		
	
	//alert(url);
	xmlHttp.onreadystatechange=makeStateChanged2
	xmlHttp.open("GET",url,true)
	
	xmlHttp.send(null)
}
*/
function saveModel(id,sc) {
	
	//,guest,app,build,bb	
	
	//alert('he');
	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	 {
	 alert ("Browser does not support HTTP Request")
	 return
	 } 


	//alert('h'+minimum);

	var url="includes/score.php"
	url=url+"?var="+Math.random()
	url=url+"&id="+id
	url=url+"&sc="+sc
	
		
	
	//alert(url);
	xmlHttp.onreadystatechange=makeStateChanged2
	xmlHttp.open("GET",url,true)
	
	xmlHttp.send(null)
}



function makeStateChanged2() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
	 var resp = xmlHttp.responseText;
	 
	 
	 //alert(resp);
	 //window.location="quick-vote.html";
	//alert(resp)
	 
	// document.getElementById("tes").innerHTML = resp;
	

	 } 
}

function saveFav(id,usr,t) {
	
	//,guest,app,build,bb	
	
	//alert('he');
	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	 {
	 alert ("Browser does not support HTTP Request")
	 return
	 } 


	//alert('h'+minimum);

	var url="includes/fav.php"
	url=url+"?var="+Math.random()
	url=url+"&id="+id
	url=url+"&usr="+usr
	url=url+"&t="+t
	
		
	
	//alert(url);
	xmlHttp.onreadystatechange=makeStateChanged3
	xmlHttp.open("GET",url,true)
	
	xmlHttp.send(null)
}



function makeStateChanged3() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp2.readyState=="complete")
	 { 
	 var resp = xmlHttp.responseText;
	 
	 
	 //alert(resp);
	 //window.location="quick-vote.html";
	alert(resp)
	 
	// document.getElementById("tes").innerHTML = resp;
	

	 } 
}