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

(function(d){var e=function(){};d.extend(e.prototype,{name:"ZooSubmission",initialize:function(b){var c=this;this.input=b;this.content_panel=b.closest("div.content");this.selects=b.find("select");this.types=b.find("div.types");this.setValues();this.selects.filter(".application").bind("change",function(){c.setValues()});this.selects.filter(".submission").bind("change",function(){c.setValues()});b.delegate("select","change",function(){d(this).closest("div.content").css("height","")})},setValues:function(){var b,
c;(b=this.selects.filter(".application").val())?(c=null,this.selects.filter(".submission").each(function(){var a=d(this);a.hasClass("app-"+b)?(a.removeClass("hidden"),a.attr("name",a.attr("role")),c=a.attr("value")):(a.addClass("hidden"),a.attr("name",""),a.attr("value",""))}),this.selects.filter(".type").each(function(){var a=d(this);a.hasClass("app-"+b)&&a.hasClass("submission-"+c)?(a.removeClass("hidden"),a.attr("name",a.attr("role"))):(a.addClass("hidden"),a.attr("name",""),a.attr("value",""))})):
this.selects.filter(".submission, .type").each(function(){var a=d(this);a.addClass("hidden");a.attr("name","");a.attr("value","")})}});d.fn[e.prototype.name]=function(){var b=arguments,c=b[0]?b[0]:null;return this.each(function(){var a=d(this);if(e.prototype[c]&&a.data(e.prototype.name)&&c!="initialize")a.data(e.prototype.name)[c].apply(a.data(e.prototype.name),Array.prototype.slice.call(b,1));else if(!c||d.isPlainObject(c)){var f=new e;e.prototype.initialize&&f.initialize.apply(f,d.merge([a],b));
a.data(e.prototype.name,f)}else d.error("Method "+c+" does not exist on jQuery."+e.name)})}})(jQuery);
