﻿function OnRatingStarOver( node )
{
	node.className = "rating_star_hover";
}

function OnRatingStarOut( node )
{
	node.className = "rating_star";
}

function OnRateChanged_Callback( data )
{
	var arr_data = data.split(":");
	if( arr_data[2] != "-1" )
	{
		var average_vote = parseFloat( arr_data[0] );
		var votes = parseInt( arr_data[1] );
		var votes_bg_width = ( average_vote == 0 ? 0 : Math.floor(80 / 5 * average_vote) );
		document.getElementById("rc_callback_info").innerHTML = ( arr_data[2] == "1" ? "Your vote is updated." : "Your vote is accepted.")
		document.getElementById("rc_total_votes").innerHTML = "(" + votes + " vote" + ( votes > 1 ? "s" : "" ) + ")";
		document.getElementById("rc_show_fill").style.width = votes_bg_width + "px";
	}
}
