
function addTitle( pageName ) {

	testForIE();
	
	var imgDir = (pageName == "index") ? "images" : "../images";
	
	//get title div, add first bar
	var title = document.getElementById( "title" );
	title.appendChild( document.createElement( "hr" ) );
	
	//setup the table with the background
	var table = document.createElement( "table" );
	table.style.width = "100%";
	table.style.background = "white url('" + imgDir + "/title_back.png')";
	table.style.borderStyle = "outset";
	var tbody = document.createElement( "tbody" );
	var row = document.createElement( "tr" );
	
	//add the icon
	var td1 = document.createElement( "td" );
	td1.align = "center";
	td1.valign = "middle";
	td1.width = "150";
	var img = document.createElement( "img" );
	img.src = imgDir + "/LPK.png";
	img.alt = "LPK";
	img.width = "100";
	img.height = "100";
	td1.appendChild( img );
	row.appendChild( td1 );
	
	//empty column for spacing
	var td2 = document.createElement( "td" );
	td2.width = "80";
	row.appendChild( td2 );
	
	//add my name
	var td3 = document.createElement( "td" );
	td3.align = "left";
	td3.appendChild( document.createElement( "p" ) );
	var name = document.createElement( "h1" );
	name.appendChild( document.createTextNode( "Andrew Knight" ) );
	td3.appendChild( name );
	row.appendChild( td3 );	
	
	//add everything to the table
	tbody.appendChild( row );
	table.appendChild( tbody );
	title.appendChild( table );
	title.appendChild( document.createElement( "hr" ) );
}

function testForIE() {
	if ( navigator.userAgent.toLowerCase().indexOf( 'msie' ) != -1 ) {
		alert( "Warning!\nThis web page does not fully support your browser. " + 
				"You may experience difficulty with layout or functionality. " +
				"For full support, please use Firefox or Safari." );
	}
}
