﻿var BaseUI =
{
	Initialize : function()
	{
		function loadSignup(emailaddr, firstname)
		{
		    var strURL = ""
		    if (emailaddr == "email address") {
		        emailaddr = "";    
		    }
		    strURL = '/newsletter.aspx?email=' + emailaddr;
		    GB_showCenter('Email Offers Sign Up', strURL, 600, 700);
		}
		
		$j('div.hero-links ul.hero-nav li:first').addClass('active')
		$j('div.hero-links ul.hero-menu:first').show()
		$j('#hero-video div.video').show()
		
		// OFFERS CYCLE		
	    $j('#offers .items').cycle({
	        fx:       	'scrollHorz',
	        timeout:   	8000,
			speed: 		1000, 
			next: 		'#offers .next',
			prev: 		'#offers .prev',
			pause: 		"true"
	    })
		
		// PACKAGES CYCLE
	    $j('#packages .packages-items').cycle({
	        fx:       'fade',
	        timeout:   	8000,
			speed: 		2000,
			delay: 		4000, 
			next: 		'#packages .next',
			prev: 		'#packages .prev',
			pause: 		"true"
	    })
		
		// INTERIOR HERO CYCLE
		
		$j('#hero').cycle(
		{
			pause: 		'true'
		})
		
		BaseUI.SwitchHomeHeroMenu()
		BaseUI.ShowPlannerTip()
		BaseUI.HeroCaptionHover()
	},
	SwitchHomeHeroMenu : function()
	{
		$j('ul.hero-nav li a').click(function(e)
		{
			var target = $(this).attr('href')
			$j('div.hero-links ul.hero-menu').hide()
			$j(target).show()
			
			$j('div.hero-links ul.hero-nav li').removeClass('active')
			$j(this).parent('li').addClass('active')
			e.preventDefault()
		})
	},
	ShowPlannerTip : function()
	{
		$j('div.utility li:first-child').hover(function()
		{
			$j(this).children('div').show()
		}, function()
		{
			$j(this).children('div').hide()
		})
	},
	HeroCaptionHover : function()
	{
		$j('#hero div').hover(function()
		{
			$j(this).children('p').slideDown()
		}, function()
		{
			$j(this).children('p').slideUp()
		})
	}
}

$(document).ready(BaseUI.Initialize)
