function gebi(objID){		     	     /* gebi */
	//getElementById for various browsers
	return document.getElementById ? document.getElementById(objID) : document.all ? document.all[objID] : "";
}

function topOfPage(head1,head2){		/* topOfPage */
document.write(
'<div  style="margin:-10 -30px 0 -245px;padding:0;">'
+'<img src=OMRI.gif width=100% alt="Online Masonic Research Institute banner"></div>'
/*+'<img src=NMLoRBannerGlow.jpg width=100% alt="New Mexico Lodge of Research banner"></div>'*/
+'<h2 style="font-family:arial,sans-serif;margin:0 20% 0 0;text-align:left;background-color:'+mgbg+';color:'+mgtx+';">'
+head1
+'</h2><hr><h3 style="font-family:\'times new roman\',serif;margin:0 0 40px 0;text-align:right;font-style:italic;background-color:'+mgbg+';color:'+mgtx+';">'
+head2
+'</h3>'
)}

function leftOfPage(){				/* leftOfPage */
	document.write(""
	+'<table id="navMenu" style="position:absolute;margin-top:25;margin-left:10" border=0 width=135 cellspacing=0 cellpadding=0>'
	+'	<tr><td style="background-color:'+trbg+';color:'+trtx+'">'
	+'		<b> Navigation</b>'
	+'	</td></tr><tr><td style="background-color:'+pgbg+';padding:10">'
	+'		<h5 align="left" style=margin-bottom:0>'
	+'		<a href="index.html">Home</a><br>'
	+'		<a href="customize.htm">Personalize</a><br>'
/*	+'		<a href="http://nmlodgeofresearch.org/default.aspx">Opening Page</a></h5>'
	+'		<a href="http://nmlodgeofresearch.org/public/trestleboard.aspx"><s>Trestleboard</s></a> UD<br>'
	+'		<a href="http://nmlodgeofresearch.org/public/blog.aspx"><s>Blog</s></a> UD<br>'
	+'		<a href="http://nmlodgeofresearch.org/public/publications.aspx"><s>Papers</s></a> UD<br>'
	+'		<a href="http://nmlodgeofresearch.org/public/links.aspx"><s>Links</s></a> UD<br>'
*/	+'		<a href="Chat.htm">Chat Box</a><br>'
	+'		<a href="MasonicForums.htm">Index: Forums</a><br>'
	+'		<a href="MailLists.htm">Index: Mail Lists</a><br>'
	+'		<a href="Sources.htm">Index: STBs</a><br>'
	+'		<a href="Sources2.htm">Index: The Builders</a><br>'
	+'		<a href="WebsiteReport.htm">Report: Website Dev.</a><hr>'
	+'		<a href="http://nmmasons.org/index_files/page0001.htm" target=fun>New Mexico GL</a><br>'
	+'		<a href="http://nmlodgeofresearch.org" target=fun>New Mexico LoR</a><br>'
	+'		<a href="http://cerrillos.org/fun.htm" target=fun>Fun &amp; Games</a></h5>'
	+'		<tr><td style=background-color:'+atx+';font-size:x-small;text-align:center>'
	+'		<a href="Illuminati.htm">ILLUMINATI AUTHORIZED VIEWERS ONLY</a>'
	+'	</td></tr>'
	+'</table>'
	)
	function ml(id){
		var el=gebi(id)
		el.sP=function(x,y){this.style.left=x;this.style.top=y}
		el.x=0
		el.y=0
		return el
	}
	window.stayTopLeft=function(){
		navigator.appName=="Netscape" ? pY=pageYOffset : pY=document.body.scrollTop
		ftlObj.y+=Math.ceil(pY-ftlObj.y)
		ftlObj.sP(ftlObj.x, ftlObj.y)
		setTimeout("stayTopLeft()", 50)
	}
	ftlObj = ml("navMenu")
	stayTopLeft()
}

function endOfPage(){					/* endOfPage */
document.write(
	'<br><br>'
	+'<h6 align=right>End of file <a>'+document.URL+'</a> last Updated: '+document.lastModified
	/*+'<br>See the webmaster\'s personal website at <a href=http://moneytalks.thewebcomic.com>Money Talks</a>.</h6>'*/
)}

function setCookie(name,value,dte){		/* setCookie */
	//Third parameter is optional. dte=days till expiration; defaults to 90 days
	expires=new Date()
	expires.setTime(expires.getTime()+ 86400000*(dte ? dte : 90))	//86400000=milliseconds in 1 day
	document.cookie=name+"="+escape(value)+"; expires="+expires.toUTCString() //+"; path=/~owenkl/Cerrillos/; domain=home.comcast.net;"
}

function getCookie(name,defalt) {			/* getCookie */
	//optional second argument will return if not found, otherwise return string contains null if cookie doesn't exist
	dc=document.cookie
	prefix=name+"="
	begin=dc.indexOf("; "+prefix)				//find exact match
	if(begin==-1){								//if not found
		begin=dc.indexOf(prefix)				//check first item
		if(begin != 0){	return defalt }			//if not there either return default or null
	}else{begin+=2}								//skip "; " (unless it was first cookie)
	end=dc.indexOf(";", begin);					//end at start of next cookie
	if(end==-1){ end=dc.length }				//...unless this is the final cookie
	return unescape(dc.substring(begin+prefix.length, end));	//return string contains value of cookie
}

function schemeSelect(color){
	bgScheme=color
	setCookie("ColorScheme",color,730)
//	setCookie("Find","Etaoin-1",5)
	history.go(0)
}

//pg=page mg=margin tr=trim (menu head) a=anchor (menu foot) tx=text color bg=background color
// 000=black; 227=dk.blue; 357=slate; 960=brown; cff=lt.blue; faa=pink; ffd=lt.tan; fff=white

bgScheme=getCookie("ColorScheme","D")
switch(bgScheme){
	case "B":pgtx="#000"; pgbg="#cff"; mgbg="#227"; mgtx="#fff"; trbg="cyan";	trtx="000"; atx="a60"; break
	case "H":pgtx="#fff"; pgbg="#000"; mgbg="#227"; mgtx="#fff"; trbg="#ffd";	trtx="000"; atx="cff"; break
	case "W":pgtx="#000"; pgbg="#fff"; mgbg="#ffd"; mgtx="#227"; trbg="#357";	trtx="fff"; atx="a60"; break
	default: pgtx="#000"; pgbg="#ffd"; mgbg="#960"; mgtx="#ffd"; trbg="#357";	trtx="ffd"; atx="a60"; bgScheme="D";
}

document.writeln('<style>'
+'	body,p,p.note,dl,dd,dt,div,li,h1,h2,h3,h4,tr,table,ul,ol,blockquote {'
+'		background-color:'+pgbg+';'
+'		color:'+pgtx+';'
+'		border-color:'+trbg+';'
+'	}'
+'	body {'
+'		background-color:'+mgbg+';'
+'	}'
+'	a		{color:'+atx+';text-decoration:none;}'
+'	a:link	{color:'+atx+';text-decoration:underline;}'
+'	a:visited	{color:'+atx+';text-decoration:none;}'
+'	a:hover	{color:#faa;text-decoration:underline;}'
+'	</style>')

