/*
 * Adan Creative Designs
 * (c) 2010
 *
 */
 
function setLayout()
// If JavaScript is enabled then set the layout to the viewports dimensions with
// the footer and nav anchored to the viewport base and the content set to fit
// and scroll as required by the actual height.
{
	// check the vertical height of the viewport and return to default
	// css config if it is too small to display the content well.
	if (document.body.clientHeight < 500) return;
	
	// if the viewport is tall enough to view content well,
	// place the content <div> and set the height property
	var c = document.getElementById('content')
		c.style.position = "absolute";
		c.style.left = "0px";
		c.style.top = "30px";
		// 230 below equals the sum of the heights for:-
		//		header:30px,
		//		nav:30px,
		//		footer:120px,
		//		content-vertical-padding:50px
		c.style.height = document.body.clientHeight-230 + "px";
	
	// place the nav <div> at the footer's topline
	var n = document.getElementById('nav')
		n.style.position = "absolute";
		n.style.left = "0px";
		n.style.bottom = "120px";
	
	// place the footer <div> at the viewports baseline
	var f = document.getElementById('footer')
		f.style.position = "absolute";
		f.style.left = "0px";
		f.style.bottom = "0px";
}

function showGallery()
// This function drives the starting of the gallery from the "Play the Entire Gallery" link.
{
	Lightbox.start(document.getElementById('firstImage'));
}