jQuery.fn.ownmenu=function(a){function f(){window.innerWidth<=767?(i(),h(),1==e&&(k(),e=!1)):(j(),g(),"right"==b.align?(k(),e=!0):m())}function g(){navigator.userAgent.match(/Mobi/i)||window.navigator.msMaxTouchPoints>0||"click"==b.submenuTrigger?($(c).find("a").on("click touchstart",function(a){return a.stopPropagation(),a.preventDefault(),$(this).parent("li").siblings("li").find(".dropdown, .megamenu").stop(!0,!0).fadeOut(b.speed),"none"==$(this).siblings(".dropdown, .megamenu").css("display")?($(this).siblings(".dropdown, .megamenu").stop(!0,!0).delay(b.delay).fadeIn(b.speed),!1):($(this).siblings(".dropdown, .megamenu").stop(!0,!0).fadeOut(b.speed),$(this).siblings(".dropdown").find(".dropdown").stop(!0,!0).fadeOut(b.speed),void(window.location.href=$(this).attr("href")))}),$(c).find("li").bind("mouseleave",function(){$(this).children(".dropdown, .megamenu").stop(!0,!0).fadeOut(b.speed)}),1==b.hideClickOut&&$(document).bind("click.menu touchstart.menu",function(a){0==$(a.target).closest(c).length&&$(c).find(".dropdown, .megamenu").fadeOut(b.speed)})):$(c).find("li").bind("mouseenter",function(){$(this).children(".dropdown, .megamenu").stop(!0,!0).delay(b.delay).fadeIn(b.speed)}).bind("mouseleave",function(){$(this).children(".dropdown, .megamenu").stop(!0,!0).delay(b.hideDelay).fadeOut(b.speed)})}function h(){$(c).find("li:not(.showhide)").each(function(){$(this).children(".dropdown, .megamenu").length>0&&$(this).children("a").bind("click",function(a){return"none"==$(this).siblings(".dropdown, .megamenu").css("display")?($(this).siblings(".dropdown, .megamenu").delay(b.delay).slideDown(b.speed).focus(),$(this).parent("li").siblings("li").find(".dropdown, .megamenu").slideUp(b.speed),!1):($(this).siblings(".dropdown, .megamenu").slideUp(b.speed).focus(),void(firstItemClick=1))})})}function i(){$(c).children("li:not(.showhide)").hide(0),$(c).children("li.showhide").show(0),$(c).children("li.showhide").bind("click",function(){$(c).children("li").is(":hidden")?$(c).children("li").slideDown(b.speed):($(c).children("li:not(.showhide)").slideUp(b.speed),$(c).children("li.showhide").show(0),$(c).find(".dropdown, .megamenu").hide(b.speed))})}function j(){$(c).children("li").show(0),$(c).children("li.showhide").hide(0)}function k(){$(c).children("li").addClass("jsright");var a=$(c).children("li");$(c).children("li:not(.showhide)").detach();for(var b=a.length;b>=1;b--)$(c).append(a[b]);l()}function l(){$(c).children("li").removeClass("last");for(var a=$(c).children("li"),b=1;b<=a.length;b++)if($(a[b]).children(".dropdown, .megamenu").length>0){for(var d=0,e=1;e<=b;e++)d+=$(a[e]).outerWidth();$(a[b]).children(".dropdown, .megamenu").outerWidth()>d&&$(a[b]).addClass("last")}}function m(){$(c).children("li").removeClass("fix-sub");for(var a=$(c).children("li"),b=$(c).outerWidth(),e=1;e<=a.length;e++)$(a[e]).children(".dropdown, .megamenu").length>0&&$(a[e]).position().left+$(a[e]).children(".dropdown, .megamenu").outerWidth()>b&&$(a[e]).addClass("fix-sub")}function n(){$(c).find("li, a").unbind(),$(document).unbind("click.menu touchstart.menu"),$(c).find(".dropdown, .megamenu").hide(0)}var b={indicator:!0,speed:100,delay:0,hideDelay:100,hideClickOut:!0,align:"left",submenuTrigger:"hover"};$.extend(b,a);var c=$(".ownmenu"),d=window.innerWidth,e=!1;$(c).prepend("
  • "),1==b.indicator&&$(c).find("a").each(function(){$(this).siblings(".dropdown, .megamenu").length>0&&$(this).append("")}),f(),$(window).resize(function(){d<=767&&window.innerWidth>767&&(n(),j(),g(),"right"==b.align&&0==e&&(k(),e=!0)),d>767&&window.innerWidth<=767&&(n(),i(),h(),1==e&&(k(),e=!1)),"right"==b.align?d>767&&window.innerWidth>767&&l():d>767&&window.innerWidth>767&&m(),d=window.innerWidth})},$().ownmenu();