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;
}

var xmlHttp;
var rclicked = false;

function Rating(ID,val){ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 

	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("POST", "ratingprocess.asp", true);
    
	document.getElementById("txtrating").innerHTML="Please wait ...";
                     
    //Since GET isn't passing the variables via URL, you have to create the query from the form field values:
    var query = 'ID' + "=" + escape(ID);
	query += '&rateval' + "=" + escape(val);
	                 
    xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 
    xmlHttp.send(query);
	rclicked = true;
	
}

function stateChanged() { 
	 if((xmlHttp.readyState == 4)&& (xmlHttp.status == 200)){
		document.getElementById("txtrating").innerHTML="Thank you<br>";
		document.getElementById("ratings").style.display="none";
	} else {
		document.getElementById("txtrating").innerHTML="";
	}
}


function RatingOver(txt){
	if (!rclicked){
		document.getElementById('txtrating').innerHTML = txt;
	}
}
