$(document).ready(function(){
// Top menu hover effect
	$('#home_menu li a').hover(function() {
		$(this).parent().addClass('home_menu_list_hover'); // Add class to link container one level up
	}, function() { 
		$(this).parent().removeClass('home_menu_list_hover');// Remove class from link container one level up
	});
	
// Left column menu
	//Activate hover Intent to prevent looping accordian
	$('.menu_items').hoverIntent({
		sensitivity: 3, 
		interval: 80, 
		over: makeTall,
		timeout: 150, 
		out: makeShort
	});

	// Set the open palm background
	$('#menu_rollover_hand').addClass('menu_option_default');
		
	// Switch the title backgrounds and set the open palm background
	$('.menu_items').hover(function() {
		$('#menu_rollover_hand').toggleClass('menu_option_default');
		$(this).children('div:nth-child(1)').toggleClass('bgpositions');
	}, function() {
		$('#menu_rollover_hand').toggleClass('menu_option_default');
		$(this).children('div:nth-child(1)').toggleClass('bgpositions');
	});
	
	//Each item changes the open palm background
	// Digital Marketing -> Shift Click
	$('#menu_digital_marketing').hover(function() {
		$('#menu_rollover_hand').toggleClass('menu_option_shift_click');
	} , function() {
		$('#menu_rollover_hand').toggleClass('menu_option_shift_click');
	});

	// Campaign Management Delivery -> Dialogue Solutions
	$('#menu_campaign_management_delivery').hover(function() {
		$('#menu_rollover_hand').toggleClass('menu_option_dialogue_solutions');
	} , function() {
		$('#menu_rollover_hand').toggleClass('menu_option_dialogue_solutions');
	});

	// Database Marketing -> Data Lateral
	$('#menu_database_marketing').hover(function() {
		$('#menu_rollover_hand').toggleClass('menu_option_data_lateral');
	} , function() {
		$('#menu_rollover_hand').toggleClass('menu_option_data_lateral');
	});

	// Print Direct + Transactional Mailing -> Howitt
	$('#menu_printed_communications').hover(function() {
		$('#menu_rollover_hand').toggleClass('menu_option_howitt');
	} , function() {
		$('#menu_rollover_hand').toggleClass('menu_option_howitt');
	});
});

// This is for hoverIntent, it sets the open and close properties
	function makeTall(){  $(this).animate({'height':82},200)};
	function makeShort(){ $(this).animate({'height':31},200)};
	
// Random Home header rotator
var banner= new Array()

banner[0]='./wsimages/banner_bg_home_one.jpg'
banner[1]='./wsimages/banner_bg_home_two.jpg'
banner[2]='./wsimages/banner_bg_home_three.jpg'
banner[3]='./wsimages/banner_bg_home_four.jpg'

var random=Math.round(3*Math.random());

document.write('<style>');
document.write('#home_banner {');
document.write(' background:url(' + banner[random] + ') no-repeat;');
document.write(' }');
document.write('</style>');
