;(function(b,c){b('*').hover(function(){b(this).data(c,1)},function(){b(this).data(c,0)}).data(c,0);b[c]=function(a){return b(a)[c]()};b.fn[c]=function(a){a=0;b(this).each(function(){a+=b(this).data(c)});return a>0}})(jQuery,'isHovered');(function($){$.jMenu={defaults:{ulWidth:'auto',absoluteTop:30,absoluteLeft:0,effects:{effectSpeedOpen:350,effectSpeedClose:350,effectTypeOpen:'slide',effectTypeClose:'slide',effectOpen:'linear',effectClose:'linear'},TimeBeforeOpening:200,TimeBeforeClosing:200,animatedText:false,paddingLeft:7},init:function(options){opts=$.extend({},$.jMenu.defaults,options);$("#jMenu a:not(.fNiv)").each(function(){var $thisChild=$(this);if($.jMenu._IsParent($thisChild))
$thisChild.addClass('isParent');if(opts.animatedText)
$.jMenu._animateText($thisChild);$thisChild.hover(function(){$.jMenu._hide($thisChild);$.jMenu._showNextChild($thisChild);},function(){});});$('#jMenu li a.fNiv').hover(function(){var $this=$(this);ULWidth=$.jMenu._returnUlWidth($this);$.jMenu._closeList($("#jMenu ul"))
$.jMenu._showFirstChild($this);},function(){return;});$('#jMenu').hover(function(){},function(){setTimeout(function(){$.jMenu._closeAll();},opts.TimeBeforeClosing);});},_showFirstChild:function(el){if($.jMenu._IsParent(el))
{var SecondList=el.next();if(SecondList.is(":hidden"))
{$.jMenu._closeList($("#jMenu ul"));var position=el.position();SecondList.css({top:position.top+opts.absoluteTop,left:position.left+opts.absoluteLeft,width:ULWidth}).children().css({width:ULWidth});$.jMenu._show(SecondList);}}
else
return false;},_showNextChild:function(el){if($.jMenu._IsParent(el))
{var ChildList=el.next();if(ChildList.is(":hidden"))
{var position=el.position();ChildList.css({top:position.top,left:position.left+ULWidth,width:ULWidth}).children().css({width:ULWidth});$.jMenu._show(ChildList);}}
else
return false;},_hide:function(el){if($.jMenu._IsParent(el)&&!el.next().is(':hidden'))
$.jMenu._closeList(el.next());else if(($.jMenu._IsParent(el)&&el.next().is(':hidden'))||!$.jMenu._IsParent(el))
$.jMenu._closeList(el.parent().parent().find('ul'));else
return false;},_show:function(el){switch(opts.effects.effectTypeOpen)
{case'slide':el.delay(opts.TimeBeforeOpening).slideDown(opts.effects.effectSpeedOpen,opts.effects.effectOpen);break;case'fade':el.delay(opts.TimeBeforeOpening).fadeIn(opts.effects.effectSpeedOpen,opts.effects.effectOpen);break;default:el.delay(opts.TimeBeforeOpening).show(opts.effects.effectSpeedOpen,opts.effects.effectOpen);}},_closeList:function(el){switch(opts.effects.effectTypeClose)
{case'slide':el.slideUp(opts.effects.effectSpeedClose,opts.effects.effectClose);break;case'fade':el.fadeOut(opts.effects.effectSpeedClose,opts.effects.effectClose);break;default:el.hide(opts.effects.effectSpeedClose,opts.effects.effectClose);}},_closeAll:function(){if(!$('#jMenu').isHovered()){$('#jMenu ul').each(function(){$.jMenu._closeList($(this));});}},_IsParent:function(el){if(el.next().is('ul'))return true;else return false;},_returnUlWidth:function(el){switch(opts.ulWidth){case"auto":ULWidth=parseInt(el.parent().outerWidth());break;default:ULWidth=parseInt(opts.ulWidth);}
return ULWidth;},_animateText:function(el){var paddingInit=parseInt(el.css('padding-left'));el.hover(function(){$(this).stop().animate({paddingLeft:paddingInit+opts.paddingLeft},100);},function(){$(this).stop().animate({paddingLeft:paddingInit},100);});},_isReadable:function(){if($("a.fNiv").length>0)return true;else return false;},_error:function(){alert('Please, check you have the \'.fNiv\' class on your first level links.');}};jQuery.fn.jMenu=function(options){if($.jMenu._isReadable())
$.jMenu.init(options);else
$.jMenu._error();};})(jQuery);
