var xmlHttp;
function cast_vote(id, vt)
{ 
	xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
	   { alert ("Browser does not support AJAX technology"); return; }

	var url="includes/ajax/aud_voting.php";
	url=url+"?aud_id=" + id + "&vote=" + vt ;
//	alert("URL is "+url);
	xmlHttp.onreadystatechange = stateChanged_aud ;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

	function stateChanged_aud() 
	{ 
	  if (xmlHttp.readyState == 1) /* show bussy for getting result from DB */ 
		 { 
        document.getElementById("result").innerHTML = '&nbsp;<img src=images/progress-bar.gif border=0 />'; 
     	} 		
	else if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
	 //alert(xmlHttp.responseText);
	 document.getElementById("result").innerHTML=xmlHttp.responseText 
	 window.location.href = 'audition_results.php';
	// document.getElementById("track").focus();
	 } 
	}

	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;
		}