$(function(){function b(a){a=a||$("span.rating input[name=rating]").val();a=$("span.rating a:eq("+(a-1)+")");a.nextAll().css({"background-position":"0 -16px"});a.css({"background-position":"0 0"});a.prevAll().css({"background-position":"0 0"})}$("span.rating a").hover(function(){b(this.rel)},function(){b()}).click(function(){$("span.rating input[name=rating]").val(this.rel);b(this.rel)});b()});