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

(function(b){var a=function(){};b.extend(a.prototype,{name:"SubmissionMysubmissions",options:{msgDelete:"Are you sure you want to delete this submission?"},initialize:function(a,c){this.options=b.extend({},this.options,c);var d=this;a.find("ul.submissions > li").each(function(){var a=b(this);a.find("h3.toggler").bind("click",function(){a.find("div.preview").toggleClass("hidden")})});a.find("a.delete-item").each(function(){b(this).bind("click",function(a){confirm(d.options.msgDelete)||a.preventDefault()})})}});
b.fn[a.prototype.name]=function(){var e=arguments,c=e[0]?e[0]:null;return this.each(function(){var d=b(this);if(a.prototype[c]&&d.data(a.prototype.name)&&c!="initialize")d.data(a.prototype.name)[c].apply(d.data(a.prototype.name),Array.prototype.slice.call(e,1));else if(!c||b.isPlainObject(c)){var f=new a;a.prototype.initialize&&f.initialize.apply(f,b.merge([d],e));d.data(a.prototype.name,f)}else b.error("Method "+c+" does not exist on jQuery."+a.name)})}})(jQuery);
(function(b){var a=function(){};b.extend(a.prototype,{name:"Submission",options:{uri:""},initialize:function(a,c){this.options=b.extend({},this.options,c);var d=this;a.find("div.image a.modal-button").each(function(){b(this).attr("href").match(RegExp("^"+d.options.uri))||b(this).attr("href",d.options.uri+b(this).attr("href"))})}});b.fn[a.prototype.name]=function(){var e=arguments,c=e[0]?e[0]:null;return this.each(function(){var d=b(this);if(a.prototype[c]&&d.data(a.prototype.name)&&c!="initialize")d.data(a.prototype.name)[c].apply(d.data(a.prototype.name),
Array.prototype.slice.call(e,1));else if(!c||b.isPlainObject(c)){var f=new a;a.prototype.initialize&&f.initialize.apply(f,b.merge([d],e));d.data(a.prototype.name,f)}else b.error("Method "+c+" does not exist on jQuery."+a.name)})}})(jQuery);
(function(b){var a=function(){};b.extend(a.prototype,{name:"EditSubmission",initialize:function(a){var c=this;this.input=a;b.each(["apply","save","saveandnew"],function(c,f){b("#toolbar-"+f+" a").bind("validate.adminForm",function(b){a.find('input[name="name"]').val()==""&&(a.find("span.message-name").css("display","block"),b.preventDefault())})});b("#access").bind("change",function(){c.setTrustedMode()});this.setTrustedMode()},setTrustedMode:function(){var a=this.input.find("input.trusted");b("#access").val()==
"0"?(a.attr("disabled","disabled"),a.attr("checked","")):a.removeAttr("disabled")}});b.fn[a.prototype.name]=function(){var e=arguments,c=e[0]?e[0]:null;return this.each(function(){var d=b(this);if(a.prototype[c]&&d.data(a.prototype.name)&&c!="initialize")d.data(a.prototype.name)[c].apply(d.data(a.prototype.name),Array.prototype.slice.call(e,1));else if(!c||b.isPlainObject(c)){var f=new a;a.prototype.initialize&&f.initialize.apply(f,b.merge([d],e));d.data(a.prototype.name,f)}else b.error("Method "+
c+" does not exist on jQuery."+a.name)})}})(jQuery);
