$(document).ready(function(){
	$(window).load(function(){
		large1 = Math.max($(".colOne").height(),$(".colTwo").height());
		$(".colOne, .colTwo").css("height",((large1/10)+"em"));
		larger1 = Math.max($(".colThree:eq(1)").height(),$(".colThree:eq(2)").height());
		//alert(larger1);
		larger2 = Math.max(larger1,$(".colThree:eq(3)").height());
		//alert(larger2);
		$(".colThree").css("height",((larger2/10)+"em"));
	});
	$("#main, html, body").css("min-height","100%");
	$("#footerMenu li a").click(function(){
		//alert($("#wrapper").height());
		if(!$(this).hasClass("active")){
			$("#footerMenu li a").removeClass("active");
			curTab = "#"+$(this).attr("class");
			$(".expand").animate({
				height: "0px"
			},300,function(){							 
				$(curTab).animate({
					height: "45em"
				},300);
				$("html,body").animate({scrollTop: $("#wrapper").height()},330);
			});
			$(this).addClass("active");
			return false;
		} else {
			$(this).removeClass("active");
			$(".expand").animate({
				height: "0em"
			},300);
			return false;
		}
	});
	$("#navigationPrimary li").mouseover(function(){
		$(this).children("ul").css("display","block");					  
	});
	$("#navigationPrimary li").mouseout(function(){
		$(this).children("ul").css("display","none");					  
	});
	
	//if($.browser.msie && (jQuery.browser.version < 7)){
	//	$("#navigationPrimary li ul li a").css("letter-spacing","-1px");
	//}
	$("#navigationPrimary>li>a").each(function(){
		var curTitle = $(this).attr("title");
		curTitle = curTitle.toLowerCase();
		var newTitle = curTitle.replace(" ","");
		var newTitle = newTitle.replace(" ","");
		var imgSrc = "url(images/main_" + newTitle + ".gif)";
		$(this).append("<img src='images/main_"+newTitle+".gif' />");		
		$(this).css("background-image",imgSrc);
		//$(this).children("img").remove();
	});
	$("#navigationPrimary>li>ul>li>a").each(function(){
		var curTitle = $(this).attr("title");
		curTitle = curTitle.toLowerCase();
		var newTitle = curTitle.replace(" ","");
		var newTitle = newTitle.replace(" ","");
		var newTitle = newTitle.replace(" ","");
		var newTitle = newTitle.replace(" ","");
		var imgSrc = "url(images/sub_" + newTitle + ".gif)";
		$(this).append("<img src='images/sub_"+newTitle+".gif' />");		
		$(this).css("background-image",imgSrc);
	});
	$("#navigationPrimary li ul li:last-child a").css("border-right","none");
});