var xmlHttp

	function doRating(pointIs,courseIs)
	{ 
	//alert (imgid);
	//document.getElementById('homeDet').style.display='none';
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	} 
	var url="rating/ajax.php"
	url=url+"?pointIdIs="+pointIs
	url=url+"&courseId="+courseIs
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	}





function stateChanged() 
{ 
	if(xmlHttp.readyState>=0 && xmlHttp.readyState<4)
	{
		document.getElementById("ratingColumn").innerHTML='<img src="../images/loader.gif" border="0" />';	
	}
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		//alert (xmlHttp.responseText);
		var str=xmlHttp.responseText;
		
		
		document.getElementById("ratingColumn").innerHTML=str;
		pointsSelected="";
		//alert(str);
		
		$(function(){
		 $('input[type=radio].star').rating();
		});
	}

} 
 


function checkRating(pointIs,courseIs)
	{ 
	//alert (imgid);
	//document.getElementById('homeDet').style.display='none';
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	} 
	var url="rating/ajax.php"
	url=url+"?pointIdIs="+pointIs
	url=url+"&courseId="+courseIs
	url=url+"&typeIs=checking"
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=ratingCheck 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	
	}





function ratingCheck() 
{ 
	if(xmlHttp.readyState>=0 && xmlHttp.readyState<4)
	{
		document.getElementById("ratingColumn").innerHTML='<img src="images/loader.gif" border="0" />';	
	}
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		//alert (xmlHttp.responseText);
		var str=xmlHttp.responseText;
		
		alert(str);
		doRating(pointsSelected,document.frmRate.hidCourseId.value);
		
		//doRating(pointIs,courseIs)
	}

} 




function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}



