
//loading message div
htmlstring = '<div id="loadingMsgDiv" class="content">Loading...  please wait.</div>'
//header div
htmlstring +='<div id="HeaderDiv"><img src="images/header.gif" width="573" height="85" alt="" border="0"></div>'
//handle div
htmlstring +='<div id="HandleDiv"><img src="images/frmhandle.gif" width="263" height="164" alt="" border="0"></div>'
//title divs
htmlstring +='<div id="TitletopDiv" class="pageTitle"></div><div id="TitlebtmDiv" class="pageTitleSh"></div>'
//calendar div
//htmlstring +='<div id="CalendarDiv"><a href="javascript:popupCalendar()" onmouseout="menuPopup(\'off\',\'Calendardesc\');" onmouseover="menuPopup(\'on\',\'Calendardesc\');"><img name="calendarImg" src="images/calendar.gif" width="70" height="18" alt="calendar" border="0"></a></div>'
//menuitems div
htmlstring += '<div id="MenuItemsDiv">'+
'<a href="index.htm" onmouseout="changeImage(\'MenuItemsDiv\',\'artistImg\',\'artist\'); menuPopup(\'off\',\'Adesc\');" onmouseover="changeImage(\'MenuItemsDiv\',\'artistImg\',\'artisthl\'); menuPopup(\'on\',\'Adesc\');">'+
'<img id="artistImg" name="artistImg" src="images/artist.gif" width="85" height="22" alt="artist" border="0"></a>'+
'<a href="process.htm" onmouseout="changeImage(\'MenuItemsDiv\',\'processImg\',\'process\'); menuPopup(\'off\',\'Pdesc\');" onmouseover="changeImage(\'MenuItemsDiv\',\'processImg\',\'processhl\'); menuPopup(\'on\',\'Pdesc\');">'+
'<img id="processImg" name="processImg" src="images/process.gif" width="85" height="21" alt="process" border="0"></a>'+
'<a href="gallery.htm" onmouseout="changeImage(\'MenuItemsDiv\',\'galleryImg\',\'gallery\'); menuPopup(\'off\',\'Gdesc\');" onmouseover="changeImage(\'MenuItemsDiv\',\'galleryImg\',\'galleryhl\'); menuPopup(\'on\',\'Gdesc\');">'+
'<img id="galleryImg" name="galleryImg" src="images/gallery.gif" width="85" height="24" alt="gallery" border="0"></a>'+
'<a href="contact.htm" onmouseout="changeImage(\'MenuItemsDiv\',\'contactImg\',\'contact\'); menuPopup(\'off\',\'Cdesc\');" onmouseover="changeImage(\'MenuItemsDiv\',\'contactImg\',\'contacthl\'); menuPopup(\'on\',\'Cdesc\');">'+
'<img id="contactImg" name="contactImg" src="images/contact.gif" width="85" height="24" alt="contact" border="0"></a></div>'
//menudescription divs
htmlstring += '<div id="AdescDiv" class="menudesc">	A short biography of the artist and current resume.</div>'+
'<div id="PdescDiv" class="menudesc">A description of the process used to create Eucled\'s art.</div>'+
'<div id="GdescDiv" class="menudesc">High resolution images of Eucled\'s work. Pieces chosen show the different basic styles, patterns, and wood colors used.</div>'+
'<div id="CdescDiv" class="menudesc">To contact Eucled or request more information about his art.</div>'+
'<div id="CalendardescDiv" class="menudesc">Find out about upcoming shows and news.</div>'
//logo div
htmlstring += '<div id="logoDiv"><a onmouseout="changeImage(\'logoDiv\',\'logoImg\',\'logoi\');" onmouseover="changeImage(\'logoDiv\',\'logoImg\',\'logohl\');"><img src="images/logo.gif" width="110" height="110" border="0" alt="Logo" id="logoImg" name="logoImg"></a></div>'+
'<div id="HomelblDiv" class = "menudesc">Home Page</div>'

//footer div
htmlstring += '<div id="footerDiv">Web Design &copy; 2000-2004<br>Allen Moore:<br>(allen.j.moore@gmail.com)<br>'+
			  '<a href="http://www.honeylocust.com/vr/">Freedom VR</a></div>'

