// JavaScript Document

var pageSetUp = function() {
// set up the page
	pageDims = $('wrapperBorder').getCoordinates() ; // returns left top height width right integer numbers
	titleDims = $('indexText').getCoordinates() ; // returns left top height width right integer numbers
	imageDims = $('imageL').getCoordinates() ; // returns left top height width right integer numbers
	footerDims = $('footer_div').getCoordinates() ; // returns left top height width right integer numbers
	if(pageDims.height < titleDims.height + imageDims.height + footerDims.height + 10) { // page is too small
		contentHeight = titleDims.height + imageDims.height + footerDims.height;
		$('wrapperBorder').setStyle('height',contentHeight);
		$('footer_div').setStyles({'bottom':'auto','position':'relative'});
	} else { // space the page properly
		whiteSpace = pageDims.height - titleDims.height - imageDims.height - footerDims.height;
		$('indexText').setStyle('padding-top',whiteSpace/2);
		$('footer_div').setStyles({'bottom':0,'position':'absolute'});
	}
	
	
// set up the images
	$('imageMainDivs').getElements('div[class=imageArea]').each( function(el) {  // loop through each of the 3 main images
//		el.getElement('ul').set('morph', {duration: 1500, transition: 'elastic:out'});
		el.getElement('ul').set('morph', {duration:300, transition: 'linear'});
		(function() {el.getElement('ul').morph({'top':-530,'left':-10});}).delay(200); // delay placard disappearing
		el.addEvent('mouseenter', function () { el.getElement('ul').morph({'top':-90,'left':0}); });  // does all 3 together
		el.addEvent('mouseleave', function () { el.getElement('ul').morph({'top':-530,'left':-10}); });		// does all 3 together																														
	})
}


window.addEvent('domready', function() { //here we add functions that fire when the dom is ready.. images probably not ready
	pageSetUp();

	});

window.addEvent('load', function() { //here we add functions that fire when the page is ready
//	probably nothing here;
});

