(function(a){function c(a){return a.offsetParent?a.offsetTop+c(a.offsetParent):a.offsetTop}function b(){var a=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,a=a-(c(document.getElementById("yit_iframe"))+d),a=0>a?0:a;document.getElementById("yit_iframe").style.height=a+"px"}var d=10;"undefined"==typeof jQuery.fn.live&&(jQuery.fn.live=function(a,b,d){jQuery(this.context).on(a,this.selector,b,d);return this});a(document).ready(function(){a("#configure-forms").change(function(){a("#yit_contact_forms").submit()}); 0<a("#yit_iframe").length&&b();a("#export-file").click(function(){a("[name=yit-action]").val("export-file")});a("#import-file").change(function(){a("[name=yit-action]").val("import-file")});a("#configuration-name").focus(function(){a("[name=yit-action]").val("configuration-save")});a("#configuration-restore, #configuration-restore-save").bind("click change",function(){a("[name=yit-action]").val("configuration-restore")});a(".configuration-remove-item").click(function(b){b.preventDefault();a("[name=yit-action]").val("configuration-remove"); a("#configuration-remove").val(a(this).attr("rel"));a(this).parents("form").submit()})});a(window).resize(function(d){0<a("#yit_iframe").length&&b(d)})})(jQuery); (function(a){var c=function(){};c.prototype=function(){openTab=function(b){if(!a(b).parent().hasClass("active")){hideTabs();openMenu(b);var d=a(b).attr("href");a(d).fadeIn();a(b).parent().addClass("active")}0<a(b).parents(".yit-rightmenu").length&&(d=a(b).attr("href"),a(b).parents(".yit-menu-top").find("a[href="+d+"]").parent().addClass("active"))};hideTabs=function(){a(".yit-box").hide()};openMenu=function(b){a("#yit-adminmenuwrap li.active").removeClass("active");if(a(b).parents(".yit-menu-top").hasClass("open"))return!1; a("#yit-adminmenuwrap li.yit-menu-top").removeClass("open").removeClass("current");a("#yit-adminmenuwrap .yit-submenu.open").removeClass("open").slideUp().parent().removeClass("current");a(b).parents(".yit-menu-top").addClass("open").addClass("current").find(".yit-submenu").slideDown().addClass("open")};createRightMenus=function(){a("#yit-adminmenuwrap li.yit-has-submenu").each(function(b){a(this).hover(function(){0==a(this).find(".yit-rightmenu").length&&a("<div/>",{"class":"yit-rightmenu"}).html("<ul>"+ a(this).find(".yit-submenu").html()+"</ul>").appendTo(a(this))})})};dependencies_handler=function(a,d,e){if("function"!=typeof c)var c=jQuery;var f=!0;if("string"==typeof d){":radio"==d.substr(0,6)&&(d+=":checked");e=e.split(",");for(var g=0;g<e.length;g++)if(c(d).val()!=e[g])f=!1;else{f=!0;break}}f?c(a+"-container").show():c(a+"-container").hide()};return{init:function(){hideTabs();createRightMenus();a(document).on("click","#yit-adminmenuwrap li.yit-menu-top a",function(b){b.preventDefault();a(this).parent().hasClass("yit-has-submenu")? a(this).parent().hasClass("open")||a(this).parent().find("li:first a").click():openTab(this);b=a(this).attr("href");a(b).find(".upload_img_preview img").each(function(b){b=a(this).attr("src");var c=a(this).attr("data-src");b.indexOf("sleep.png")&&a(this).attr("src",c)})});a("#yit-adminmenuwrap li.yit-menu-top a").filter(":first").click();a("[data-field]").each(function(){var b=a(this),d="#"+b.data("field"),c="#"+b.data("dep"),h=b.data("value");a(c).on("change",function(){dependencies_handler(d,c, h.toString())}).change()})}}}();a(function(){c=new c;c.init()})})(jQuery);
