


    var ratings = new Array();
    var bugged = 0;


    function showStars( photo_id, rating ) {

        bugged = 1;

        for ( count = 1; count < 4; count++ ) {
           for ( i = 1;  i < 6; i++ ) {

		  suffix = count > 1 ? "_"+count : "";
		  img = eval("document.star_"+photo_id+"_"+i+suffix);

		  if (img) {
		    bugged = 0;
  		    if ( i <= rating ) {
		        img.src = "images/star_blue.gif";
		    }
		    else {
		        img.src = "images/blank_star.gif";
		    }
		  }

	    }
        }

     }


    function rate( photo_id, rating, limit) {

		if ( bugged ) {
		  return true;     // should just follow link
		}
		if (rating < limit) {
			question = confirm('Most people disagree with your rating of ' + rating + ' star(s). Are you sure this is what this photo is worth? If you are, click OK to register your vote. If you would like another go, click Cancel.');
			if (question == false) {
				return false;
			}
		}
		
		star = new Image();
		star.src = "servlet/ratephoto?rating=" + rating + "&photoid=" + photo_id;

		ratings[photo_id] = rating;
	
		return false;    // tells onClick not to follow link
    }
