/*! 22-02-2017 by krivinarius@gmail.com */
!function(a,b,c){"use strict";function d(a){this.settings=a}d.prototype.render=function(){return this.settings.link?this.aTagWrap(this.imgTagWrap(this.settings.src,this.settings.className,this.settings.alt),this.settings.link,this.settings.linkWrapperClassName):this.imgTagWrap(this.settings.src,this.settings.className,this.settings.alt)},d.prototype.outerHTML=function(){return this.render()[0].outerHTML},d.prototype.imgTagWrap=function(a,b,d){return c("<img>",{src:a,"class":b,alt:d})},d.prototype.aTagWrap=function(a,b,d){var e=c("<a>",{href:b,"class":d});return e.append(a),e},c.fn.respmenu=function(a){var b=c.extend(!0,{id:null,active:"respmenu_current",header:"",logo:{src:null,link:null,linkWrapperClassName:"respmenu-header-logo-link",className:"respmenu-header-logo",alt:"logo"},toggleSwitch:{src:null},className:"respmenu",submenuToggle:{className:"",html:"open"},prependTo:!1,skipClasses:[]},a);return this.each(function(a){var e=c(this).clone(),f="",g="",h="<hr><hr><hr>";if(e.removeAttr("id").attr("class",b.className),b.prependTo?c(b.prependTo).prepend(e):c(this).after(e),e.children().each(function(){function a(d){var e=d.prop("tagName"),f=d.children(),g=!1;if(c.each(b.skipClasses,function(a,b){d.hasClass(b)&&(g=!0)}),g){if("A"===e)return;return d.removeAttr("id").attr("class",b.className+"-submenu"),d.css({display:"none"}),void d.parent().prepend('<div class="'+b.className+"-submenu-toggle "+b.submenuToggle.className+'">'+b.submenuToggle.html+"</div>")}"LI"===e||"UL"===e||"A"===e||"SPAN"===e?("LI"===e?d.hasClass("current-menu-item")?d.removeAttr("id").attr("class",b.active):d.removeAttr("id").removeAttr("class"):"UL"===e?(d.removeAttr("id").attr("class",b.className+"-submenu"),d.css({display:"none"}),d.parent().prepend('<div class="'+b.className+"-submenu-toggle "+b.submenuToggle.className+'">'+b.submenuToggle.html+"</div>")):d.removeAttr("id").removeAttr("class"),f&&f.each(function(){a(c(this))})):d.remove()}a(c(this))}),b.id?e.wrap('<div id="'+b.id+'" class="'+b.className+'-wrap"/>'):e.wrap('<div class="'+b.className+'-wrap"/>'),b.header&&(f='<span class="'+b.className+'-header-title">'+b.header+"</span>"),b.logo.src){var i=new d(b.logo);g=i.outerHTML()}if(b.toggleSwitch.src){var j=new d(b.toggleSwitch);h=j.outerHTML()}e.before('<div class="'+b.className+'-header">'+g+f+'<span class="'+b.className+'-open">'+h+"</span></div>"),e.css({display:"none"}),e.find("."+b.className+"-submenu-toggle").on("click",function(){var a=c(this);a.siblings("."+b.className+"-submenu").slideToggle(200)}),e.siblings("."+b.className+"-header").find("."+b.className+"-open").on("click",function(){e.slideToggle(200)})})}}(window,document,jQuery);