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 hasVotedSurrounding = 0; var rating_valueSurrounding = 0; function setStarsSurrounding(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) { hasVotedSurrounding = 1; rating_valueSurrounding = req.responseText; document.getElementById('hoverMessageSurrounding').style.visibility = 'visible'; document.getElementById('surroundingsRateResult').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=surroundings"); req.send(null); } function showStarsSurrounding(nr) { //alert('0'); //alert(nr); //alert(hasVotedSurrounding); if(hasVotedSurrounding){ //alert('1'); document.getElementById('hoverMessageSurrounding').style.visibility = 'visible'; }else{ // alert('Inside show stars above colorStars'); //alert('2'); colorStarsSurrounding(nr); } } function clearStarsSurrounding() { colorStarsSurrounding(rating_valueSurrounding); } function colorStarsSurrounding(starNum) { //alert(UT_RATING_IMG); //alert(UT_RATING_IMG_HALF); //alert(UT_RATING_IMG_BG); //alert('1'); for(var i=0;i<5;i++) { removeClassSurrounding(document.getElementById('Surroundingstar__'+(i+1)),UT_RATING_IMG); removeClassSurrounding(document.getElementById('Surroundingstar__'+(i+1)),UT_RATING_IMG_HALF); addClassSurrounding(document.getElementById('Surroundingstar__'+(i+1)),UT_RATING_IMG_BG); } for(var i=0;i