// master.js - main javascript file for cambertx.com

// Once the page is ready
$(document).ready(function(){
	
	// Automatic image swapping code for the mouseovers.
	// Secondary image must end in "_over"
	$("#sideMenu ul li a img").mouseover(function(){
		path = $(this).attr("src");
		dotIndex = path.lastIndexOf(".");
		extension = path.slice(dotIndex);
		prefix = path.slice(0,dotIndex);
		result = prefix + "_over" + extension;
		$(this).attr("src", result);
	}).mouseout(function(){
		path = $(this).attr("src");
		path = path.replace(/_over/,"");
		$(this).attr("src", path);
	});

});

window.onload = function(){
	//Set height of news column to match content.
	contentHeight = $("#content").height();
	newsHeight = $("#news").height();
	if(contentHeight > newsHeight){ $("#news").height(contentHeight); }
}