// brad's jQuery ease menu

var sizeSmall = 150;
var sizeNormal = 160;
var sizeLarge = 190;
var currentNavIndex = 0;

var OVER_SPEED = 600;
var OUT_SPEED = 200;

var EaseMenu = function() {
	
	$( ".nav_item" ).each( function( index ) {
			
		$( this ).animate( { "width": sizeNormal+"px" }, OVER_SPEED, "easeOutBack" );
		
		$( this ).mouseenter( function() {
		
			currentNavItem = index;
			
			$( ".nav_item" ).each( function( index ) {
				
				$( this ).stop();
				
			});
			
			$( ".nav_item" ).each( function( index ) {
			
				if( currentNavItem == index ) {
				
					$( this ).animate( { "width": sizeLarge+"px" }, OVER_SPEED, "easeOutBack" );
					
				} else {
				
					$( this ).animate( { "width": sizeSmall+"px" }, OVER_SPEED, "easeOutBack" );
				
				}
			
			});
			
		});
		
		$( this ).mouseleave( function() {
			
			$( ".nav_item" ).each( function( index ) {
				
				$( this ).stop();
				
			});
			
			$( ".nav_item" ).each( function( index ) {
				
				$( this ).animate( { "width": sizeNormal+"px" }, OUT_SPEED, "easeOutBack" );
				
			});
		
		});
	
	});

}