// jQuery Menu Plugin v0.8 - Copyright 2007-2008 James Nylen

(function($){$.fn.menu=function(opt){opt=$.extend({showDelay:0,switchDelay:0,hideDelay:0,menuSel:'ul',itemSel:'li',show:function(){this.style.visibility='visible';},hide:function(){this.style.visibility='hidden';}},opt);setTo=function(action,time){var o=this;$(o).attr('pending',action);window.setTimeout(function(){if($(o).attr('pending')==action){if(action=='show'){$(o).parent().addClass('active');opt.show.call(o);}else{$(o).parent().removeClass('active');opt.hide.call(o);}}},time);};$(this).children(opt.itemSel).each(function(i){if(i==0)$(this).addClass('first');if(i==$(this).parent().children(opt.itemSel).length-1)$(this).addClass('last');if($(this).children(opt.menuSel).length)$(this).addClass('parent').hover(function(){var o=this;$(this).parent().children('.active').each(function(){if(this!=o)setTo.call($(this).children(opt.menuSel).get(0),'hide',opt.switchDelay);});setTo.call($(this).children(opt.menuSel).get(0),'show',$(this).parent().children('.active').length?opt.switchDelay:opt.showDelay);},function(){setTo.call($(this).children(opt.menuSel).get(0),'hide',opt.hideDelay);});$(this).children(opt.menuSel).each(function(){$(this).menu(opt);});});return $(this);}})(jQuery);