//=======================This opening is not a function. It happens with every page 
hotID="a"
bgScheme=getCookie("ColorScheme","Tan")
algScheme=getCookie("AlignmentScheme","justify")
switch(bgScheme){
	case "Tan"	:pbgc="#edc";bbgc="#fed";fgc="#000";break	//e2d6c0
	case "Green"	:pbgc="#dfb";bbgc="#be8";fgc="#000";break	//baf190
	case "Red"	:pbgc="#fde";bbgc="#fef";fgc="#000";break 	//fcb7e4
	case "White"	:pbgc="#fff";bbgc="#ddd";fgc="#000";break	//e3e3e3
	case "Black"	:pbgc="#000";bbgc="#555";fgc="#fff";break
	case "Blood"	:pbgc="#000";bbgc="#666";fgc="#f00";break
	default		:pbgc="#bdf";bbgc="#cef";fgc="#000";bgScheme="Blue";break	//aad1fc
}

document.writeln('<style>'
+'	body{'
+'		background-color:'+bbgc+';'
+'		background-image:url(bg'+bgScheme+'.gif);'
+'	}'
+'	p,p.note,dl,dd,dt,li,h1,h2,h3,h4,td,table,ul,ol,blockquote {'
+'		background-color:'+pbgc+';'
+'		color:'+fgc+';'
+'	}'
+'	dl,.end{'
+'		text-align:'+algScheme+';'
+'	</style>'
+'<body onkeyup="hotkey(event);">'
)

//===============================================================================

function subBox(num){
document.writeln(
'	<form name="signup" action="http://groups.google.com/group/mpoets/boxsubscribe" method="get">'
+'		<img id=logo'+num+' src=MPS200x200.gif height=100 style="float:left" onmouseover="exchng(this.id);">'
+'		<a rel=license href="http://creativecommons.org/licenses/by-nc-sa/3.0/">'
+'			<img alt="Creative Commons License" border=0 src=somerights20.png style="float:right"></a>'
+'		<table border="0" cellspacing="0" cellpadding="5" width="200" style="margin-bottom:0;">'
+'			<tr><td align=center nowrap style="text-align:center;font-family:arial,helvetica;font-size:small;color:#000000;background-color:#cf0">'
+'				<a href="http://groups.google.com/group/mpoets" target="google">Information</a>'
+'				or free subscription to our MPoets Newsletter<br>'
+'				<div style="text-align:left;font-family:arial,helvetica;font-size:x-small;color:#000000">'
+'				Enter your email address:</div>'
+'				<input name="email" type="text" size=30>&nbsp;'
+'				<input name="joingroup" type="image" align="absmiddle" alt="Click Here To Join!" src="SubButton.gif" border="0" height="32" >'
+'				<input type="hidden" name="sub" value="Subscribe"><br>'
+'			</td></tr>'
+'		</table>'
+'	</form>'
)}

function navBarOld(){
document.writeln(
'	<hr size=12 color=tan onclick=window.location="index.html">'
+'	<form style="margin-top:0;" >'
+'		<input type=button value="Press to Return from Whence You Came ..." onclick=history.back()'
+'			 title="Press to Return from Whence You Came" alt="Press to Return from Whence You Came"> '
+'		<input value="Press for More Light" onclick=window.location="http://masonic-poets-society.com/index.html" type=button'
+'			 title="Press for More Masonic Poets" alt="Press for More Masonic Poets">'
+'		<input value="Customize" onclick=window.open("Customization.htm","custom",'
+'"directories=no,location=no,menubar=no,status=no,toolbar=no,width=600,scrollbars=yes,resizable=yes")'
+'			type=button title="Customize this site\'s appearance" alt="Customize this site\'s appearance">'
+'	</form><br>'
)}

function navBar(){
document.writeln(
'	<hr class=navBar color=tan onclick=window.location="index.html">'
+'		<button title="Return from Whence You Came" onclick=history.back()>Press to Return from Whence You Came ...</button>&nbsp;'
+'		<button title="More Masonic Poets" onclick=window.location="http://masonic-poets-society.com/index.html">Press for More Light</button>&nbsp;'
+'		<button title="Customize this site\'s appearance" onclick=window.open("Customization.htm","custom",'
+'"directories=no,location=no,menubar=no,status=no,toolbar=no,width=600,scrollbars=yes,resizable=yes")>'
+'Customize</button><br><br>'
)}

