(function($) {  

var thisObj;

$.HasbroFlyout = {

	defaults: {
		fadeInTime: 200,
		fadeOutTime: 100
	}

}	  

$.fn.extend({

	HasbroFlyout:function( config ){
		
		var config = $.extend({}, $.HasbroFlyout.defaults, config);
		thisObj = this;
		init( config );
		return this;	
	}
});
	
	
function init( config ){

	var li = $( "li:has(ul)", thisObj );
	li.hoverIntent(function(event){
 		//$("> div.hsb_flyout", this).removeClass('hasShadows');
		onMouseOver( $( this ), config ); 	
	 
	}, function(event){
		//$("> div.hsb_flyout", this).removeClass('hasShadows');
		onMouseOut( $( this ), config ); 
	});	

}

function onMouseOver( $obj, config ){
	
	var fadeInTime = config.fadeInTime;
	if ($.browser.msie && (parseFloat($.browser.version) < 8)) {
     	fadeInTime = 0;
		//Aug 30 Update: moves page content back behind flyouts in ie7
		$('div#hsb_brand_page').css('z-index', '-1');
		$('div#hsb_brand_page').css('position', 'relative');
		//End Aug 30 Update
	}
		
	
    $("> div.hsb_flyout", $obj).stop(false, true).removeClass('hasShadows').show( fadeInTime, function(){																											  
		$(this).addClass('hasShadows');
		
	  } );

}

function onMouseOut( $obj, config ){
	
	var fadeOutTime = config.fadeOutTime;
	if ($.browser.msie && (parseFloat($.browser.version) < 8)) {
     	fadeOutTime = 0;
	}
	$("> div.hsb_flyout", $obj).stop(false, true).removeClass('hasShadows').hide( fadeOutTime );
	//$("> div.hsb_flyout", $obj).stop(false, true).hide( config.fadeOutTime );
}
	
	

	
	
	
	
	
	
	
	
	
	
	
	
		  
})(jQuery); 
