// Clemmons Order of the Eastern Star



var BannerArray = new Array();
BannerArray[0]="Thanks for visiting the Clemmons Masonic Lodge Home Page.";
BannerArray[1]="We hope you enjoyed your visit and will come back soon!";
BannerArrayIndex=0;

var StarHistory = "<BR>The Order of the Eastern Star is an adoptive rite of Freemasonry with teachings based on the Bible and objectives that are charitable and benevolent. The founder of OES was Dr. Robert Morris, a lawyer and educator from Boston, Massachusetts, who was a Master Mason and Past Grand Master of Kentucky. Dr. Morris intended his creation to become a female branch of Freemasonry, but he failed to overcome the great opposition this idea engendered. After his first published ritual in 1849-50, he became associated with Robert Macoy who wrote and published a ritual based on Morris' in 1867. The first Grand Chapter was organized in Michigan in the same year. (There is evidence for an organization of the same name founded variously in 1788 or 1793, but this group was defunct by 1867.) Subordinate (local) chapters operate under charter from state level grand chapters which are responsible to the General Grand Chapter at the International Eastern Star temple in Washington, D.C.";
var ChapterHistory = "<BR>The Clemmons Chapter of The Order of the Eastern Star was instituted on April 8, 1989, was constituted on June 30, 1990 and has remained active since that date.";
var PurposeStatement = "<IMG SRC=\"images/eaststar.gif\"><BR><b>Our Purpose:</b><BR>The stated purposes of the organization are: Charitable, Educational, Fraternal and Scientific; but there is much more to it than that. Dr. Rob Morris, the Poet Laureate of Masonry, founded the Order using beautiful and inspiring biblical examples of heroic conduct and moral values. These portray the noble principles which should adorn the personal lives of Eastern Star members. Eastern Star strives to take good people and through uplifting and elevating associations of love and service, and through precept and example, build an Order which is truly dedicated to charity, truth and loving kindness.";

function Initialize()
{
   CurrentContent = 'currentevents';
   window.defaultStatus = 'ClemmonsOES.org';
   ResetBlocks();
}

function ScrollBanner() 
{
   var CurrentBanner = document.forms.Banner.Message.value;
   
   

   if (CurrentBanner.length < BannerMessage.length)
   {
      document.forms.Banner.Message.value = BannerMessage.substring(0, CurrentBanner.length + 1);
   }
   else
   {
      document.forms.Banner.Message.value = "";
      BannerArrayIndex++;
      BannerMessage = BannerArray[BannerArrayIndex % BannerArray.length];
   }
   if (CurrentBanner.length + 1 == BannerMessage.length)
   {
      timerID = setTimeout("scrollBanner()", 5000);
   }
   else
   {
      timerID = setTimeout("scrollBanner()", 100);
   }

}

function MessageWindow(title, height, width, message) 
{
   var win = window.open("", "", "top=" + (screen.height-height)/2 + ",left=" + (screen.width-width)/2 + ",height=" + height + ",width=" + width)
   win.document.open()
   var text = ""
   text += "<HTML><HEAD><TITLE>" + title + "</TITLE><LINK REL='STYLESHEET' HREF='popstyle.css' TYPE='text/css'></HEAD><BODY><CENTER>"
   text += message + "</CENTER><FORM><CENTER>"
   text += "<INPUT TYPE='button' VALUE='    OK    ' onClick='self.close()'>"
   text += "</CENTER></FORM></BODY></HTML>"
   win.document.write(text)
   win.document.close()
}

function GraphicMessageWindow(title, height, width, message, graphic) 
{
   var win = window.open("", "", "top=" + (screen.height-height)/2 + ",left=" + (screen.width-width)/2 + ",height=" + height + ",width=" + width)
//   var win = window.open("", "", "height=" + height + ",width=" + width)
   win.document.open()
   var text = ""
   text += "<HTML><HEAD><TITLE>" + title + "</TITLE><LINK REL='STYLESHEET' HREF='popstyle.css' TYPE='text/css'></HEAD><BODY>"
   text += "<FORM><CENTER><TABLE><TR><TD align='center'>" + message + "</TD><TD><IMG SRC='" + graphic + "'></TD></TR></TABLE>"
   text += "<INPUT TYPE='button' VALUE='    OK    ' onClick='self.close()'>"
   text += "</CENTER></FORM></BODY></HTML>"
   win.document.write(text)
   win.document.close()
}

