var picArr = new Array();

function show(str){
	document.getElementById("help-text").innerHTML = str;
}

function activateImage(id){
	picArr.push(id);
	for(var i = 0; i < picArr.length; i++){
		document.getElementById(picArr[i]).style.border = "3px solid #ffffff";
	}
	document.getElementById(id).style.border = "3px solid #00FF00";
	document.getElementById("selectedImage").value = id;
}

function updateStars(id){
	stars = 5;
	/* clear all stars before updating */
	for(i = 0; i < stars; i++){
		document.getElementById("star-" + i).src="images/article-images/staroff.png";

	}
	var a = id.split("-");
	a = parseInt(a[1]);
	
	for(i = 0; i <= a; i++){
		document.getElementById("star-" + i).src="images/article-images/staron.png";
	}
	document.getElementById("rating").value = a+1;

}


$(document).ready(function(){
	$("#writecomment").hide();
	$("#showless").hide();
	
	$("#more").click(function(event){
		event.preventDefault();
		$("div.comments div.addComment table.commentTable:hidden").slideDown("slow", function(){
			$("#showmore").hide("fast", function(){
				$("#showless").show("fast");
			}); 	
		});
	});
	
	$("#less").click(function(event){
		event.preventDefault();
		$("div.comments div.addComment table.commentTable:visible").slideUp("slow", function(){
			$("#showless").hide("fast", function(){
				$("#showmore").show("fast");
			});
		});
	});

});


