function pageLoad(page) {
	if ($('header')) { var header = $('header'); }	

	if ($('splash')) { 
		var splash = $('splash'); 
		windowWidth = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;
		
		splash.style.left = ((windowWidth - 301) / 2) + 'px';
		
		new Effect.Morph('splashBot', {
			style: 'height: 174px',
			afterFinish: function() {
				new Effect.Morph('splashTop', {
					style: 'height: 174px',
					afterFinish: function() {
						splash.onclick = function() {
							new Effect.Scale(splash, 30.571, { scaleFromCenter: true, duration: .5 });
							new Effect.Scale('splashTop', 30.571, { duration: .5 });
							new Effect.Scale('splashBot', 30.571, {
								duration: .5, 
								afterFinish: function() {
									
									new Effect.Morph(splash, {
										duration: .5,
										style: 'left:10px;top:10px',
										afterFinish: function() {
											new Effect.Appear('header', { duration: .4 });
											new Effect.Fade(splash, { duration: .7,
												afterFinish: function() {
													canvasProcess(); 
												}
											});
										}
									});
									
								}
							});
							
						}
					}
				});
			}
		});
	} else {
		new Effect.Appear('header', {
	  	duration: .7, 
			afterFinish: function() { 
				canvasProcess(); 
			}
		});
	}
}



function canvasProcess() {
	var header = $('header');
	var logo = $('logo');
	var nav = $('menu');
	if ($('content')) {
		var content = $('content');
	}
	if ($('secondary')) {
		var sidebar = $('secondary');
	}

	if (header.style.display == 'none') {
		var canvasState = 'start';
	}	else if ((nav.style.display == 'none')) {
		var canvasState = 'ready';
	} else  {
		var canvasState = 'open';
	} 
	
	if (canvasState == 'ready') {
		new Effect.Morph('nav', {
		  style: 'openNav', // CSS class name
		  duration: 0.6, // Core Effect properties
			afterFinish: function() {
				new Effect.Morph('nav', { duration: .6, style: 'droppedNav' });
				new Effect.BlindDown(nav, { 
					afterFinish: function() {
						if ($('secondary')) $('secondary').appear();
						if ($('content')) $('content').appear();
					}
				});
			}
		});		
		var canvasState = 'open';
	} else {
		document.location.href="http://thirdfloornewyork.com"; 
	}
}

function lookbook(state, look) {
	var fullLooks = $('fullLooks').getElementsByClassName('look-full');
	//var thumbLooks = $('thumbnails').getElementsByClassName('look-thumb');

	if (state == 'init') {
		var imgWidth = parseFloat($('look1-full').getStyle('width'));
		$('looksCont').style.width = (imgWidth + 10) * (fullLooks.length) + 'px';

		scrollDivLeft('fullLooks',30);
	} 
}

