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(vid,nr) { 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'; } } } //alert("http://localhost/HIPG/httpdocs/ajax/rating.php?video="+vid+"&rating="+nr);return false; req.open('GET', "http://www.howiplaygolf.com/ajax/rating.php?video="+vid+"&rating="+nr); 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