﻿$(document).ready(function ()
{
	var headerHoverConfig =
	{
		sensitivity: 1, // number = sensitivity threshold (must be 1 or higher)
		interval: 200, // number = milliseconds for onMouseOver polling interval
		over: showTeachHeader, // function = onMouseOver callback (REQUIRED)
		timeout: 400, // number = milliseconds delay before onMouseOut
		out: hideTeachHeader // function = onMouseOut callback (REQUIRED)
	};

	var footerHoverConfig =
	{
		sensitivity: 1, // number = sensitivity threshold (must be 1 or higher)
		interval: 200, // number = milliseconds for onMouseOver polling interval
		over: showTeachFooter, // function = onMouseOver callback (REQUIRED)
		timeout: 400, // number = milliseconds delay before onMouseOut
		out: hideTeachFooter // function = onMouseOut callback (REQUIRED)
	};

	//jQuery.easing.def = "easeOutQuad";
	$("#teachHeader").hoverIntent(headerHoverConfig);
	$("#footerDivWrapper").hoverIntent(footerHoverConfig);

	function showTeachHeader()
	{
		$("#teachLogo, #teachNav ul").css("visibility", "visible");
		$("#teachLogoSmall").fadeOut("fast");
		$("#teachHeader").animate({ "top": "+=53px" }, "slow",
		function () //strictly  a 'just in case' - if you're fast enough you can catch the header on it's roll up and have it slide down w/o the nav viewable
		{
			$("#teachLogo, #teachNav ul").css("visibility", "visible");
			$("#teachLogoSmall").fadeOut("fast");
		});
	}

	function hideTeachHeader()
	{
		$("#teachHeader").animate({ "top": "-=53px" }, "slow",
		function ()
		{
			$("#teachLogo, #teachNav ul").css("visibility", "hidden");
			$("#teachLogoSmall").fadeIn("fast");
		});
	}

	function showTeachFooter()
	{
		$("#teachFooterLogoSmall").fadeOut("fast");
		$("#footerDivWrapper").animate({ "bottom": "+=167px" }, "slow",
		function () //strictly  a 'just in case'
		{
			$("#teachFooterLogoSmall").fadeOut("fast");
		});
	}

	function hideTeachFooter()
	{
		$("#footerDivWrapper").animate({ "bottom": "-=167px" }, "slow",
		function ()
		{
			$("#teachFooterLogoSmall").fadeIn("fast");
		});
	}
});