function aalphabet(file){			/*authors--used only on index pages*/
if(file==undefined)file=""
document.writeln(
'<p class=c style="padding:5px;background-color:#cf0;"><a'
+' href='+file+'#top	title="Table of Contents">Authors</a><a'
+' href=index.html		title="Authors Index"><b>.</b></a><a'
+' href=FirstLines.htm	title="First Lines Index">·</a><a'
+' href=TitleIndex.htm	title="Titles Index"><b>.</b></a>|<a'
+' href='+file+'#aa>A</a>|<a'
+' href='+file+'#ab>B</a>|<a'
+' href='+file+'#ac>C</a>|<a'
+' href='+file+'#ad>D</a>|<a'
+' href='+file+'#ae>E</a>|<a'
+' href='+file+'#af>F</a>|<a'
+' href='+file+'#ag>G</a>|<a'
+' href='+file+'#ah>H</a>|<a'
+' href='+file+'#ai>I</a>|<a'
+' href='+file+'#aj>J</a>|<a'
+' href='+file+'#ak>K</a>|<a'
+' href='+file+'#al>L</a>|<a'
+' href='+file+'#am>M</a>|<a'
+' href='+file+'#an>N</a>|<a'
+' href='+file+'#ao>O</a>|<a'
+' href='+file+'#ap>P</a>|Q|<a'
+' href='+file+'#ar>R</a>|<a'
+' href='+file+'#as>S</a>|<a'
+' href='+file+'#at>T</a>|U|<a'
+' href='+file+'#av>V</a>|<a'
+' href='+file+'#aw>W</a>|X|Y|Z|'
+'</p>')
}

function falphabet(file){			/*First Lines--used only on index pages*/
if(file==undefined)file=""
document.writeln(
'<p class=c style="padding:5px;background-color:#cf0;"><a'
+' href='+file+'#top	title="Table of Contents">First Lines</a><a'
+' href=index.html		title="Authors Index"><b>.</b></a><a'
+' href=FirstLines.htm	title="First Lines Index">·</a><a'
+' href=TitleIndex.htm	title="Titles Index"><b>.</b></a>|<a'
+' href='+file+'#fa>A</a>|<a'
+' href='+file+'#fb>B</a>|<a'
+' href='+file+'#fc>C</a>|<a'
+' href='+file+'#fd>D</a>|<a'
+' href='+file+'#fe>E</a>|<a'
+' href='+file+'#ff>F</a>|<a'
+' href='+file+'#fg>G</a>|<a'
+' href='+file+'#fh>H</a>|<a'
+' href='+file+'#fi>I</a>|<a'
+' href='+file+'#fj>J</a>|<a'
+' href='+file+'#fk>K</a>|<a'
+' href='+file+'#fl>L</a>|<a'
+' href='+file+'#fm>M</a>|<a'
+' href='+file+'#fn>N</a>|<a'
+' href='+file+'#fo>O</a>|<a'
+' href='+file+'#fp>P</a>|Q|<a'
+' href='+file+'#fr>R</a>|<a'
+' href='+file+'#fs>S</a>|<a'
+' href='+file+'#ft>T</a>|<a'
+' href='+file+'#fu>U</a>|V|<a'
+' href='+file+'#fw>W</a>|X|<a'
+' href='+file+'#fy>Y</a>|Z|'
+'</p><p class=l style=\'margin:0 "";\'>')
}

