!function(a,b,c,d){a.fn.rating=function(b){var c,e=a(this),f=e.selector||"",g=a.extend(!0,{},a.fn.rating.settings,b),h=g.namespace,i=g.className,j=g.metadata,k=g.selector,l=g.error,m="."+h,n="module-"+h,o=(new Date).getTime(),p=[],q=arguments[0],r="string"==typeof q,s=[].slice.call(arguments,1);return e.each(function(){var b,h=a(this),t=h.find(k.icon),u=this,v=h.data(n);b={initialize:function(){b.verbose("Initializing rating module"),g.interactive&&t.bind("mouseenter"+m,b.event.mouseenter).bind("mouseleave"+m,b.event.mouseleave).bind("click"+m,b.event.click),g.initialRating&&(b.debug("Setting initial rating"),b.setRating(g.initialRating)),h.data(j.rating)&&(b.debug("Rating found in metadata"),b.setRating(h.data(j.rating))),h.addClass(i.active),b.instantiate()},instantiate:function(){b.verbose("Instantiating module",g),h.data(n,b)},destroy:function(){h.removeData(n),t.off(m)},setRating:function(c){var d=t.eq(c-1);b.verbose("Setting current rating to",c),h.removeClass(i.hover),t.removeClass(i.hover),d.nextAll().removeClass(i.active),d.addClass(i.active).prevAll().addClass(i.active),a.proxy(g.onRate,u)()},event:{mouseenter:function(){var b=a(this);b.nextAll().removeClass(i.hover),h.addClass(i.hover),b.addClass(i.hover).prevAll().addClass(i.hover)},mouseleave:function(){h.removeClass(i.hover),t.removeClass(i.hover)},click:function(){var c=a(this);b.setRating(t.index(c)+1)}},setting:function(b,c){return c===d?g[b]:(a.isPlainObject(b)?a.extend(!0,g,b):g[b]=c,void 0)},internal:function(c,e){return e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},debug:function(){g.debug&&(g.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,g.moduleName+":"),b.debug.apply(console,arguments)))},verbose:function(){g.verbose&&g.debug&&(g.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,g.moduleName+":"),b.verbose.apply(console,arguments)))},error:function(){b.error=Function.prototype.bind.call(console.error,console,g.moduleName+":"),b.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;g.performance&&(c=(new Date).getTime(),e=o||c,d=c-e,o=c,p.push({Element:u,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var c=g.name+":",h=0;o=!1,clearTimeout(b.performance.timer),a.each(p,function(a,b){h+=b["Execution Time"]}),c+=" "+h+"ms",f&&(c+=" '"+f+"'"),e.size()>1&&(c+=" ("+e.size()+")"),(console.group!==d||console.table!==d)&&p.length>0&&(console.groupCollapsed(c),console.table?console.table(p):a.each(p,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),p=[]}},invoke:function(e,f,g){var h,i,j;return f=f||s,g=u||g,"string"==typeof e&&v!==d&&(e=e.split(/[\. ]/),h=e.length-1,a.each(e,function(c,f){var g=c!=h?f+e[c+1].charAt(0).toUpperCase()+e[c+1].slice(1):e;if(a.isPlainObject(v[f])&&c!=h)v=v[f];else{if(!a.isPlainObject(v[g])||c==h)return v[f]!==d?(i=v[f],!1):v[g]!==d?(i=v[g],!1):(b.error(l.method),!1);v=v[g]}})),a.isFunction(i)?j=i.apply(g,f):i!==d&&(j=i),a.isArray(c)?c.push(j):"string"==typeof c?c=[c,j]:j!==d&&(c=j),i}},r?(v===d&&b.initialize(),b.invoke(q)):(v!==d&&b.destroy(),b.initialize())}),c!==d?c:this},a.fn.rating.settings={name:"Rating",namespace:"rating",verbose:!0,debug:!0,performance:!0,initialRating:0,interactive:!0,onRate:function(){},error:{method:"The method you called is not defined"},metadata:{rating:"rating"},className:{active:"active",hover:"hover",loading:"loading"},selector:{icon:".icon"}}}(jQuery,window,document);