function SelectMenuItem(menuItem, menuItemNumber)
{
	if (document.getElementById('selectedMenuItem') && this.id!='selectedMenuItem') 
	{
	   document.getElementById('selectedMenuItem').style.background=menuItem.style.background;
	   document.getElementById('selectedMenuItem').style.color=menuItem.style.color;
	   document.getElementById('selectedMenuItem').id='';
	} 
	menuItem.id='selectedMenuItem'; 
	menuItem.style.background='#FFFFFF';
	menuItem.style.color='#000000';
	for (var i = 0; i < menu.length; ++i)
	{
		menu[i].selected=false;
	}
	menu[menuItemNumber].selected=true;
}

function ShowContent(NewContent)
{
	 document.getElementById(CurrentContent).style.visibility='hidden';
	 document.getElementById(CurrentContent).style.display='none';
	 document.getElementById(NewContent).style.visibility='visible';
	 document.getElementById(NewContent).style.display='block';
	 CurrentContent = NewContent;
   ResetBlocks();
}

function ResetBlocks()
{
   document.getElementById('leftnav').style.height='auto';
   document.getElementById('center').style.height='auto';
   document.getElementById('right').style.height='auto';
   var maxHeight = (document.getElementById('leftnav').offsetHeight > (document.getElementById('center').offsetHeight > document.getElementById('right').offsetHeight ? document.getElementById('center').offsetHeight : document.getElementById('right').offsetHeight) ? document.getElementById('leftnav').offsetHeight : (document.getElementById('center').offsetHeight > document.getElementById('right').offsetHeight ? document.getElementById('center').offsetHeight : document.getElementById('right').offsetHeight))
   document.getElementById('footer').style.top=(document.getElementById('leftnav').offsetHeight > (document.getElementById('center').offsetHeight > document.getElementById('right').offsetHeight ? document.getElementById('center').offsetHeight : document.getElementById('right').offsetHeight) ? document.getElementById('leftnav').offsetHeight + document.getElementById('header').offsetHeight : (document.getElementById('center').offsetHeight > document.getElementById('right').offsetHeight ? document.getElementById('center').offsetHeight : document.getElementById('right').offsetHeight) + document.getElementById('header').offsetHeight);
   document.getElementById('leftnav').style.height=(maxHeight)+'px';
   document.getElementById('center').style.height=(maxHeight)+'px';
   document.getElementById('right').style.height=(maxHeight)+'px';
}

function menuItem(parent, attributes, text, depth, state) {
// constructor function to create a menu entry (parent or child)
	this.parent = parent; // is this item a parent?
	this.attributes = attributes; //attributes for the area tag
	this.text = text; // text for link (may include HTML)
	this.depth = depth; // nested depth
	this.state = state; // display or not?
}

function makeArray(length) {
// constructor function to create array (compatible with all browsers)
	this.length = length // length of array (integer)
}

