//-------------------------------
// Pull out turnout image to #extra
//-------------------------------
$.fn.takeOut = function() {
	return this.each(function() {
		$_this = $(this),
		$_this._src = $_this.attr('src');
		$('#imageholder img').attr('src', $_this._src);
		$_this.remove();
	});
};

//-------------------------------
// Makes Div equal the same height
//-------------------------------
$.fn.equalCols = function() {
	//Array Sorter
	var sortNumber = function(a,b) {return b - a;},
		heights = [];
	//Push each height into an array
	$(this).each(function() {
		heights.push( $(this).height() );
	});
	heights.sort(sortNumber);
	var maxHeight = heights[0];
	return this.each(function() {
		//Set each column to the max height
		$(this).css({'height': maxHeight});
	});
};

$(function() {
	$('#content #takeout img').takeOut();
});

$(window).load(function() {
	$('#content, #sidebar, #extra').equalCols();
});
