//Effects for the specials board
$(document).ready(function() {
	$('.menu>li>ul').hide();
	
	$('#special-board .link').hover(
		function() {
			$(this).animate({ 'left' : '56px' }, { queue: false, duration: 200 });
		},
		function() {
			$(this).animate({ 'left' : '46px' }, { queue: false, duration: 200 });
		}
	);
	
	
	/*
	 * Menu
	 */
	
	$('.menu>li>ul>li').mouseenter(function() {
		$(this).parent().parent().find('a>img').css({'margin-top':'-39px'});
		$(this).parent().css({'top':'138px'});
		clearTimeout(menuDelayTimer);
	});
	
	$('.menu>li>ul>li').mouseout(function() {
		$(this).parent().parent().find('a>img').css({'margin-top':'0px'});
		delayHide($(this).parent());
	});
	
	
	$('.menu>li').mouseenter(function() {
		$(this).find('a>img').css({'margin-top':'-39px'});
		$(this).parent().css({'margin-top':'0px'});
		$(this).parent().find('ul').hide();
		clearTimeout(menuDelayTimer);
		$(this).find('ul').show();
	});
	
	
	$('.menu>li').mouseout(function() {
		$(this).find('a>img').css({'margin-top':'0px'});
		delayHide($(this).find('ul'));
	}); 

	var menuDelayTimer;
	function delayHide(e) {
		clearTimeout(menuDelayTimer);
		menuDelayTimer = setTimeout(function() { $(e).hide(); }, 100);
	}
	
	/*
	 * Homepage Hover thing
	 */
	
	$('#icon1').hover(function() {
		clearTimeout(homeBannerTimer);
		$(this).attr('src', 'images/breakfast-like-a-rockstar-small-on.png');
		$('#home-main-banner').attr('src', 'images/breakfast-like-a-rock-star-large.jpg');
	},
	function() {
		$(this).attr('src', 'images/breakfast-like-a-rockstar-small-off.png');
		delayHomeBanner()
	});
	
	$('#icon2').hover(function() {
		clearTimeout(homeBannerTimer);
		$(this).attr('src', 'images/breakfast-in-bed-small-on.png');
		$('#home-main-banner').attr('src', 'images/breakfast-in-bed-large.jpg');
	},
	function() {
		$(this).attr('src', 'images/breakfast-in-bed-small-off.png');
		delayHomeBanner()
	});
	
	$('#icon3').hover(function() {
		clearTimeout(homeBannerTimer);
		$(this).attr('src', 'images/breakfast-on-the-run-small-on.png');
		$('#home-main-banner').attr('src', 'images/breakfast-on-the-run-large.jpg');
	},
	function() {
		$(this).attr('src', 'images/breakfast-on-the-run-small-off.png');
		delayHomeBanner()
	});
	
	$('#icon4').hover(function() {
		clearTimeout(homeBannerTimer);
		$(this).attr('src', 'images/breakfast-with-benefits-small-on.png');
		$('#home-main-banner').attr('src', 'images/breakfast-with-benefits-large.jpg');
	},
	function() {
		$(this).attr('src', 'images/breakfast-with-benefits-small-off.png');
		delayHomeBanner()
	});
	
	$('#icon5').hover(function() {
		clearTimeout(homeBannerTimer);
		$(this).attr('src', 'images/breakfast-in-style-small-on.png');
		$('#home-main-banner').attr('src', 'images/breakfast-in-style-large.jpg');
	},
	function() {
		$(this).attr('src', 'images/breakfast-in-style-small-off.png');
		delayHomeBanner()
	});
	
	$('#icon6').hover(function() {
		clearTimeout(homeBannerTimer);
		$(this).attr('src', 'images/breakfast-your-way-small-on.png');
		$('#home-main-banner').attr('src', 'images/breakfast-your-way-large.jpg');
	},
	function() {
		$(this).attr('src', 'images/breakfast-your-way-small-off.png');
		delayHomeBanner();
	});
	var homeBannerTimer;
	function delayHomeBanner() {
		homeBannerTimer = setTimeout(function() { $('#home-main-banner').attr('src', 'images/img-banner-main.jpg'); },100);
	}
	
});

