var UT_RATING_IMG='icn_star_full_19x20png'; var UT_RATING_IMG_HALF='icn_star_half_19x20png'; var UT_RATING_IMG_BG='icn_star_empty_19x20png'; var nr1 = 0; var hasVoted = 0; var rating_value = 0; function setStars(cid,nr) { //alert(1); var req = new XMLHttpRequest(); req.onreadystatechange = function() { if (req.readyState == 4 && (req.status == 200 || req.status == 304)) { if(req.responseText > 0) { hasVoted = 1; rating_value = req.responseText; document.getElementById('hoverMessage').style.visibility = 'visible'; document.getElementById('courseRateResult').innerHTML = 'The actual rating you gave is '+nr+' out of 5'; } } } //alert("http://pankaj/HIPG/httpdocs/ajax/rating_blog.php?blog="+bid+"&rating="+nr);return false; req.open('GET', "http://www.howiplaygolf.com/ajax/rating_course.php?course="+cid+"&rating="+nr+"&type=course"); req.send(null); } function showStars(nr) { //alert(nr); if(hasVoted) document.getElementById('hoverMessage').style.visibility = 'visible'; else // alert('Inside show stars above colorStars'); colorStars(nr); } function clearStars() { colorStars(rating_value); } function colorStars(starNum) { //alert(UT_RATING_IMG); //alert(UT_RATING_IMG_HALF); //alert(UT_RATING_IMG_BG); //alert('1'); for(var i=0;i<5;i++) { removeClass(document.getElementById('star__'+(i+1)),UT_RATING_IMG); removeClass(document.getElementById('star__'+(i+1)),UT_RATING_IMG_HALF); addClass(document.getElementById('star__'+(i+1)),UT_RATING_IMG_BG); } for(var i=0;i