// On window load set all windows to the max height of the largest column or 'maxheight', whichever is taller.
jQuery.ready(function() {
	var minheight = 550;																// The min-height that all three cols of the site should be
	var cols = jQuery('#sidebar, #sidebarInner, #content');								// get columns
	
	// Get minheight for content
	cols.each(function() { minheight = Math.max(minheight, $(this).height); });
					   
	// Set all cols to minheight
	cols.css('minHeight', minheight + 'px');
});

// Run photo sequence by fading out images from the top down
function runPhotoSequence(className) {
	// Vars
	duration = 1.5;															// duratoin of fade
	photosInFadeSequence = $$("."+className); // Get all the objs of the given classname and fade them from top down

	// Call this function and then set periodic call
	doPhotoFade();
	new PeriodicalExecuter(doPhotoFade, duration*photosInFadeSequence.length);
}

// Fade all images from 'photosInFadeSequence' var above and then reset
function doPhotoFade() {
	for(var i = (photosInFadeSequence.length-1); i>=0; i--)
	{
		photosInFadeSequence[i].fade({duration: duration, queue: {position: 'end', scope: 'imgs'} });
	}
	
	// Reset all images
	photosInFadeSequence.each(function(photo) {photo.appear( {duration:0} ) });
}
