var ratings = new Array();
var bugged = 0;

function showStars( product_id, rating ) {
 bugged = 1;
 for ( count = 1; count < 4; count++ ) {
  for ( i = 1;  i < 6; i++ ) {
   suffix = count > 1 ? "_"+count : "";
   img = eval("document.star_"+product_id+"_"+i+suffix);
   if (img) {
    bugged = 0;
  	if ( i <= rating ) {
	 img.src = "http://download.omani.ac/images/icons/red-star-js.gif";
	} else {
     img.src = "http://download.omani.ac/images/icons/blank_star.gif";
	}
   }
  }
 }
}

function rate( product_id, rating ) {
 if ( bugged ) {
  return true;     // should just follow link
 }
 rnd = Math.random();
 star = new Image();
 star.src = "http://download.omani.ac/rate.php?fr="+rnd+"&r=" + rating + "&p=" + product_id;
 ratings[product_id] = rating;
 return false;    // tells onClick not to follow link
}

function preLoadStars() {
 blank = new Image();
 blank.src = "http://download.omani.ac/images/icons/red-star-js.gif";
 clear = new Image();
 clear.src = "http://download.omani.ac/images/icons/blank_star.gif";
}