$(function() {

	$(".newWin").attr("target", "_blank");
	
	// Force the left and right columns to extend to the footer
	var leftCol = $("#main div.leftCol");
	var rightCol = $("#main div.rightCol");
	var rightColumn = $("#rightColumn"); // This is the main right column, not the best difference in names!
	var footer = $("#footer");
	// In case the page doesn't have the left and right columns, check for selection
	if (leftCol.size() > 0) {
		var expandLeftBy = footer.offset().top - leftCol.offset().top - leftCol.height();
		leftCol.height(leftCol.height() + expandLeftBy);
	}
	if (rightCol.size() > 0) {
		var expandRightBy = footer.offset().top - rightCol.offset().top - rightCol.height();
		rightCol.height(rightCol.height() + expandRightBy);
	}
	if (rightColumn.size() > 0) {
		var expandRightBy = footer.offset().top - rightColumn.offset().top - rightColumn.height();
		rightColumn.height(rightColumn.height() + expandRightBy);
	}
	
	//alert(123);
	//setEqualHeight($("#main div.leftCol, #main div.rightCol, #rightColumn"));
	
});

function setEqualHeight(columns) {
	var tallestcolumn = 0;
	columns.each(function() {
		currentHeight = $(this).height();
		if(currentHeight > tallestcolumn) {
			tallestcolumn  = currentHeight;
		}
	});
	columns.height(tallestcolumn);
}

function rollovers(details, containerID) {

	var images = $("#" + containerID + " img");
	
	images.each(function(i) {
		
		this.offSrc = details[i].off;
		this.onSrc = details[i].on;
		
		$(this).mouseover(function() {
			this.src = this.onSrc;
		}).mouseout(function() {
			this.src = this.offSrc;
		});
		
	});
	
} 
