var promoPanel;
var maxPromoPanel;

var carPanel;
var maxCarPanel;

function rotateCarPanel()
{
	//Hide current panels
	$('#car-panel-' + carPanel).animate({ opacity: 0.0 }, 500);
	
	//Increment panel ref
	carPanel++;
	if(carPanel > maxCarPanel)
	{
		carPanel = 1;
	}
		
	//Show new panels
	$('#car-panel-' + carPanel).animate({ opacity: 1.0 }, 500);
}

function rotatePromoPanel()
{
	//Hide current panels
	$('#promo-panel-' + promoPanel).animate({ opacity: 0.0 }, 500);
	
	//Increment panel ref
	promoPanel++;
	if(promoPanel > maxPromoPanel)
	{
		promoPanel = 1;
	}
		
	//Show new panels
	$('#promo-panel-' + promoPanel).animate({ opacity: 1.0 }, 500);
}

$(document).ready(function()
{	
	$('#locations-menu').hide();
	$('#terms-menu').hide();

	function showLocationsMenu()
	{
		$(this).children("ul").slideDown();
	}

	function hideLocationsMenu()
	{ 
		$(this).children("ul").slideUp();
	}

	$("#locations-menu-parent").hoverIntent(
	{
		sensitivity: 1,				// number = sensitivity threshold (must be 1 or higher)
		interval: 50,				// number = milliseconds for onMouseOver polling interval
		over: showLocationsMenu,	// function = onMouseOver callback (required)
		timeout: 300,				// number = milliseconds delay before onMouseOut
		out: hideLocationsMenu		// function = onMouseOut callback (required)
	});
	
	function showTermsMenu()
	{
		$(this).children("ul").slideDown();
	}

	function hideTermsMenu()
	{ 
		$(this).children("ul").slideUp();
	}

	$("#terms-menu-parent").hoverIntent(
	{
		sensitivity: 1,				// number = sensitivity threshold (must be 1 or higher)
		interval: 50,				// number = milliseconds for onMouseOver polling interval
		over: showLocationsMenu,	// function = onMouseOver callback (required)
		timeout: 300,				// number = milliseconds delay before onMouseOut
		out: hideLocationsMenu		// function = onMouseOut callback (required)
	});
});
