$(document).ready(function() {

	/*$("#link, .overlayButton").hover(function() { //On hover...

		$(this).parent().find("#overlay_white").stop().fadeIn('slow').show();
		
	} , function() { //on hover out...
		
		//Fade the image to full opacity 
		$(this).parent().find("#overlay_white").stop().fadeOut('normal', function() {
			$(this).hide() //Hide the image after fade
		});
		
	});*/
	function buttonHoverOver(){ //On hover...
		$(this).parent().find("#overlay_white").stop().fadeTo('slow', 1).show();		
	}
	
	function buttonHoverOut(){ //on hover out...	
		//Animate the image to 0 opacity (fade it out)
		$(this).parent().find("#overlay_white").stop().fadeTo('normal', 0 , function() {
			$(this).hide() //Hide the image after fade
		});
	}
	
	//Set custom HoverIntent configurations for 'sub'
	var buttonConfig = {
		 sensitivity: 1, // number = sensitivity threshold (must be 1 or higher)
		 interval: 0, // number = milliseconds for onMouseOver polling interval
		 over: buttonHoverOver, // function = onMouseOver callback (REQUIRED)
		 timeout: 0, // number = milliseconds delay before onMouseOut
		 out: buttonHoverOut // function = onMouseOut callback (REQUIRED)
	};
	
	$(".link").hoverIntent(buttonConfig); //Trigger Hover intent with custom configurations
});
