function gamesViewCount(id) {
    JsHttpRequest.query(
        '/view_count/', 
        {id: id}, 
        function(responseJS, responseText) {},
        true 
    );		
	return false;	
}

function gamesVoteCount(id, ball) {
    JsHttpRequest.query(
        '/vote_count/', 
        {id: id, ball: ball}, 
        function(responseJS, responseText) {
			if (responseJS.error!='') {
				alert(responseJS.error)	;
			} else {
				//star_fireup(ball, 1);
				//alert(responseJS.rate);	
				$('stars').innerHTML=responseJS.stars;
			}
		},
        true 
    );		
	return false;	
}

function star_out(rate) {
	for(i=1;i<=5;i++) {
		num=rate.substring(i-1,i);
		
		if (num==1) im='orange';
		else if (num==2) im='grey';
		else im='half_grey';
		document.getElementById('star'+i).src=iUrl+"games/"+"star_" + im + ".gif";	
	}
}


function star_over(number) {	
	for(i=1;i<=5;i++) {
		if(i<=number) im='star_orange.gif'; else im='star_grey.gif';
		document.getElementById('star'+i).src=iUrl+"games/"+im;	
	}	
}

