$(document).ready(function(){var A=$("#item-list div[@class='stars']");A.each(function(){var B=$(this).find("a");var C=$(this);B.each(function(D){this.myImg=$(this).find("img");this.myImgSrc=this.myImg.attr("src");this.parent=C;this.message=C.find("h4");this.brothers=B;this.myIndex=D;this.slid=C.attr("slid")}).mouseover(function(){var D=this.myIndex;this.brothers.each(function(E){if(E<=D){this.myImg.attr("src",this.myImg.attr("src").replace(/([^/\.]*\.[\w]{3})$/,"star-gold.jpg"))}})}).mouseout(function(){var D=this.myIndex;this.brothers.each(function(E){if(E<=D){this.myImg.attr("src",this.myImgSrc)}})}).click(function(){this.blur();var E=("looopID="+this.slid+"&rating="+(this.myIndex+1));var D=this;window.il.rpcCall("imagelooop.looopRating",E,function(F){ratingHandler(F,D)});this.brothers.each(function(){this.myImg.attr("src",this.myImg.attr("src").replace(/([^/\.]*\.[\w]{3})$/,"star.jpg"));this.message.html((typeof (ratingI18nThanks)!="undefined")?ratingI18nThanks:"Rating");$(this).css("cursor","default")}).unbind();
return false})})});function ratingHandler(D,B){if(!D||(D&&D.isException)){return false}try{var C=$(B.parent).find("span");C.each(function(){if($(this).attr("class")=="voteCount"){$(this).html(D.voteCount)}});B.brothers.each(function(E){if(E<=(D.rating-1)){this.myImg.attr("src",this.myImg.attr("src").replace(/([^/\.]*\.[\w]{3})$/,"star-active.jpg"))}})}catch(A){}};