// International Armoured Vehicles default javascript file
$(function(){
	hover();
	dropdown();
});

// hover function for navgiation
function hover(){
	$("ul#nav li").hover(
		function(){
			$(this).not("ul#nav li ul li").addClass("lefthover");
			$(this).not("ul#nav li ul li").addClass("righthover");
		},
		function(){
			$(this).not("ul#nav li ul li").removeClass("lefthover");
			$(this).not("ul#nav li ul li").removeClass("righthover");
		}
	);
}

// dropdown menus
function dropdown(){
	$("ul#nav li").hover(
		function(){
			$(this).find("ul:first").css("display", "block");
		},
		function(){
			$(this).find("ul:first").css("display", "none");
		}
	);
}

// sets equal heights and dynamically sets the h1 elements positioning
// this is to ensure the equal heights plugin works
// is only called on the homepage
function heights(){
	$("#left_col").css("padding-top", "0");
	$("#left_col").css("padding-bottom", "0");
	$("#left_col").find("h1:first").css("margin-top", "33px");
	$(".equal_box").equalHeights(true);
}