
var navItems = new Array();
navItems[0] = 8;
navItems[1] = 90;
navItems[2] = 240;
navItems[3] = 385;
navItems[4] = 505;
navItems[5] = 660;
navItems[6] = 755;
navItems[7] = 835;
var origLeft = 8;
var toId = null;
var torchSpeed = 200;

$(document).ready(function(){
						   
	
	origLeft = $("#torch").css("left");
	
	
	var lch = $(".leftCol").height();
	//450 is offset for cycle banner on right
	var bannerOffset = 450;
	var rch = $(".rightCol").height();
	if(lch < 350){
		lch = 350;
		$(".leftCol").height(lch);
	}
	if(lch > rch){
		$(".rightCol").height(lch);
	}else{
		$(".leftCol").height(rch);	
	}
	var bmm = $("#bodyOuterCont .mm").height();
	var lmm = $("#bodyOuterCont .ml").height();
	var rmm = $("#bodyOuterCont .mr").height();
	if(bmm > lmm && bmm > rmm){
		$("#bodyOuterCont .mm").height(bmm);
		$("#bodyOuterCont .ml").height(bmm);
		$("#bodyOuterCont .mr").height(bmm);
	}
	
	$("#navInnerCont .topNav img, #navInnerCont .topNav span").hover(
		function(){
			clearTimeout(toId);
			i = $(this).attr("id");
			$("#torch").animate(
				{ "left" : navItems[i.replace("topNav","")] + "px" },
				torchSpeed);
		},function(){
			//toId = setTimeout("resetTorch('" + origLeft + "')", 1000);	
		}
	);

	$("#navInnerCont li").hover(
		function(){
			//$(this).addClass("navHover");
			$(this).addClass("navHover");
			//alert($(this).attr("id") + " | on");
		},function(){
			//$(this).removeClass("navHover");
			var e = $(this);
			setTimeout(
					   function(){
						   	e.removeClass("navHover");
						},300);
			//alert($(this).attr("id") + " | off");
		}
	);
	
	
	
});

function resetTorch(lft){
	//clearTimeout(toId);
	$("#torch").animate(
		{ "left" : lft },
		torchSpeed);
}

