document.onkeypress = keyhandler;function keyhandler(e) {if (document.layers){Key = e.which;}else{Key = window.event.keyCode;}if (Key ==91) {history.go(-1);}else if (Key ==93) {history.go(+1);}}


function MM_swapImage() { var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}
function preloader(){
	menubuttons = new Array ('bookleftnorm','bookrightnorm','arrownorm','arrownext', 'arrowprev', 'arrowtopover','bookleftover', 'bookrightover', 'doorover');
	arImageList = new Array ();
	for (counter in menubuttons) {arImageList[counter] = new Image();arImageList[counter].src = '../menu/'+menubuttons[counter]+'.gif';}
}
function MM_findObj(n, d) {var p,i,x;  if(!d) d=document; if((p=n.indexOf('?'))>0&&parent.frames.length) {d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;}
function ChapTitle(chap){if(chap=='ima'){document.write("<table class='N' width='100%' border='0' cellspacing='0' cellpadding='0'><tr>");
					document.write("<td rowspan=2 border=1 height='70' width='140'><img height='70' width='140' src='../menu/spacer.gif' alt =' '></td><td colspan=7 align=center><img src='../menu/indexbanner"+chap+".gif' width='400' height=35 alt='Chapter "+chap+"'></td><td rowspan=2 width=140 align='left'>");
					home('../index.html');
					document.write("</td></tr><tr>");
					document.write("<td><a target='image' href='imagestart.html'>		<img width=85 border=0 height=35 src='../menu/ima-menu-ind2_b.gif' alt='INDEX'>		</a></td>");
					document.write("<td><a target='image' href='i-group1.html'>		<img width=85 border=0 height=35 src='../menu/ima-menu-gro2.gif' alt='Group Photos'>	</a></td>");
					document.write("<td><a target='image' href='i-portrait1.html'>		<img width=85 border=0 height=35 src='../menu/ima-menu-por2.gif' alt='Portaits'>		</a></td>");
					document.write("<td><a target='image' href='i-industry1.html'>		<img width=85 border=0 height=35 src='../menu/ima-menu-ins2.gif' alt='Industry'>		</a></td>");
					document.write("<td><a target='image' href='i-landscape1.html'>		<img width=85 border=0 height=35 src='../menu/ima-menu-lan2.gif' alt='Landscape'>		</a></td>");
					document.write("<td><a target='image' href='i-buildings1.html'>		<img width=85 border=0 height=35 src='../menu/ima-menu-bui2.gif' alt='Buildings'>		</a></td>");
					document.write("<td><a target='image' href='i-misc1.html'>		<img width=85 border=0 height=35 src='../menu/ima-menu-mis2.gif' alt='Miscellaneous'>	</a></td>");
					document.write("</tr></table>");}
			else{document.write("<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td align=center class='N'><img src='../menu/indexbanner"+chap+".gif' width='400' height=35 alt='Chapter "+chap+"'></td></tr></table>");   }
}
function uparrowout() {MM_swapImage('arrowtop' ,' ','../menu/arrowtopnorm.gif'  ,1);}
function uparrowover(){MM_swapImage('arrowtop' ,' ','../menu/arrowtopover.gif'  ,1);}

function homeout() {MM_swapImage('homer' ,' ','../menu/homea.gif'  ,1);}
function homeover(){MM_swapImage('homer' ,' ','../menu/homeb.gif'  ,1);}

function adamMenu(prev, next, chap){	document.write("<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td class='N'><img border=0 height=50 width='100' src='../menu/spacer.gif' alt =' '></td><td class='N' align=center><img align=center src='../menu/indexbanner"+chap+".gif' width='400' height=35 alt='Chapter "+chap+"'></td><td class='N' width=100>");
					bookMenu(prev, next, '1');
					document.write("</td></tr></table>");
}
function yo(){if(confirm("ok you figured out how to use the HOME button\nDo You Wish to Return to the Home Page.")==true){window.navigate('../index.html');}  }

function home(link, prompt){		document.write("<a target='_top' ");
					if(prompt!=null){document.write(" onmousedown=\"yo()\" ");}	else{document.write("href='"+link+"'");}
					document.write("onmouseout='homeout()' onmouseover='homeover()'	><img border=0 width='140' height='70' name='homer' src='../menu/homea.gif' alt='HOME Portrait of R.E. Gosnell (courtesy of B.C Archives)'></a>");   }

function top(link){			document.write("<a href='"+link+"' onmouseout='uparrowout()' onmouseover='uparrowover()'><img border=0 width='100' height='70' name='arrowtop'	src='../menu/arrowtopnorm.gif'  alt='Back to Top'></a>");}
function bottomMenu(prev, next){	document.write("<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td class='N' rowspan=2 valign='bottom' width=100>");
					top("#top");
					document.write("</td><td class='N' rowspan=2 ><img src='../images/transparent.gif' width='400' height=35 alt='No picture here'></td><td class='N' align=right>");
					bookMenu(prev, next, '2');
					document.write("</td></tr></table>");

}
function bookMenu(prev, next, num){	document.write("<table border='0' cellspacing='0' cellpadding='0'><tr>");
if (prev!='x'){				document.write("<td  class='N' align=right><a href= \""+prev+"\" onmouseout=\"pageturner('defa', "+num+"), arrowswapper('defa', "+num+")\" onmouseover=\"pageturner('prev', "+num+") ,arrowswapper('prev', "+num+")\"><img border=0 width='50' height='50' name='bookleft" +num+"' src='../menu/bookleftnorm.gif'  alt='Previous Page'></a></td>");}		else{document.write("<td align=right class='N'><img border=0 width='50' height='50' src='../menu/bookleftnorm.gif' alt='No Previous Page'></td>");}
if (next!='x'){				document.write("<td  class='N' align=left> <a href= \""+next+"\" onmouseout=\"pageturner('defa', "+num+"), arrowswapper('defa', "+num+")\" onmouseover=\"pageturner('next', "+num+") ,arrowswapper('next', "+num+")\"><img border=0 width='50' height='50' name='bookright"+num+"' src='../menu/bookrightnorm.gif' alt='Next Page'	></a></td></tr>");}	else{document.write("<td align=left  class='N'><img border=0 width='50' height='50' src='../menu/bookrightnorm.gif'alt='No Next Page'></td>");}
					document.write("</tr><tr><td colspan=2 align=center  class='N'><img border=0 width='100' height='20' name='arrow"+num+"' src='../menu/arrownorm.gif' alt='next'></td></tr></table>");
}


function arrowswapper(direction, num){
	if (num=='1')	{
		if (direction=='prev'){MM_swapImage('arrow1',' ','../menu/arrowprev.gif', 1);}
		if (direction=='next'){MM_swapImage('arrow1',' ','../menu/arrownext.gif', 1);}
		if (direction=='defa'){MM_swapImage('arrow1',' ','../menu/arrownorm.gif',  1);}
		if (direction=='pag1'){MM_swapImage('arrow1',' ','../menu/arrowpag1.gif',  1);}
		if (direction=='pag2'){MM_swapImage('arrow1',' ','../menu/arrowpag2.gif',  1);}
		if (direction=='pag3'){MM_swapImage('arrow1',' ','../menu/arrowpag3.gif',  1);}
		if (direction=='pag4'){MM_swapImage('arrow1',' ','../menu/arrowpag4.gif',  1);}
		if (direction=='pag5'){MM_swapImage('arrow1',' ','../menu/arrowpag5.gif',  1);}
	}else 		{
		if (direction=='prev'){MM_swapImage('arrow2',' ','../menu/arrowprev.gif', 1);}
		if (direction=='next'){MM_swapImage('arrow2',' ','../menu/arrownext.gif', 1);}
		if (direction=='defa'){MM_swapImage('arrow2',' ','../menu/arrownorm.gif',  1);}
	}
}
function pageturner(direction, num){
	if (num=='1')	{
		if (direction=='prev'){	MM_swapImage('bookleft1' ,' ','../menu/bookleftover.gif'  ,1);}
		if (direction=='next'){	MM_swapImage('bookright1',' ','../menu/bookrightover.gif' ,1);}
		if (direction=='defa'){	MM_swapImage('bookleft1' ,' ','../menu/bookleftnorm.gif'  ,1);
			       		MM_swapImage('bookright1',' ','../menu/bookrightnorm.gif' ,1);}
	}else { if (direction=='prev'){ MM_swapImage('bookleft2' ,' ','../menu/bookleftover.gif'  ,1);}
		if (direction=='next'){ MM_swapImage('bookright2',' ','../menu/bookrightover.gif' ,1);}
		if (direction=='defa'){ MM_swapImage('bookleft2' ,' ','../menu/bookleftnorm.gif'  ,1);
			       	        MM_swapImage('bookright2',' ','../menu/bookrightnorm.gif' ,1);}
} }
function link(link, name, alt, target){
	document.write("<table border=2 border=2 bgcolor=white><tr><td class='N'> <a href= '"+link+"'onmouseout='MM_swapImage(\""+alt+"\",\" \",\"../menu/doornorm.gif\", 1)' onmouseover='MM_swapImage(\""+alt+"\",\" \",\"../menu/doorover.gif\", 1)' ");
	if (target==null)  {document.write("target='_new' ");}
	document.write("><img border=0 width='50' height='50' name='"+alt+"' src='../menu/doornorm.gif'");

	     if ((name!="x")&&(alt !="x")){document.write("alt='"+name+"- "+alt+"'>	</a></td><td class='N' align='center'><a href= '"+link+"' ");}
	else if ((name=="x")&&(alt !="x")){document.write("alt='"+alt+"'>		</a></td><td class='N' align='center'><a href= '"+link+"' ");}
	else 				  {document.write("alt='"+name+"'>		</a></td><td class='N' align='center'><a href= '"+link+"' ");}
	if (target==null)  {document.write(" target='_new' ");}
	if (name!="x"){document.write("><font size='2' color='darkblue'>"+name+"	</font><br>");}

	if (alt !="x"){document.write(" <font size='2' color='darkblue'><i>"+alt+"</i>	</font></a>");}
	document.write("</td></tr></table>");
}
function igMenu(title, page, outOf, filer, num){
	document.write("<table width=100% border=0><tr><td width=100></td><td align=center>");
	document.write("<font size=7>"+title+"</font></td><td width=100>");
	imabookMenu(page, outOf, filer, num);
	document.write("</td></table>");
}
function imabookMenu(pagNum, of, file, num){document.write("<table border='0' cellspacing='0' cellpadding='0'><tr><td align=right class='N'>");
if (pagNum!='1'){	document.write("				<a href= \""+file+(pagNum-1)+".html\" onmouseout=\"pageturner('defa','"+num+"'), arrowswapper('pag"+pagNum+"','"+num+"')\" onmouseover=\"pageturner('prev','"+num+"') ,arrowswapper('pag"+(pagNum-1)+"','"+num+"')\"><img border=0 width='50' height='50' name= 'bookleft"+num+"' src='../menu/bookleftnorm.gif'  alt='Previous Page'></a></td>");}	else{document.write("<img border=0 width='50' height='50' src='../menu/bookleftnorm.gif' alt='No Previous Page'></td>");}
if (pagNum!=of){	document.write("<td align=right class='N'>	<a href= \""+file+(pagNum+1)+".html\" onmouseout=\"pageturner('defa','"+num+"'), arrowswapper('pag"+pagNum+"','"+num+"')\" onmouseover=\"pageturner('next','"+num+"') ,arrowswapper('pag"+(pagNum+1)+"','"+num+"')\"><img border=0 width='50' height='50' name='bookright"+num+"' src='../menu/bookrightnorm.gif'  alt='Next Page'></a></td>");}	else{document.write("<td align=right class='N'><img border=0 width='50' height='50' src='../menu/bookrightnorm.gif' alt='No Next Page'></td>");}

if ((pagNum=='1')&&(of=='1')){	document.write("</tr><tr><td colspan=2 align=center  class='N'><img border=0 width='100' height='20' name='arrow1' src='../menu/arrowpag1of1.gif' alt='Page#1 of 1'></td></tr></table>");}
else{				document.write("</tr><tr><td colspan=2 align=center  class='N'><img border=0 width='100' height='20' name='arrow1' src='../menu/arrowpag"+pagNum+".gif' alt='Page#"+pagNum+" of "+of+"'></td></tr></table>");}
}
function bookContent(linky){
	document.write("<a href=\"javascript:newWindow('"+linky+"')\">Link to Book Text</a>");
}
function newWindow(linky){
	var newy=window.open("externallink.html", null, "width=790, height=500,status=no,"+"toolbar=no, menubar=no,location=no");
	newy.document.write("<script>self.moveTo(0,0);</script><frameset cols = '150,*' border='0'><frame name='mainmenu'  noresize Scrolling='no'  src='../mainmenu.html'>");
	newy.document.write("<frame name='mainFrame'noresize Scrolling='yes' src='"+linky+"'></frameset>");
}


function disclaimer(){
	window.open("disclaimer.html", null, "width=500, height=325 ,status=no,"+"toolbar=no, menubar=no,location=no");
}


function internalLink(link, topic, name){
	if ((name!="x")&&(link!='x')&&(topic!='x')){
		document.write("<table border=2 align=center bgcolor=white><tr><td class='N'><a href= '"+link+"' ");
		document.write("alt='222'><font size='2' color='darkblue'>For more information about <font color='blue'>"+topic+"</font> see <font color='green'>\""+name+"\"</font></font>");
		document.write("</td></tr></table>");
	}
}


