// JavaScript Document



jQuery().ready(function (){
	// fix alignment 
	navHeight = $("#navMain").height() + 100;
	pageHeight = $("#pageContent").height();
	

	console.log("HEIGHT" + navHeight);
	console.log("HEIGHT" + pageHeight);	
	
	if (navHeight > pageHeight) {
		$("#pageContent").height(navHeight);
	}

	// fix buttons 
	$("INPUT:submit").addClass("button");
	$("INPUT:button").addClass("button");

	// ACTIVATE NAV
	var navItem = "#navMain #mm-" + section;
	$(navItem).addClass("on");

	// ACTIVATE NAV
	var navItem = "#navMain #sm-" + page;
	$(navItem).addClass("on");

	
	var navItem = $("#navMain #mm-" + section + " IMG");
	var cSRC = navItem.attr("src");
	if (cSRC) {
		cSRC = cSRC.replace("off","on");
		navItem.attr("src",cSRC);
	}
	
	var overItems = $(".imgOver");
	overItems.each(											 
		function(i){
			$(this).mouseover( function() { showOver(this); } );
			$(this).mouseout( function()  { showOff(this); } );
 	});	

	
	var overItems = $("#navMain A IMG");
	overItems.each(											 
		function(i){
			$(this).mouseover( function() { showOver(this); } );
			$(this).mouseout( function()  { showOff(this); } );
 	});
	
});

function showOver(wImg) {
	wImg.src = wImg.src.replace("off","over");
	
}

function showOff(wImg) {	
	wImg.src = wImg.src.replace("over","off");
}