
	h = 575;
	w = 575;
	galleryView = 0;
	textExpanded = 0;
	lp_text_layer_top = 0;
	lp_text_layer_right = 0;
	lp_text_layer_bg_top = 0;
	lp_text_layer_bg_right = 0;
	lp_gallery_callout_layer_bottom = 0;
	lp_gallery_callout_layer_left = 0;
	lp_return_layer_top = 0;
	lp_return_layer_right = 0;

	function resizePage() {
		if (galleryView == 0) {
			setLayerPlacement();
			placeLayers();
			drawHomeFlash();
		} else {
			setLayerPlacement();
			drawGalleryFlash();
		}
	}

	function mkEmail() {
		document.write('info');
		document.write('@');
		document.write('curtiscreative');
		document.write('.net');
	}

	function mkPhone() {
		document.write('(919)');
		document.write(' 300');
		document.write('-7507');
	}

	function showLayer(layerName){
		hideAllLayers();
		if (textExpanded == 0) {
			textExpanded = 1;
			lp_text_layer_bg_top = 20;
			$('#text-layer-bg').animate({ top: lp_text_layer_bg_top }, 500);
		}
		setTimeout("$('#"+layerName+"-layer').fadeIn(500);", 250);
		document.getElementById(layerName+'-nav').className="navlink-selected";
	}

	function hideAllLayers() {
		$('#whoweare-layer').fadeOut(500);
		$('#weddings-layer').fadeOut(500);
		$('#portraits-layer').fadeOut(500);
		$('#events-layer').fadeOut(500);
		document.getElementById('whoweare-nav').className="navlink";
		document.getElementById('weddings-nav').className="navlink";
		document.getElementById('portraits-nav').className="navlink";
		document.getElementById('events-nav').className="navlink";
	}
	
	function hideTextLayers() {
		hideAllLayers();
		//$('#text-layer-bg').animate({ opacity: 0.0 }, 1500);
	}

	function getScreenSize() {
		h = 950;
		w = 650;
		if (window.innerWidth) {
			h = window.innerHeight;
			w = window.innerWidth;
		} else if (document.all) {
			h = document.body.clientHeight;
			w = document.body.clientWidth;
		}
	}
	
	function setLayerPlacement() {
		getScreenSize();
		lp_text_layer_top = 95;
		lp_text_layer_right = 70;
		lp_text_layer_bg_right = 0;
		if (textExpanded == 1) {
			lp_text_layer_bg_top = 20;
		} else {
			lp_text_layer_bg_top = -500;
		}
		
		lp_gallery_callout_layer_bottom = 100;
		lp_gallery_callout_layer_left = 20;

		lp_return_layer_top = 20;
		lp_return_layer_right = 20;
	}
	
	function placeLayers() {
		document.getElementById('text-layer').style.top = lp_text_layer_top;
		document.getElementById('text-layer').style.right = lp_text_layer_right;
		document.getElementById('text-layer-bg').style.top = lp_text_layer_bg_top;
		document.getElementById('text-layer-bg').style.right = lp_text_layer_bg_right;
		
		document.getElementById('gallery-callout-layer').style.bottom = lp_gallery_callout_layer_bottom;
		document.getElementById('gallery-callout-layer').style.left = lp_gallery_callout_layer_left;

		document.getElementById('return-layer').style.top = lp_return_layer_top;
		document.getElementById('return-layer').style.right = lp_return_layer_right;

		drawHomeFlash();
	}

	function drawGalleryFlash() {
		document.getElementById('gallery-layer').style.height= h - 40;
		document.getElementById('gallery-layer').style.width= w -40;
		document.getElementById('gallery-layer').style.top = 20;
		document.getElementById('gallery-layer').style.left = 20;
		var so = new SWFObject("flash/monoslideshow.swf", "monoflash", "100%", "100%", "7", "#000000");
		so.addVariable("showLogo", "false");
		so.addVariable("showVersionInfo", "false");
		so.addVariable("dataFile", "flash/gallery.xml");
		so.addParam("wmode", "transparent");
		so.write("monoSlideshow");
	}

	function drawHomeFlash() {
		document.getElementById('gallery-layer').style.height= h - 125;
		document.getElementById('gallery-layer').style.width=w;
		document.getElementById('gallery-layer').style.top = 76;
		document.getElementById('gallery-layer').style.left = 0;
		var so = new SWFObject("flash/monoslideshow.swf", "monoflash", "100%", "100%", "7", "#000000");
		so.addVariable("showLogo", "false");
		so.addVariable("showVersionInfo", "false");
		so.addVariable("dataFile", "flash/home.xml");
		so.addParam("wmode", "transparent");
		so.write("monoSlideshow");
	}

	function drawPage() {
		setLayerPlacement();
		placeLayers();
		drawHomeFlash();
		document.getElementById('gallery-layer').style.visibility="visible";
		document.getElementById('gallery-callout-layer').style.visibility="visible";
		document.getElementById('text-layer-bg').style.visibility="visible";
		$('#logo-layer').fadeIn(1500);
		$('#nav-layer').fadeIn(1500);
		$('#contact-layer').fadeIn(1500);
		//showLayer('whoweare');
	}
	
	function showGallery() {
		galleryView = 1;
		drawGalleryFlash();
		hideMain();
		document.getElementById('return-layer').style.visibility="visible";
		setTimeout("document.getElementById('return-button').src = 'images/return-button-off.png'", 2000);
	}
	
	function hideGallery() {
		galleryView = 0;
		document.getElementById('return-layer').style.visibility="hidden";
		document.getElementById('gallery-layer').style.visibility="hidden";
		showMain();
		drawHomeFlash();
		setTimeout("document.getElementById('gallery-layer').style.visibility='visible'", 1500);
	}
	
	function showMain() {
		$('#text-layer-bg').animate({ top: lp_text_layer_bg_top }, 500);
		$('#text-layer').animate({ top: lp_text_layer_top }, 500);
		$('#gallery-callout-layer').animate({ left: lp_gallery_callout_layer_left }, 500);
		$('#nav-layer-bg').animate({ top: 0 }, 500);
		$('#contact-layer-bg').animate({ left: 0 }, 500);
		$('#nav-layer').animate({ opacity: 1 }, 1500);
		$('#logo-layer').animate({ opacity: 1 }, 1500);
		$('#contact-layer').animate({ opacity: 1 }, 1500);
	}

	function hideMain() {
		$('#text-layer-bg').animate({ top: -500 }, 500);
		$('#text-layer').animate({ top: -500 }, 500);
		$('#gallery-callout-layer').animate({ left: -500 }, 500);
		$('#nav-layer-bg').animate({ top: -500 }, 500);
		$('#contact-layer-bg').animate({ left: -2500 }, 500);
		$('#nav-layer').animate({ opacity: 0 }, 250);
		$('#logo-layer').animate({ opacity: 0 }, 250);
		$('#contact-layer').animate({ opacity: 0 }, 250);
	}
