$(function() {
	// Make all columns the same height
	//var height = $('#col-left').outerHeight();
	//if($('#col-right').outerHeight() > height) height = $('#col-right').outerHeight();
	//$('#col-left').css({height : height});
	//$('#col-right').css({height : height});
	// Make the container shadow be the height of the document - currently messed up because of all the floating divs
	//var containerHeight = height + 231;
	//$('#container').css({height : containerHeight});
	
	height = $(window).height();
	if(height < 800 ){
		$("#content_bg").css({"display": "none"});
		$("#image").css({"height":"656px", "overflow":"hidden"});
	}else{
		$("#content_bg").css({"width":"217px"});
		$("#content_bg").animate({"width":"735px"}, 1000);
	}
	$("#content").css({"width":"0", "padding":"0"});
	$("#content").css({"padding":"20px"}).animate({"width":"478px"}, 1000);
	
	
	if (window.location.pathname == "/industries.php") {
		$img = "right_image_2";
	} else if (window.location.pathname == "/about-us.php") {
		$img = "right_image_3";
	} else if (window.location.pathname == "/contact-us.php") {
		$img = "right_image_1";
	} else {
		$img = "right_image";
	}
	$("#rightImage").attr("src", "images/"+$img+".jpg");
	
	// Highlight the menu
	var	page = window.location.href;
	$('#cmsNav1 a').each(function() {
		if($(this).attr('href') == page) {
			$(this).css("color","#0177C2");
			$(this).parents('#cmsNav1 ul').show();
		}
	});
	// menu toggle
	$("#cmsNav1> li > ul > li > ul > li > a").click(function() {
		$(this).parent().find('> ul').slideToggle("fast");
	});
	$("#cmsNav1> li > ul > li > a").click(function() {
		$(this).parent().find('> ul').slideToggle("fast");
	});
	$("#cmsNav1> li > a").click(function() {
		$(this).parent().find('> ul').slideToggle("fast");
	});

});
