$(document).ready(function(){

$.fn.fadeToggle = function(speed, easing, callback) {
   return this.animate({opacity: 'toggle'}, speed, easing, callback);

};

$.fn.heightToggle = function(speed,easing,callback){
	return this.animate({height: 'toggle'}, speed, easing, callback);
	};
	
$.fn.heightFadeToggle = function(speed,easing,callback){
	return this.animate({height: 'toggle', opacity: 'toggle'}, speed, easing, callback);
	};


$('#logo').hoverIntent(
				function(){
						$(this).stop().animate({top: '0'}, 'fast', 'easeInExpo');
								},
				function(){
					$(this).stop().animate({top: '-40px'}, 'slow', 'easeOutElastic');
					}
				);

$('.menu ul li').hoverIntent(
								 
			function() {
					$(this).addClass('hovered');
					$('ul', this).heightFadeToggle(200);
					$(this).children('a').attr('title', '');
			},
			function() {
					$(this).removeClass('hovered');
					$('ul', this).heightFadeToggle(500);
			});

var setWmode = function(wmode, object) {
    $(object || "object").each(function(i, node) {
        // Set wmode on the object
        node.setAttribute("wmode", wmode);

        // See if wmode already exists to avoid duplication param conflicts
        var currentWmode = $("param[name='wmode']", node);

        // If it already exists, make sure its the new wmode
        if ( currentWmode.length ) {
                currentWmode.attr("value", wmode);
        }
        // Otherwise, add it
        else {
                $(node).append('<param name="wmode" value="' + wmode + '">');
        }
    });
};

setWmode("opaque");


});