function talphabet(file){			/*titles--used only on index pages*/
if(file==undefined)file=""
document.writeln(
'<p class=c style="padding:5px;background-color:#cf0;"><a'
+' href='+file+'#top	title="Table of Contents">Titles</a><a'
+' href=index.html		title="Authors Index"><b>.</b></a><a'
+' href=FirstLines.htm	title="First Lines Index">·</a><a'
+' href=TitleIndex.htm	title="Titles Index"><b>.</b></a>|<a'
+' href='+file+'#ta>A</a>|<a'
+' href='+file+'#tb>B</a>|<a'
+' href='+file+'#tc>C</a>|<a'
+' href='+file+'#td>D</a>|<a'
+' href='+file+'#te>E</a>|<a'
+' href='+file+'#tf>F</a>|<a'
+' href='+file+'#tg>G</a>|<a'
+' href='+file+'#th>H</a>|<a'
+' href='+file+'#ti>I</a>|<a'
+' href='+file+'#tj>J</a>|<a'
+' href='+file+'#tk>K</a>|<a'
+' href='+file+'#tl>L</a>|<a'
+' href='+file+'#tm>M</a>|<a'
+' href='+file+'#tn>N</a>|<a'
+' href='+file+'#to>O</a>|<a'
+' href='+file+'#tp>P</a>|<a'
+' href='+file+'#tq>Q</a>|<a'
+' href='+file+'#tr>R</a>|<a'
+' href='+file+'#ts>S</a>|<a'
+' href='+file+'#tt>T</a>|<a'
+' href='+file+'#tu>U</a>|<a'
+' href='+file+'#tv>V</a>|<a'
+' href='+file+'#tw>W</a>|X|<a'
+' href='+file+'#tx>Y</a>|Z|'
+'</p><p class=l style=\'margin:0 "";\'>')
}

function footer(){
	document.writeln("<h6 align=right>End of file <span style='color:blue'>",
	document.URL+"</span>, last Updated:",document.lastModified,"</h6>")
	}

function gebi(objID){		     	     /* gebi */
	//getElementById for various browsers
	return document.getElementById ? document.getElementById(objID) : document.all ? document.all[objID] : "";
}

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()
}

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 exchng(tid){
	if(gebi(tid).src.slice(-14)!="MPS200x200.gif"){
	gebi(tid).src="MPS200x200.gif"
	}else{
	gebi(tid).src="MPS212x200.gif"
	}
}

function exchang(thisID,thatID){
	if(gebi(thisID).style.display=="none"){
		gebi(thisID).style.display="inline"
		gebi(thatID).style.display="none"
	}else{
		gebi(thisID).style.display="none"
		gebi(thatID).style.display="inline"
	}
}

function schemeSelect(color){
	bgScheme=color
	setCookie("ColorScheme",color,370)
	history.go(0)
}
function alignSelect(algn){
	algScheme=algn
	setCookie("AlignmentScheme",algn,370)
	history.go(0)
}

function hotkey(event){
	if(event.altKey){
	key=event.keyCode
	if(key==65 || key==97 || key==76 || key==108){	//A or a or L or l (A is already pre-empted in IE)
		if(algScheme=="center")alignSelect("left")
		else alignSelect("center")
	}
	else if(key==67 || key==99){	//C or c
		switch(bgScheme){
			case "White"	:schemeSelect("Black");break
			case "Black"	:schemeSelect("Blood");break
			case "Blood"	:schemeSelect("Tan");break
			case "Tan"	:schemeSelect("Green");break
			case "Green"	:schemeSelect("Red");break
			case "Red"	:schemeSelect("Blue");break
			default		:schemeSelect("White");
		}
	}
	else if(key==87 || key==119){	//W or w
		schemeSelect("White")
	}
	}
}
	
function CDetect(content){document.writeln(''
+'<table style="width:150px;margin:auto 0 auto 0">	'
+'	<tr><td class="s c" style="background-color:#999;color:white;" colspan=2>	'
+'		Notify me when '+content+' is added	'
+'	<tr><td class="xs r" valign=top colspan=2>	'
+'		<form action="http://www.ChangeDetection.com/detect.html" method="get" target=CD>	'
+'		<input style="width:100%;" type="text" name="email"  value="enter email">	'
+'	<tr><td>	'
+'		<input type="submit" name="enter" value=" OK " onclick="somewin=window.open("http://www.ChangeDetection.com/page.html", "CD","resizable=yes,scrollbars=yes,width=624,height=460");somewin.focus()">	'
+'		</form>	'
+'	<td class="xs r">	'
+'		<a href="http://www.ChangeDetection.com/privacy.html" target=CD onclick="somewin=window.open("http://www.ChangeDetection.com/privacy.html", "CD","resizable=yes,scrollbars=yes,width=624,height=390");somewin.focus()">	'
+'		it\'s private</a>	'
+'	<tr style="hei ght:28px;"><td class="xs c" colspan=2>	'
+'	powered by<br><a  href="http://www.ChangeDetection.com/" target=CD>ChangeDetection</a>	'
+'</table>	')
}

