var homeCss = 1;
homeCss=Math.floor((Math.random()*3) + 1)

$(function() {
	$('.home-navNode div').hover(
		function() {
		$(this).css("background-color", "#BFE77F");
		$(this).css("background-image", "url('images/spacer.gif')");
		},
		function() {
		$(this).css("background-image", "url('images/bg-homePageNav.gif')");
		$(this).css("background-color", "#A2CB61");
		}
	)
	
	$('#home-brandsNavColumn div').hover(
		function() {
		$('#home-brandsNavColumn').css("z-index","95");
		$('#home-brandsNavColumn').animate({width:"196px"},200);
		$(this).animate({width:"186px",top:"205px",paddingTop:"50px",paddingBottom:"55px"},200);
		$('#home-servicesNavColumn').animate({left:"516px"},200);
		$('#home-locationsNavColumn').animate({right:"136px"},200);			
		$('#home-eventsNavColumn').animate({width:"148px"},200);
		$('#home-eventsNavColumn div').animate({width:"138px"},200);
		$('#home-brandsNavColumn div ul').css("display","block");
		},
		function() {
		$(this).animate({width:"150px",top:"230px",paddingTop:"11px",paddingBottom:"53px"},200);
		$('#home-brandsNavColumn').animate({width:"160px"},200);
		$('#home-brandsNavColumn div ul').css("display","none");		
		$('#home-servicesNavColumn').animate({left:"480px"},200);
		$('#home-locationsNavColumn').animate({right:"160px"},200);
		$('#home-eventsNavColumn').animate({width:"160px"},200);
		$('#home-eventsNavColumn div').animate({width:"150px"},200);
		$('#home-brandsNavColumn').css("z-index","91");
		}
	)
	
    var origNavColumnHeight = $("#home-servicesNavColumn div").height();
	$('#home-servicesNavColumn div').hover(
		function() {
		$('#home-servicesNavColumn').css("z-index","95");
		$(this).css("width","186px");
		$(this).animate({top:"205px",paddingTop:"50px",paddingBottom:"55px",height:"29px"},200);		
		$('#home-servicesNavColumn').animate({left:"468px",width:"196px"},200);	
		$('#home-locationsNavColumn').animate({right:"136px"},200);			
		$('#home-eventsNavColumn').animate({width:"148px"},200);
		$('#home-eventsNavColumn div').animate({width:"138px"},200);
		$('#home-servicesNavColumn div ul').css("display","block");
		},
		function() {		
		$(this).animate({width:"150px",top:"230px",paddingTop:"11px",paddingBottom:"53px",height:origNavColumnHeight+"px"},200, function() {
            $(this).css("height", "");
        });
		$('#home-servicesNavColumn').animate({left:"480px",width:"160px"},200);
		$('#home-servicesNavColumn div ul').css("display","none");		
		$('#home-locationsNavColumn').animate({right:"160px"},200);
		$('#home-eventsNavColumn').animate({width:"160px"},200);
		$('#home-eventsNavColumn div').animate({width:"150px"},200);
		$('#home-servicesNavColumn').css("z-index","92");
		}
	)
	
	$("div.home-navNode div ul li a").hover(
		function() {
			$(this).parent(".home-subNav").css("background-image", "url('images/bullet-homeNav-overSubNav.gif')");
		}, function() {
			$(this).parent(".home-subNav").css("background-image", "url('images/spacer.gif')");
		}
	);
		
});

$(document).ready(function() {
	$('#home-featuredEvents').cycle({ 
		speed: 1500,
    	pause: 1, 
   		timeout: 5000
	});
});
