/*
 
 Singulink JS Library: Menu, v2.5 (June 1. 2011)
 Copyright (C) Singulink (TM) (http://www.singulink.com)
 Tested with jQuery 1.4.2

 If you would like to use our plugins, please contact us:
 http://www.singulink.com/Contact?subject=jQuery%20Plug-ins

*/
var d=null;
(function(e){function h(g){a&&(setTimeout(a.a,g),a.parent().find(".sjs-layout-dependent").each(function(){try{e(this).data("UpdateLayout")(a)}catch(f){}}))}var g=!1,a=d;e(document).bind("mousedown",d,function(){g?g=!1:h(5)});e.fn.extend({menu:function(k){var f=e.extend({},{menuSelector:"ul:first",triggerSelector:"a:first",hoverClass:"sjs-hover",activeClass:"sjs-active"},k);return this.each(function(){function i(a){c.find(".sjs-layout-dependent").each(function(){try{e(this).data("UpdateLayout")(a)}catch(b){}})}var c=
e(this),b=e(f.menuSelector,c),j=e(f.triggerSelector,c);b.hide();b.a=function(){a==b&&(c.removeClass(f.activeClass),b.hide(),i(a),a=d)};b.b=function(){a!=b&&(a&&a.a(),a=b,a.show(),c.addClass(f.activeClass),i(a))};b.bind("mousedown",d,function(){return g=!0});b.find("a").bind("click",d,function(){h(100);return!0});j.bind("click",d,function(){return!1});j.bind("mousedown",d,function(){a?a==b&&(b.a(),c.addClass(f.hoverClass)):(b.b(),g=!0);return!0});c.bind("mouseenter",d,function(){a?b.b():c.addClass(f.hoverClass);
return!0});c.bind("mouseleave",d,function(){c.removeClass(f.hoverClass);return!0})})}})})(jQuery);

