/* Copyright (C) 2007 - 2011 YOOtheme GmbH, YOOtheme Proprietary Use License (http://www.yootheme.com/license) */

(function(a){var b=function(){};a.extend(b.prototype,{name:"ElementRating",options:{url:null},initialize:function(d,c){this.options=a.extend({},this.options,c);var e=this,f=d.find("div.stars");f.each(function(i){a(this).bind("click",function(){a.ajax({url:e.options.url,data:{method:"vote","args[0]":f.length-i},type:"post",datatype:"json",success:function(g){g=a.parseJSON(g);var h=g.value;h>0&&d.find("div.previous-rating").css("width",h+"%");d.find("div.vote-message").text(g.message)}})}).bind("mouseenter",
function(){a(this).addClass("hover")}).bind("mouseleave",function(){a(this).removeClass("hover")})})}});a.fn[b.prototype.name]=function(){var d=arguments,c=d[0]?d[0]:null;return this.each(function(){var e=a(this);if(b.prototype[c]&&e.data(b.prototype.name)&&c!="initialize")e.data(b.prototype.name)[c].apply(e.data(b.prototype.name),Array.prototype.slice.call(d,1));else if(!c||a.isPlainObject(c)){var f=new b;b.prototype.initialize&&f.initialize.apply(f,a.merge([e],d));e.data(b.prototype.name,f)}else a.error("Method "+
c+" does not exist on jQuery."+b.name)})}})(jQuery);
(function(a){var b=function(){};a.extend(b.prototype,{name:"EditElementRating",options:{url:null},initialize:function(d,c){this.options=a.extend({},this.options,c);var e=this;d.find('input[name="reset-rating"]').bind("click",function(){a.ajax({url:e.options.url+"&task=callelement&method=reset",success:function(f){d.replaceWith(f)}})})}});a.fn[b.prototype.name]=function(){var d=arguments,c=d[0]?d[0]:null;return this.each(function(){var e=a(this);if(b.prototype[c]&&e.data(b.prototype.name)&&c!="initialize")e.data(b.prototype.name)[c].apply(e.data(b.prototype.name),
Array.prototype.slice.call(d,1));else if(!c||a.isPlainObject(c)){var f=new b;b.prototype.initialize&&f.initialize.apply(f,a.merge([e],d));e.data(b.prototype.name,f)}else a.error("Method "+c+" does not exist on jQuery."+b.name)})}})(jQuery);

