// JavaScript Document

function writeHeader(){
	document.write('<img src="/images/header_test.gif" width="880" height="117" usemap="#Map" border="0"/>');
	document.write('<map name="Map" id="Map"><area shape="rect" coords="54,20,321,116" href="/index.html" /></map>');
}

function writeFooter(){
	document.write('<p id="firstPar">&copy;2011 Jill Hays Photography</p>');
	document.write('<p>512.297.3011<br />');
	document.write('<a href="mailto:jillhays@jillhays.com">jillhays@jillhays.com</a><br />');
	document.write('Austin, Texas</p>');
	
	try{
		highlightNav();
	}
	catch(err){};
}

function highlightNav(){
	var section = '';
	// split the url into an array of elements where it encounters a slash
	section = document.location.href.split("/");
	// grab the third element in the seciton array would would /weddings/ or /portraits/ for example
	section = section[3];
	// tack on nav at the start, uppercase the first letter and assembe the string
	section = 'nav' + section.substring(0,1).toUpperCase() + section.substring(1,section.length);
	// set the style of the first child element of the navigation element to have a position of top 
	// to highlight the section
	document.getElementById(section).firstChild.style.backgroundPosition = 'top';
}

function writeFlash(){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="709" height="343" title="Slideshow">');
	document.write('<param name="movie" value="slideshow_as2.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<embed src="slideshow_as2.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="709" height="343"></embed>');
	document.write('</object>');
}