var navcntlhtml = '<div id="NavcntlBackDiv">'+ 
    '<a href="#" onMouseOut="changeImage(\'NavcntlBackDiv\',\'BackImg\',\'back\')"'+
	'onMouseOver="changeImage(\'NavcntlBackDiv\',\'BackImg\',\'backhl\')"'+
	'onClick="changeParagraph(\'back\');">'+
	'<img  src="images/back.gif" id="BackImg" name="BackImg" width="26" height="35" border="0" alt="Back"></a>'+
	'</div>'+
	'<div id="NavcntlNextDiv">'+
    '<a href="#" onMouseOut="changeImage(\'NavcntlNextDiv\',\'NextImg\',\'next\')"'+
	'onMouseOver="changeImage(\'NavcntlNextDiv\',\'NextImg\',\'nexthl\')"'+
	'onClick="changeParagraph(\'next\');">'+
	'<img  src="images/next.gif" id="NextImg" name="NextImg" width="28" height="35" alt="Next" border="0"></a>'+
	'</div>'



function pageInit(){
//check for location and parent window
	//if (location.href.indexOf('index.htm') == -1){
	//	if (!self.opener){
	//		window.location = 'index.htm'
	//		return;
	//	}
	//}	
	createObjects();
//header stuff
	Titletop.replaceHTML('<span class="pageTitle">'+docTitle+'</span>');
	Titlebtm.replaceHTML('<span class="pageTitlesh">'+docTitle+'</span>');
	loadingMsg.hideMe();
	Header.showMe();
	Handle.showMe();
	
	Titletop.showMe();
	Titlebtm.showMe();
	MenuItems.showMe();
	footer.showMe();	
	logo.showMe();
	
	localInit();
}


//this function controls menu rollever descriptions
function menuPopup(state,item){
//state determines whether on or off
//item determines which menu item to manipulate
	if (state == 'on')	{
	eval(item+".showMe()");
	//object[item].showMe();
	}else{
	eval(item+".hideMe()");
	//object[item].hideMe();
	}
}

//this function is used to close the child window when someone clicks on the logo.
/*function logoNav(){
	if (!self.opener){
		if(compatible) {
        	var margin_height = (ns4) ? 30 : 50;
        	if(screen.height <= 768) {
            	var window_width = screen.width-12;
            	var window_height = screen.height-margin_height;
        	} else {
           	 var window_width = screen.width-12;
            	var window_height = screen.height-margin_height;
       		}
        	var window_top = 0;
        	var window_left = 0;
       		siteWindow = window.open('artist.htm','EucledMoore','scrollbars=yes,resizable=no,width=' + window_width + ',height=' + window_height + ',top=' + window_top + ',left=' + window_left + '');
    	}
	}else{
	currentWin = self.window;
	Parent = self.opener;
	parent.focus();
	currentWin.close();
	}
}*/
//this functions opens the calendar window 
//function popupCalendar(){
//		var window_width = 400;
//		var window_height = 400;
//		var window_left = ((screen.width/2) - (window_width/2));
//        var window_top = ((screen.height/2) - (window_height/2));
//       siteWindow = window.open('calendar.htm','Calendar','scrollbars=yes,resizable=no,width=' + window_width + ',height=' + window_height + ',top=' + window_top + ',left=' + window_left + '');
//}

//preload navigation images
preload('artisthl','images/artist_F2.gif');
preload('processhl','images/process_F2.gif');
preload('galleryhl','images/gallery_F2.gif');
preload('contacthl','images/contact_F2.gif');
preload('artist','images/artist.gif');
preload('process','images/process.gif');
preload('gallery','images/gallery.gif');
preload('contact','images/contact.gif');
preload('logoi','images/logo.gif');
preload('logohl','images/logohl.gif');
preload('calendar','images/calendar.gif');
preload('calendarhl','images/calendarhl.gif');
preload('back','images/back.gif');
preload('backhl','images/backhl.gif');
preload('next','images/next.gif');
preload('nexthl','images/nexthl.gif');


//paragraph control for pages with multiple paragraphs
currentparagraph = 1;
	
function changeParagraph(direction){

	if (direction=='next'){
		NavcntlBack.showMe();
		eval('content'+currentparagraph+'.hideMe()');		
		currentparagraph +=  1;
		if (currentparagraph == lyrcount){
			 NavcntlNext.hideMe();
		 }
	}else{
		NavcntlNext.showMe()
		eval('content'+currentparagraph+'.hideMe()');
		currentparagraph = currentparagraph - 1;
		if (currentparagraph == 1){
			NavcntlBack.hideMe();
		}
	}

	eval('content'+currentparagraph+'.showMe()');

	if (document.title == 'Creation Process'){
		loadingMsg1.showMe()
		newImage = 'images/process'+currentparagraph+'.jpg'
		imStr1 = '<IMG ID="processImg" SRC="'+newImage+'">';
		picture.replaceHTML(imStr1)
		loadingMsg1.hideMe()
	}
}


