var xmlHttp

function ajax_ratings(str)
{
//alert(str2);
//if (str.length==0)
//  { 
//  document.getElementById("txtHint").innerHTML="";
//  return;
//  }
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var pieces=str.split(':'); 

//add/edit/delete/view  0
//concert/roio  1
//concert_id  2
//bootleg_id  3
//rating_id  4
//rating  5


var url="/ajax/get_ratings.php";
url=url+"?p="+str;
// alert (url);
// url=url+"&sid="+Math.random();

if (pieces[1] == 'concert') {
	xmlHttp.onreadystatechange=stateChanged_concert_ratings;
}
if (pieces[1] == 'roio') {
	xmlHttp.onreadystatechange=stateChanged_roio_ratings;
}
if (pieces[1] == 'voio') {
	xmlHttp.onreadystatechange=stateChanged_roio_ratings;
}
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} 


function stateChanged_concert_ratings() 
{ 
	if (xmlHttp.readyState==4){
		document.getElementById("ajax_concert_ratings").innerHTML=xmlHttp.responseText;
	}
	if (xmlHttp.readyState==1 || xmlHttp.readyState=="loading") {
		document.getElementById("ajax_concert_ratings").innerHTML="<div align=center><br/><br/><br/><img src=\"/images/big-ajax-loader.gif\"></div>";
	}
}

function stateChanged_roio_ratings() 
{ 
	if (xmlHttp.readyState==4){
		document.getElementById("ajax_roio_ratings").innerHTML=xmlHttp.responseText;
	}
	if (xmlHttp.readyState==1 || xmlHttp.readyState=="loading") {
		document.getElementById("ajax_roio_ratings").innerHTML="<div align=center><br/><br/><br/><img src=\"/images/big-ajax-loader.gif\"></div>";
	}
}



//function stateChanged_concert_ratings() 
//{ 
//if (xmlHttp.readyState==4){
//	if (pieces[1] == 'concert')	document.getElementById("ajax_concert_ratings").innerHTML=xmlHttp.responseText;

//	if (pieces[1] == 'roio')document.getElementById("ajax_roio_ratings").innerHTML=xmlHttp.responseText;
//}

//if (xmlHttp.readyState==1 || xmlHttp.readyState=="loading") document.getElementById("ajax_concert_ratings").innerHTML="<div align=center><br/><br/><br/><img src=\"/images/big-ajax-loader.gif\"></div>"
//}

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;
}