function rateClick(r){
  document.getElementById('rating-r').value = (r/2 - 1);
  for(var i = 0; i < 5; i++){
	var picdiv = document.getElementById('torate-r' + i);
	var offx = 18*(i+1) + 1;
	var postr = "-" + offx + "px -1";
	if(i == r){
	  postr += "9";
	}
	postr += "px";
	picdiv.style.backgroundPosition = postr;
  }
}
function starClick(s){
  var hidel = document.getElementById('rating-s');
  var postr = "-1px -1px";
  var nval = 0;
  if(hidel.value == 0){
	postr = "-1px -19px";
	nval = 1;
  }
  document.getElementById('torate-s').style.backgroundPosition = postr;
  hidel.value = nval;
}
function showRerate(){
  document.getElementById('reratespan').style.display = 'none';
  document.getElementById('raterform').style.display = 'block';
}
