function getObj(str) {
	var obj = window.document.getElementById(str);
	return obj;
}


/*
variables:
	product - id of the current rating;
	rate - current user rate for product
*/
function changeRaiting(product,rate,imgpath) {

	for (var i = 1; i <= 5; i++){

		if (i <= rate){
			var img = imgpath + 'star_comm_active.gif'
		} else {
			var img = imgpath + 'star_comm_na.gif'
		}

		getObj('product' + product + 'rate' + i).src = img;

	}

	getObj('product' + product).value = rate;

}