// onmouseover event: kill all stars if rated and update the source on the rest of the stars


function get_rate(z){
	if(z != ""){
		var url = "http://www.psst.ro/takerating.php?rate="+z;
		alert("URL = "+url);
/*		http.open("GET", url, true);
		http.onreadystatechange = handleHttpResponse;
		http.send(null)
*/	}
	else {
		alert("Invalid rating!");
	}
}


function stars(x){
  killem();
  switch(x){
	case 5:
	  document.getElementById('e').src='http://www.psst.ro/images/tpl/star_hover.gif';
	case 4:
	  document.getElementById('d').src='http://www.psst.ro/images/tpl/star_hover.gif';
	case 3:
	  document.getElementById('c').src='http://www.psst.ro/images/tpl/star_hover.gif';
	case 2:
	  document.getElementById('b').src='http://www.psst.ro/images/tpl/star_hover.gif';
	case 1:
	  document.getElementById('a').src='http://www.psst.ro/images/tpl/star_hover.gif';
	  break;
  }
}

// kills all the stars sources
function killem(){
  document.getElementById('a').src='http://www.psst.ro/images/tpl/star.gif';
  document.getElementById('b').src='http://www.psst.ro/images/tpl/star.gif';
  document.getElementById('c').src='http://www.psst.ro/images/tpl/star.gif';
  document.getElementById('d').src='http://www.psst.ro/images/tpl/star.gif';
  document.getElementById('e').src='http://www.psst.ro/images/tpl/star.gif';
}

