function showRating() {
	var thisDiv = document.getElementById("overlay");
	
	thisDiv.style.display = "block";
}

function hideRating() {
	var thisDiv = document.getElementById("overlay");
	
	thisDiv.style.display = "none";
}

function setState(stars) {
	var counter = 1;
	
	do {
		var theStar = document.getElementById("star" + counter);
		theStar.src = '/images/icons/rate1.png';
		counter++;
	} while (counter <= stars)
}

function returnState(stars) {
	var counter = 1;
	
	do {
		var theStar = document.getElementById("star" + counter);
		theStar.src = '/images/icons/rate2.png';
		counter++;
	} while (counter <= stars)
}

function rate(rating, gid, check) {	
//	alert(rating + ' + ' + gid + ' + ' + check);
	
	$.ajax({
		type: "POST",
		url: "/ajax/rate.php",
		data: "rating=" + rating + "&gid=" + gid + "&check=" + check,
		success: function(msg){
			document.getElementById("bar").style.width = msg + '%';
		}
	});
	
	document.getElementById("overlay").innerHTML = '';
}