function makeMenu() {
// create items of menu
	menu = new makeArray(40) // create global object

	// create items in menu
	menu[0] = new menuItem(false, 'ONCLICK="SelectMenuItem(this, 0);ShowContent(\'currentevents\');" HREF="#"', 'Current Events', 0, true);
	menu[1] = new menuItem(true, 'ID="menutoggle" HREF="javascript:toggle(1)"', 'Officers', 0, true);
	menu[2] = new menuItem(false, 'ONCLICK="SelectMenuItem(this, 2);ShowContent(\'wminfo\');" HREF="#"','Worthy Matron', 1, false);
	menu[3] = new menuItem(false, 'ONCLICK="SelectMenuItem(this, 3);ShowContent(\'wpinfo\');" HREF="#"','Worthy Patron', 1, false);
	menu[4] = new menuItem(false, 'ONCLICK="SelectMenuItem(this, 4);ShowContent(\'aminfo\');" HREF="#"','Assoc. Matron', 1, false);
	menu[5] = new menuItem(false, 'ONCLICK="SelectMenuItem(this, 5);ShowContent(\'apinfo\');" HREF="#"','Assoc. Patron', 1, false);
	menu[6] = new menuItem(false, 'ONCLICK="SelectMenuItem(this, 6);ShowContent(\'secretaryinfo\');" HREF="#"','Secretary', 1, false);
	menu[7] = new menuItem(false, 'ONCLICK="SelectMenuItem(this, 7);ShowContent(\'treasurerinfo\');" HREF="#"','Treasurer', 1, false);
	menu[8] = new menuItem(false, 'ONCLICK="SelectMenuItem(this, 8);ShowContent(\'conductressinfo\');" HREF="#"','Conductress', 1, false);
	menu[9] = new menuItem(false, 'ONCLICK="SelectMenuItem(this, 9);ShowContent(\'acinfo\');" HREF="#"','Assoc. Conductress', 1, false);
	menu[10] = new menuItem(false, 'ONCLICK="SelectMenuItem(this, 10);ShowContent(\'marshallinfo\');" HREF="#"','Marshall', 1, false);
	menu[11] = new menuItem(false, 'ONCLICK="SelectMenuItem(this, 11);ShowContent(\'chaplaininfo\');" HREF="#"','Chaplain', 1, false);
	menu[12] = new menuItem(false, 'ONCLICK="SelectMenuItem(this, 12);ShowContent(\'warderinfo\');" HREF="#"','Warder', 1, false);
	menu[13] = new menuItem(false, 'ONCLICK="SelectMenuItem(this, 13);ShowContent(\'sentinelinfo\');" HREF="#"','Sentinel', 1, false);
	menu[14] = new menuItem(false, 'ONCLICK="SelectMenuItem(this, 14);ShowContent(\'organistinfo\');" HREF="#"','Organist', 1, false);
	menu[15] = new menuItem(false, 'ONCLICK="SelectMenuItem(this, 15);ShowContent(\'adahinfo\');" HREF="#"','Adah', 1, false);
	menu[16] = new menuItem(false, 'ONCLICK="SelectMenuItem(this, 16);ShowContent(\'ruthinfo\');" HREF="#"','Ruth', 1, false);
	menu[17] = new menuItem(false, 'ONCLICK="SelectMenuItem(this, 17);ShowContent(\'estherinfo\');" HREF="#"','Esther', 1, false);
	menu[18] = new menuItem(false, 'ONCLICK="SelectMenuItem(this, 18);ShowContent(\'marthainfo\');" HREF="#"','Martha', 1, false);
	menu[19] = new menuItem(false, 'ONCLICK="SelectMenuItem(this, 19);ShowContent(\'electainfo\');" HREF="#"','Electa', 1, false);
	menu[20] = new menuItem(true, 'ID="menutoggle" HREF="javascript:toggle(20)"', 'Past Matrons /<BR><IMG SRC="images/spacer.gif" BORDER="0">Past Patrons', 0, true);
	menu[21] = new menuItem(false, 'HREF="javascript:void(window.open(\'pm2000to2004.html\', \'\', \'top=' + (screen.height-500)/2 + ',left=' + (screen.width-625)/2 + ',height=500 ,width=625,scrollbars=yes,resizable=yes\'))"','2000-2004', 1, false);
	menu[22] = new menuItem(false, 'HREF="javascript:void(window.open(\'pm1990to1999.html\', \'\', \'top=' + (screen.height-500)/2 + ',left=' + (screen.width-625)/2 + ',height=500 ,width=625,scrollbars=yes,resizable=yes\'))"','1990-1999', 1, false);
	menu[23] = new menuItem(false, 'HREF="javascript:void(window.open(\'pm1980to1989.html\', \'\', \'top=' + (screen.height-500)/2 + ',left=' + (screen.width-625)/2 + ',height=500 ,width=625,scrollbars=yes,resizable=yes\'))"','1980-1989', 1, false);
	menu[24] = new menuItem(false, 'HREF="javascript:void(window.open(\'pm1970to1979.html\', \'\', \'top=' + (screen.height-500)/2 + ',left=' + (screen.width-625)/2 + ',height=500 ,width=625,scrollbars=yes,resizable=yes\'))"','1970-1979', 1, false);
	menu[25] = new menuItem(true, 'ID="menutoggle" HREF="javascript:toggle(25)"', 'About Us', 0, true);
	menu[26] = new menuItem(false, 'HREF="javascript:MessageWindow(\'Star History\', 300, 550, StarHistory)"','Star History', 1, false);
	menu[27] = new menuItem(false, 'HREF="javascript:MessageWindow(\'Chapter History\', 130, 450, ChapterHistory)"','Chapter History', 1, false);
	menu[28] = new menuItem(false, 'HREF="javascript:MessageWindow(\'Our Purpose\', 520, 600, PurposeStatement)"','Our Purpose', 1, false);
	menu[29] = new menuItem(true, 'ID="menutoggle" HREF="javascript:toggle(29)"', 'Contact Us', 0, true);
	menu[30] = new menuItem(false, 'HREF="mailto:wm@clemmonsoes.org"','Email the Worthy Matron', 1, false);
	menu[31] = new menuItem(false, 'HREF="mailto:wp@clemmonsoes.org"','Email the Worthy Patron', 1, false);
	menu[32] = new menuItem(false, 'HREF="mailto:secretary@clemmonsoes.org"','Email the Secretary', 1, false);
	menu[33] = new menuItem(false, 'HREF="mailto:webmaster@clemmonsoes.org"','Email the Webmaster', 1, false);
	menu[34] = new menuItem(true, 'ID="menutoggle" HREF="javascript:toggle(34)"', 'Links', 0, true);
	menu[35] = new menuItem(false, 'HREF="javascript:void(window.open(\'http://www.oes-nc.org\', \'\', \'top=0,left=' + (screen.width-800)/2 + ',height=600,width=800,location=yes,menubar=yes,resizable=yes,status=yes,toolbar=yes,scrollbars=yes\'))"','N.C. Order of the<br>Eastern Star', 1, false);
	menu[36] = new menuItem(false, 'HREF="javascript:void(window.open(\'http://www.mhc-oxford.org\', \'\', \'top=0,left=' + (screen.width-800)/2 + ',height=600,width=800,location=yes,menubar=yes,resizable=yes,status=yes,toolbar=yes,scrollbars=yes\'))"','Masonic Home<br>for Children<br>at Oxford', 1, false);
	menu[37] = new menuItem(false, 'HREF="javascript:void(window.open(\'http://www.meshhome.org\', \'\', \'top=0,left=' + (screen.width-800)/2 + ',height=600,width=800,location=yes,menubar=yes,resizable=yes,status=yes,toolbar=yes,scrollbars=yes\'))"','Masonic and<br>Eastern Star<br>Home', 1, false);
	menu[38] = new menuItem(false, 'HREF="javascript:void(window.open(\'http://www.clemmonsmasoniclodge.com\', \'\', \'top=0,left=' + (screen.width-800)/2 + ',height=600,width=800,location=yes,menubar=yes,resizable=yes,status=yes,toolbar=yes,scrollbars=yes\'))"','Clemmons<BR>Masonic Lodge', 1, false);
	menu[39] = new menuItem(false, 'HREF="http://www.grandlodge-nc.org" TARGET="_blank"','Grand Lodge of<br>North Carolina', 1, false);

  //select the Current Events Menu Item
  menu[0].selected=true
	// set image for each item (only items with true state)
	setImages()
}

