/**
 * @author GSandrigo
 */

function CreateRate(rate){
	var html = "";
	var CONST_MAX_RATING = 5;
	var totalStars = 0;
	var fullStars = Math.floor(rate);
	var halfStars = Math.round(rate%1);
	var i = 0;

	for (i=0; i<fullStars; i++){
		html += "<img src=\"http://media1.break.com/static/live/v1/img/content/full.gif\" />";
		totalStars++;
	}
	if(rate%1 != 0){
		for (i=0; i<halfStars; i++){
			html += "<img src=\"http://media1.break.com/static/live/v1/img/content/half.gif\" />";
			totalStars++;
		}
	}
	var emptyStars = CONST_MAX_RATING - totalStars;
	if (totalStars != CONST_MAX_RATING){
		for (i=0; i<emptyStars; i++){
			html += "<img src=\"http://media1.break.com/static/live/v1/img/content/none.gif\" />";
			totalStars++;
		}
	}
	return html;
}

function UpdateRating(score){
	return CreateRate(score);
}