function YSearch(){
document.writeln('<!-- START CODE -->'
+'	<div id="ysrchForm" style="border:1px solid #8AB;	'
+'						 width:100%;				'
+'						 margin:0 auto;			'
+'						 padding:2px 2px 20px 2px; 			'
+'						 position:relative;">		'
+'	<div class="s c" style="background-color:#999;color:white;text-align:left;padding-left:10px;">	'
+'		<br>Search for this word or phrase:<br><br></div>'
+'	<form id="searchBoxForm_U0bf6114900df5653af61" style="padding:0;" action="http://builder.search.yahoo.com/a/bouncer">		'
+'		<input type="hidden" name="mobid"	value="U0bf6114900df5653af61">'
+'		<input type="hidden" name="ei" 	value="UTF-8">	'
+'		<input type="hidden" name="fr" 	value="ystg-c">'
+'		<div style="padding:0 10px 0 0;zoom:1;">		'
+'			<input type="text" name="p" id="searchTerm"'
+'					onFocus="this.style.background=\'#fff\';"'
+'					onBlur="if(this.value==\'\')this.style.background=\'#fff url(http://us.i1.yimg.com/us.yimg.com/i/us/sch/gr/horiz_pwrlogo_red2.gif) 3px center no-repeat\'"'
+'					style="margin:1px 0;width:100%;border:1px solid #7E9DB9; color:#666666;height:18px;padding:0px 3px; background:#fff 3px center no-repeat url(http://us.i1.yimg.com/us.yimg.com/i/us/sch/gr/horiz_pwrlogo_red2.gif); position:relative;">'
+'		</div>'
+'		<ul style="color:#666666;'
+'			font:11px/11px normal Arial, Helvetica, sans-serif;'
+'			margin:0;padding:0;		'
+'			text-align:left;		'
+'			list-style-type:none;">	'
+'		<li style="display:inline;padding-right:10px;">'
+'		<input name="mobvs" id="web_U0bf6114900df5653af61" value="0" onclick=\'displayPopSearch("web","U0bf6114900df5653af61");\'	type="radio" style="vertical-align:middle;margin-right:5px; ">'
+'		<label for="web_U0bf6114900df5653af61" style="display:inline;vertical-align:middle; padding-top:2px;">'
+'			Web</label>'
+'		<li style="display:inline;padding-right:10px;">'
+'		<input name="mobvs" id="site_U0bf6114900df5653af61" value="1" onclick=\'displayPopSearch("site","U0bf6114900df5653af61");\'	checked="checked" type="radio" style="vertical-align:middle;margin-right:5px; ">'
+'		<label for="site_U0bf6114900df5653af61" style="display:inline;vertical-align:middle; padding-top:2px;">'
+'			Masonic Poets Society site</label>'
+'		<li style="display:inline;padding-right:10px;">'
+'		<input type="submit" id="btn_U0bf6114900df5653af61" value="Search" '
+'			style="padding-bottom:2px;margin:0px;height:22px;width:65px;">'
+'		</ul></form></div>'
+'<!-- END CODE --> ')
}

/*function GSearch(){
document.writeln(''
+'<script src="http://gmodules.com/ig/ifr?url=http://www.google.com/coop/api/003788866548731145772/cse/omynh6cfcd4/gadget&amp;synd=open&amp;w=600&amp;h=75&amp;title=Masonic+Poetry+Search+Engine&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js"></script><h2>Special Sections</h2>'
)}*/