!function(a){function i(){var i=!1;return a("body").hasClass("logged-in")?(a(".main > .main-left > .nav > .slide > .menu").each(function(){var n=a(this);n.next().find("a").each(function(){var s=a(this),o=s.attr("href");return-1!=o.indexOf(e)?(n.click(),n.next(".slide-menu").stop(!0,!0),t=s.parent(),t.addClass("active"),i=!0,!0):void 0})}),i):(luciLocation=["Main","Login"],!0)}a(".main > .loading").fadeOut();var t=void 0,n=void 0,e="";!function(a){"admin"==a[0]?luciLocation=[a[1],a[2]]:luciLocation=a;for(var i in luciLocation)e+=luciLocation[i],i!=luciLocation.length-1&&(e+="/")}(luciLocation),a(".main > .main-left > .nav > .slide > .menu").click(function(){var i=a(this).next(".slide-menu"),t=a(this);i.is(":visible")?i.stop(!0).slideUp("fast",function(){t.removeClass("active"),i.removeClass("active")}):(t.addClass("active"),i.addClass("active"),i.stop(!0).slideDown("fast"))}),a(".main > .main-left > .nav > .slide > .slide-menu > li > a").click(function(){return void 0!=t&&t.removeClass("active"),a(this).parent().addClass("active"),a(".main > .loading").fadeIn("fast"),!0}),a(".main > .main-left > .nav > .slide > .slide-menu > li").click(function(){void 0!=t&&t.removeClass("active"),a(this).addClass("active"),a(".main > .loading").fadeIn("fast"),window.location=a(a(this).find("a")[0]).attr("href")}),i()&&(n="node-"+luciLocation[0]+"-"+luciLocation[1],n=n.replace(/[ \t\n\r\/]+/g,"_").toLowerCase(),a("body").addClass(n)),a(".cbi-button-up").val(""),a(".cbi-button-down").val(""),a("#maincontent > .container").find("a").each(function(){var i=a(this),t=i.attr("onclick");(void 0==t||""==t)&&i.click(function(){var t=i.attr("href");return-1==t.indexOf("#")?(a(".main > .loading").fadeIn("fast"),!0):void 0})});var s=!1;if(a(".showSide").click(function(){s?(a(".darkMask").stop(!0).fadeOut("fast"),a(".main-left").stop(!0).animate({width:"0"},"fast"),a(".main-right").css("overflow-y","auto"),s=!1):(a(".darkMask").stop(!0).fadeIn("fast"),a(".main-left").stop(!0).animate({width:"15rem"},"fast"),a(".main-right").css("overflow-y","hidden"),s=!0)}),a(".darkMask").click(function(){s&&(s=!1,a(".darkMask").stop(!0).fadeOut("fast"),a(".main-left").stop(!0).animate({width:"0"},"fast"),a(".main-right").css("overflow-y","auto"))}),a(window).resize(function(){a(window).width()>921&&(a(".main-left").css("width",""),a(".darkMask").stop(!0),a(".darkMask").css("display","none"),s=!1)}),a("legend").each(function(){var i=a(this);i.after("<span class='panel-title'>"+i.text()+"</span>")}),a(".main-right").focus(),a(".main-right").blur(),a("input").attr("size","0"),void 0!=n)switch(console.log("mainNodeName",n),n){case"node-status-system_log":case"node-status-kernel_log":a("#syslog").focus(function(){a("#syslog").blur(),a(".main-right").focus(),a(".main-right").blur()});break;case"node-status-firewall":var o=a(".node-status-firewall > .main fieldset li > a");o.addClass("cbi-button cbi-button-reset a-to-btn");break;case"node-system-reboot":var o=a(".node-system-reboot > .main > .main-right p > a");o.addClass("cbi-button cbi-input-reset a-to-btn")}}(jQuery);
