// Preload images used for ratings
var stars_0_5 = new Image(90,15);
stars_0_5.src = "images/stars2_0.5.png";
var stars_1_0 = new Image(90,15);
stars_1_0.src = "images/stars2_1.0.png";
var stars_1_5 = new Image(90,15);
stars_1_5.src = "images/stars2_1.5.png";
var stars_2_0 = new Image(90,15);
stars_2_0.src = "images/stars2_2.0.png";
var stars_2_5 = new Image(90,15);
stars_2_5.src = "images/stars2_2.5.png";
var stars_3_0 = new Image(90,15);
stars_3_0.src = "images/stars2_3.0.png";
var stars_3_5 = new Image(90,15);
stars_3_5.src = "images/stars2_3.5.png";
var stars_4_0 = new Image(90,15);
stars_4_0.src = "images/stars2_4.0.png";
var stars_4_5 = new Image(90,15);
stars_4_5.src = "images/stars2_4.5.png";
var stars_5_0 = new Image(90,15);
stars_5_0.src = "images/stars2_5.0.png";

function newcomment() {
	var o = document.getElementById("newcomment");
	if (o) {
		if (o.style.display == "none") {
			o.style.display = "block";
		} else {
			o.style.display = "none";
		}
	}
}

function setscore(name, value) {
	var o = document.getElementById("score_" + name);
	if (o) {
		o.value = value;
		updatescore(name, value);
	}
}

function refreshscore(name) {
	var o = document.getElementById("score_" + name);
	var e = document.getElementById(name);
	if (e) {
		//e.style.background = "url('images/stars_"+o.value+".gif')";
		//e.style.background = 'url(images/stars2.php?score='+o.value+'&bg=fff&c1=900&c2=cc9)  no-repeat';
		e.style.background = "url('images/stars2_"+o.value+".png')";
	}
}

function updatescore(name, value) {
	var e = document.getElementById(name);
	 if (e) {
		//e.style.background = "url('images/darkstars_"+value+".gif')";
		//e.style.background = 'url(images/stars2.php?score='+value+'&bg=fff&c1=900&c2=cc9) no-repeat';
		e.style.background = "url('images/stars2_"+value+".png')";
	}
}

