$(document).ready(function(){ 
	$('.arrowRight').click(function(){
		$(this).parent().parent().hide();

		if($(this).parent().parent().next(".largeImage").length > 0){
			//$(this).parent().parent().next(".largeImage").css("display", "block");
			$(this).parent().parent().next(".largeImage").fadeIn("fast");
		}
		else{
			//reset to the first guy
			//$('.largeImage:first').css("display", "block");
			$('.largeImage:first').fadeIn("fast");
		}

	});
	$('.arrowLeft').click(function(){
		$(this).parent().parent().hide();

		if($(this).parent().parent().prev(".largeImage").length > 0){
			//$(this).parent().parent().prev(".largeImage").css("display", "block");
			$(this).parent().parent().prev(".largeImage").fadeIn("fast");
		}
		else{
			//reset to the first guy
			//$('.largeImage:last').css("display", "block");
			$('.largeImage:last').fadeIn("fast");
		}
	});

	//NAV DROP-DOWN
	$('.nav .left a').hover(function(){
		//show the drop down
		/*var bg = $(this).children("div").css('background-image');
		bg = bg.replace("_normal.jpg", "_hover.jpg");
		$(this).css('background-image', bg);*/
		var className = $(this).children('div').attr("class");
		$(this).children('div').removeClass(className);
		$(this).children('div').addClass(className + "Hover");
		$(this).parent().children('.floatingMenu').fadeIn('fast');
	}, function(){
		var className = $(this).children('div').attr("class");
		$(this).children('div').removeClass(className);
		className = className.replace("Hover", "");
		$(this).children('div').addClass(className);
		//show the drop down
		$(this).parent().children('.floatingMenu').hide();
	});

	//for nav elements that dont have rollovers
	$('.nav .leftHoveredState a').hover(function(){
		//show the drop down
		$(this).parent().children('.floatingMenu').fadeIn('fast');
	}, function(){
		//show the drop down
		$(this).parent().children('.floatingMenu').hide();
	});



	$('.nav .left .floatingMenu').hover(function(){
		$(this).show();
		//var bg = $(this).parent().children('a').children('div').css('background-image');
		//bg = bg.replace("_normal.jpg", "_hover.jpg");
		var className = $(this).parent().children('a').children('div').attr("class");
		$(this).parent().children('a').children('div').removeClass(className);
		$(this).parent().children('a').children('div').addClass(className + "Hover");
		
		
		//$(this).parent().children('a').children('div').css('background-image', bg);
	},
	function(){
		$(this).hide();
		//var bg = $(this).parent().children('a').children('div').css('background-image');
		//bg = bg.replace("_hover.jpg", "_normal.jpg");

		//$(this).parent().children('a').children('div').css('background-image', bg);
		var className = $(this).parent().children('a').children('div').attr("class");
		//alert(className);
		$(this).parent().children('a').children('div').removeClass(className);
		className = className.replace("Hover", "");
		$(this).parent().children('a').children('div').addClass(className);
	});

	//NAV HIGHLIGHT HOVER
	$('.nav .left .floatingMenu a').hover(function(){
		$(this).css("background-color", "#D9F3FF");
	},
	function(){
		$(this).css("background-color", "white");
	});

});
