if(jQuery.fn.rating=function(){return this.each(function(){function c(){u();w(this)}function l(){u();s()}function o(){e=f;r=i;u();s()}function a(){s();jQuery(this).removeClass("on")}function v(){u();jQuery(this).addClass("on")}function y(){return r=n.index(this)+1,e=0,r==0&&u(),jQuery.ajax({url:p,data:"ajax=1&rating="+jQuery(this).find("a")[0].hash.slice(1),dataType:"json",success:function(n){var t,r;if(n.not_taken)$("#vote_response").html('<span class="error">Take this first to vote!<\/span>'),o();else if(n.already_voted)$("#vote_response").html('<span class="error">You have already voted!<\/span>'),o();else if(n.invalid_rating)$("#vote_response").html('<span class="error">Invalid vote.<\/span>'),o();else if(n.num_votes!=undefined){for($(".quiz_num_votes").html(n.num_votes),$("#vote_response").html('<span class="success">&raquo; Thanks for voting!<\/span>'),i=Math.floor(n.average_rating),f=10*(n.average_rating-i),o(),t=$(".star_rating"),$(t).addClass("hidden"),r=0;r<t.length;r++)$(t[r]).find("span.floatleft").html('<form id="star_rating" name="rating" class="rating" method="post" title="Average Rating: '+i+"."+Math.floor(f)+'" action="'+this.url+'"><select name="rating"><option value="1">1<\/option><option value="2">2<\/option><option value="3">3<\/option><option value="4">4<\/option><option value="5">5<\/option><\/select><input type="submit" value="Submit Rating"><\/form>');$("form.rating").rating();$(t).removeClass("hidden")}}}),!1}function w(t){n.find("a").css("width","100%");n.slice(0,n.index(t)+1).addClass("hover")}function u(){n.removeClass("on hover")}function s(){n.slice(0,r).addClass("on");var t=e?e*10:0;t>0&&n.eq(parseInt(r)).addClass("on").children("a").css("width",t+"%")}var t=jQuery("<div/>").attr({title:this.title});navigator.appName=="Microsoft Internet Explorer"?t[0].className=this.className:t.attr("class",this.className);t.insertAfter(this);t.hasClass("disabled")?jQuery(this).find("select option").each(function(){t.append(this.value=="0"?"<div class='cancel'><\/div>":"<div class='star'><a href=''><\/a><\/div>")}):jQuery(this).find("select option").each(function(){t.append(this.value=="0"?"<div class='cancel'><a href='#0' title='Cancel Rating'>Cancel Rating<\/a><\/div>":"<div class='star'><a href='#"+this.value+"' title='Give it a "+this.value+" Star Rating'>"+this.value+"<\/a><\/div>")});var h=this.title.split(/:\s*/)[1].split("."),p=this.action,i=h[0],r=i,f=h[1],e=f,n=t.find("div.star");t.hasClass("disabled")?(n.find("a").css("width","100%"),n.slice(0,n.index(this)+1)):(n.mouseover(c).focus(c).mouseout(l).blur(l).click(y),t.find("div.cancel").mouseover(v).focus(v).mouseout(a).blur(a).click(y));s()}).remove()},navigator.appName=="Microsoft Internet Explorer")try{document.execCommand("BackgroundImageCache",!1,!0)}catch(e){}