
var Menu={
	init:function(){
		
            if($.browser.msie && $.browser.version<8){
              $.cssHooks["opacity"] = {
                    get: function( elem, computed, extra ) {
                      // handle getting the CSS property
                     // console.log(computed)
                        if(!$.browser.msie || $.browser.msie.version > 8 ){
                          return computed;
                        }
                    },
                    set: function( elem, value ) {
                      // handle setting the CSS value
                       if(!$.browser.msie || $.browser.msie.version > 8 ){
                         elem.style[ 'opacity' ] = value;
                       }
                       
                    }
                  };
			}
                  
                  
		$('header').css({height:0}).animate({height:81},1200,"easeOutExpo")
		$('#logo').css({marginTop:-100}).delay(500).animate({marginTop:0},500,"easeOutQuint", configLogo)
		$('#menu ul li').each(function(index,element){
				$(element).css({marginTop:-110}).delay(700+(index*50)).animate({marginTop:0},500,"easeOutBack")
		})
		$('header').append('<span class="background-menu" style="z-index:1;opacity:.1;position:absolute;left:0;top:0;height:81px;width:0;background-color:#000;"><span>');
		$('nav li a').hover(function(e){
			$(this).stop().animate({color:'#cd4133'},1000,"easeOutQuad")
			$('header .background-menu').stop().show().animate({top:0,left:$(this).offset().left-4,height:81,width:$(this).width()+10},1000,"easeInOutExpo")
		},function(e){
			$(this).stop().animate({color:'#ffffff'},500,"easeInExpo")
		});
	
		$('nav').mouseleave(function(e){
			$('header .background-menu').stop().animate({left:-100},1000,"easeInOutExpo",function(){
				$('header .background-menu').stop().hide();
			});	
		});
		
		
		function configLogo(){
			$('#logo').hover(function(e){
				$('#logo').stop().animate({opacity:.5})

			},function(e){
				$('#logo').stop().animate({opacity:1})
			})	
		}
		
		
			
		//$('#menu ul').css({marginTop:-100}).delay(900).animate({marginTop:37})
	}
}