function setImages() {
	// loop through all elements of the menu "array" (object)
	for (var i = 0; i < menu.length; ++i) {
		if (menu[i].state)
			if (menu[i].parent) // menu[i] is a parent
				if (menu[i + 1].state) // menu[i] is exploded
					menu[i].pic = '<IMG SRC="images/collapse.gif" HEIGHT="15px" WIDTH="15px" BORDER="0" TITLE="Collapse">'
				else // menu[i] is collapsed
					menu[i].pic = '<IMG SRC="images/expand.gif" HEIGHT="15px" WIDTH="15px" BORDER="0" TITLE="Expand">'
			else // menu[i] is only a child (not a parent)
				menu[i].pic = '' //'<FONT SIZE="+1">*</FONT>'
	}
}

function toggle(num) {
// change from expanded to collapsed and vice versa
	// loop starts at item following argument
	// terminate loop when:
	//   a) last element of menu "array" reached
	//   b) current item (menu[i]) is not deeper than toggled item (menu[num])
	for (var i = num + 1; i < menu.length && menu[i].depth >= menu[num].depth + 1; ++i) {
		// if current item (menu[i]) is a direct child of menu[num]
		if (menu[i].depth == menu[num].depth + 1)
			menu[i].state = !menu[i].state // toggle state
	}
	setImages()
	// rewrite the menu
	writeMenu()
}

function writeMenu(){
var newMenu = new String
var previousDepth = 0
newMenu += '<ul ID="mainnav">'

// loop through elements of menu "array"
for (var i = 0; i < menu.length; ++i) {
	// if current item's state is true
	if (menu[i].state) {
		if (menu[i].depth > previousDepth){
			newMenu += '<ul ID="subnav">'}
		if (menu[i].depth < previousDepth){
			newMenu += '</ul>'}
		newMenu += '<li>'

		// follow indentation with picture, another space, text, and new line
		newMenu += '<A '+menu[i].attributes
		if (menu[i].selected){
			newMenu += 'ID="selectedMenuItem"'}
		newMenu += '>'+menu[i].pic+menu[i].text+'</A></li>'
		previousDepth = menu[i].depth
	} else {
		// current item's state is false (skip all its children)
		var previous = i
		for (var k = i + 1; k < menu.length && menu[k].depth >= menu[previous].depth; ++k) {
			++i
		}
	}
}

// end <PRE> to return to normal formatting
newMenu += '</ul>'
document.getElementById('leftnav').innerHTML = newMenu;
if (document.getElementById('selectedMenuItem'))
{
   document.getElementById('selectedMenuItem').style.background='#FFFFFF';
	 document.getElementById('selectedMenuItem').style.color='#000000';
}
ResetBlocks();
}


