!function(a){"use strict";a.fn.suinav=function(b){var c=this,d=!1,e=0,f={togglename:".menutoggle",direction:"left",trigger:"click",openingspeed:400,closingspeed:400,closingcascade:!0,destroy:!0};if(!a(c).hasclass("sui-nav")){if(a(this).find(".sui-nav").length<1)return;c=a(this).find(".sui-nav")[0]}f=a.extend({},f,b);var g=function(){a(c).hasclass("horizontal")?a(c).find("li").hover(function(){a(this).children("ul").stop().show(f.openingspeed)},function(){a(this).children("ul").stop().hide(f.closingspeed)}):"click"==f.trigger?a(c).find("li").click(function(){return 0!=e?void(a(this).parent().parent().parent().hasclass("sui-nav")&&(e=0,console.log("parent"))):("none"==a(this).children("ul").css("display")?a(this).children("ul").slidedown(f.openingspeed):f.closingcascade?a(this).find("ul").slideup(f.closingspeed):a(this).children("ul").slideup(f.closingspeed),e++,void(a(this).parent().parent().parent().hasclass("sui-nav")&&(e=0,console.log("parent"))))}):"hover"==f.trigger&&a(c).find("li").hover(function(){a(this).children("ul").slidedown(f.openingspeed)},function(){f.closingcascade?a(this).find("ul").slideup(f.closingspeed):a(this).children("ul").slideup(f.closingspeed)}),a(window).resize(k)},h=function(){d||(a(document.body).append('
'),a(document.body).append(''),a(".slide-nav").html(a(c).html()),a(".slide-nav").find("li").click(function(){return 0!=e?void(a(this).parent().parent().parent().hasclass("sui-nav")&&(e=0,console.log("parent"))):("none"==a(this).children("ul").css("display")?a(this).children("ul").slidedown(f.openingspeed):f.closingcascade?a(this).find("ul").slideup(f.closingspeed):a(this).children("ul").slideup(f.closingspeed),e++,void(a(this).parent().parent().parent().hasclass("sui-nav")&&(e=0,console.log("parent"))))}),a(".nav-mask").click(function(){i()}),settimeout(function(){a(".slide-nav").toggleclass("active"),a(".nav-mask").toggleclass("active")},20))},i=function(){d||(d=!0,a(".slide-nav").find("li").unbind(),a(".slide-nav").removeclass("active"),a(".nav-mask").removeclass("active"),settimeout(function(){a(".slide-nav").remove(),a(".nav-mask").remove(),d=!1},600))},j=function(){a(".slide-nav").length>0?i():h()},k=function(){},l=function(b,d,e){var f,g=d.menuid||"idsuinav",h=d.menutype||"default";return f="horizontal"==h?'
':'
',f=f+a(c).html()+"
",a("#"+b).html(f),a("#"+b).suinav(e)},m=function(){a("."+f.togglename).unbind()};return k(),g(),{show:h,hide:i,toggle:j,create:l,destroy:m}}}($);