// JavaScript Document
$(document).ready(function(){
	
	//Fix Errors - http://www.learningjquery.com/2009/01/quick-tip-prevent-animation-queue-buildup/
	
	$("#mainNav .NavEG").hoverIntent(makeEGTall,makeShort);
			$("#mainNav .NavEG").hoverIntent(makeEGTall,makeShort);
			$("#mainNav .NavEG").hoverIntent({
				sensitivity: 3, 
				interval: 10, 
				over: makeEGTall, 
				timeout: 700, 
				out: makeShort
			});
			
	$("#mainNav .NavMG").hoverIntent(makeMGTall,makeShort);
			$("#mainNav .NavMG").hoverIntent(makeMGTall,makeShort);
			$("#mainNav .NavMG").hoverIntent({
				sensitivity: 3, 
				interval: 10, 
				over: makeMGTall, 
				timeout: 700, 
				out: makeShort
			});
			
	$("#mainNav .NavWG").hoverIntent(makeWGTall,makeShort);
			$("#mainNav .NavWG").hoverIntent(makeWGTall,makeShort);
			$("#mainNav .NavWG").hoverIntent({
				sensitivity: 3, 
				interval: 10, 
				over: makeWGTall, 
				timeout: 700, 
				out: makeShort
			});
			
	$("#mainNav .NavGall").hoverIntent(makeGallTall,makeShort);
			$("#mainNav .NavGall").hoverIntent(makeGallTall,makeShort);
			$("#mainNav .NavGall").hoverIntent({
				sensitivity: 3, 
				interval: 10, 
				over: makeGallTall, 
				timeout: 700, 
				out: makeShort
			});
			
	$("#mainNav #motorsMenu").hoverIntent(makeVisible,makeInvisible);
			$("#mainNav #motorsMenu").hoverIntent(makeVisible,makeInvisible);
			$("#mainNav #motorsMenu").hoverIntent({
				sensitivity: 3, 
				interval: 10, 
				over: makeVisible, 
				timeout: 300, 
				out: makeInvisible
			});
											   
											   
});

function makeEGTall(){  $(this).stop().animate({"height":300},{queue:false, duration:800, easing: 'easeOutBounce'});}
function makeMGTall(){  $(this).stop().animate({"height":188},{queue:false, duration:600, easing: 'easeOutBounce'});}
function makeWGTall(){  $(this).stop().animate({"height":188},{queue:false, duration:600, easing: 'easeOutBounce'});}
function makeGallTall(){  $(this).stop().animate({"height":208},{queue:false, duration:600, easing: 'easeOutBounce'});}

function makeShort(){ $(this).stop().animate({"height":44},{queue:false, duration:600, easing: 'easeOutBounce'});}

function makeVisible(){ $('#mainNav #motorsMenu ul').show('fast'); }
function makeInvisible(){ $('#mainNav #motorsMenu ul').hide('fast'); }


Cufon.replace('h1');
Cufon.replace('h2');
Cufon.replace('h3');
Cufon.replace('h4');
Cufon.replace('label');
document.write('<style>H2 { font-size:28px; }</style>');
