function GetXmlHttpObject()
{
var objXMLHttp=null;
if (window.XMLHttpRequest)
  {
  objXMLHttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
return objXMLHttp;
}

function VoteSong(rating)
{
document.getElementById('ajaxvoteme').style.visibility='hidden';
element_title="estimate_"+document.getElementById('song_id').value;
document.getElementById(element_title).innerHTML='';

xmlhttp=GetXmlHttpObject();
if (xmlhttp==null){return;}
var url="fono_setrating.php"+"?ID="+document.getElementById('song_id').value+"&vote="+rating+"&sid="+Math.random();
element_title="rating_"+document.getElementById('song_id').value;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function stateChanged()
{
  if (xmlhttp.readyState==4)
  {
  document.getElementById(element_title).innerHTML=xmlhttp.responseText;
  }
}



function Download(songid)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null){return;}
var url="songs_downloadcount.php"+"?ID="+songid+"&sid="+Math.random();
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

