// JavaScript Document
function sfHoverEvents(sfEls) {
  var len = sfEls.length;
  for (var i=0; i<len; i++) {
    sfEls[i].onmouseover=function() {
      this.className+=" sfhover";
    }
    sfEls[i].onmouseout=function() {
      this.className=this.className.replace(" sfhover", "");
    }
  }
}
function sfHover() {
var ULs = document.getElementsByTagName("UL");
var len = ULs.length;
  for(var i=0;i<len;i++) {
    if(ULs[i].className.indexOf("sf-menu") != -1)
      sfHoverEvents(ULs[i].getElementsByTagName("LI"));
  }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

<!--//--><![CDATA[//><!--
mcAccessible = function() {
	var mcEls = document.getElementById("suckerfishnav").getElementsByTagName("A");
	for (var i=0; i<mcEls.length; i++) {
		mcEls[i].onfocus=function() {
			this.className+=(this.className.length>0? " ": "") + "sffocus"; //a:focus
			this.parentNode.className+=(this.parentNode.className.length>0? " ": "") + "sfhover"; //li < a:focus
			if(this.parentNode.parentNode.parentNode.nodeName == "LI") {
				this.parentNode.parentNode.parentNode.className+=(this.parentNode.parentNode.parentNode.className.length>0? " ": "") + "sfhover"; //li < ul < li < a:focus
				if(this.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName == "LI") {
					this.parentNode.parentNode.parentNode.parentNode.parentNode.className+=(this.parentNode.parentNode.parentNode.parentNode.parentNode.className.length>0? " ": "") + "sfhover"; //li < ul < li < ul < li < a:focus
				}
			}
		}
		mcEls[i].onblur=function() {
			this.className=this.className.replace(new RegExp("( ?|^)sffocus\\b"), "");
			this.parentNode.className=this.parentNode.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
			if(this.parentNode.parentNode.parentNode.nodeName == "LI") {
				this.parentNode.parentNode.parentNode.className=this.parentNode.parentNode.parentNode.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
				if(this.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName == "LI") {
					this.parentNode.parentNode.parentNode.parentNode.parentNode.className=this.parentNode.parentNode.parentNode.parentNode.parentNode.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
				}
			}
		}
	}
}

// only ie needs the sfHover script. all need the accessibility script...
// thanks http://www.brothercake.com/site/resources/scripts/onload/
if(window.addEventListener) window.addEventListener('load', mcAccessible, false); // gecko, safari, konqueror and standard
else if(document.addEventListener) document.addEventListener('load', mcAccessible, false); // opera 7
else if(window.attachEvent) { // win/ie
	window.attachEvent('onload', sfHover);
	window.attachEvent('onload', mcAccessible);
} else { // mac/ie5
	if(typeof window.onload == 'function') {
		var existing = onload;
		window.onload = function() {
			existing();
			sfHover();
			mcAccessible();
		}
	} else {
		window.onload = function() {
			sfHover();
			mcAccessible();
		}
	}
}

//--><!]]>

<!-- Begin
loadImage1 = new Image();
loadImage1.src = "graphics/rightarrow-greenonwhite.gif";
staticImage1 = new Image();
staticImage1.src = "graphics/rightarrow-ongreen.gif";
loadImage2 = new Image();
loadImage2.src = "graphics/rightarrow-greenonwhite.gif";
staticImage2 = new Image();
staticImage2.src = "graphics/rightarrow-ongreen.gif";
loadImage3 = new Image();
loadImage3.src = "graphics/rightarrow-greenonwhite.gif";
staticImage3 = new Image();
staticImage3.src = "graphics/rightarrow-ongreen.gif";

// End -->

function menu()	{
document.write("<ul id='suckerfishnav' class='sf-menu'>" +
"<li><a href='index.htm'>Home</a>" +
"	<ul>" +
"    <li><a href='index.htm'>Home</a></li>" +
"    <li><a href='about.htm'>About</a></li>" +
"    <li><a href='join.htm' onmouseover='image1.src=loadImage1.src;' onmouseout='image1.src=staticImage1.src;'>Join</a>" +
"        <ul>" +
"        <li><a href='join.htm'>Join</a></li>" +
"        <li><a href='WhyReenact.htm'>Why Reenact</a></li>" +
"        <li><a href='mailinglist.php'>Sign Up</a></li>" +
"        </ul>" +
"    <li><a href='contact.htm'>Contact Us</a>" +
"	 </li>" +
"    <li><a href='search.htm'>Search</a></li>" +
"    </ul>" +
"</li>" +
"<li><a href='events.htm'>Events</a>" +
"    <ul>" +
"    <li><a href='events.htm'>Events</a></li>" +
"    <li><a href='PatriotsDay.htm'>Patriots Day</a></li>" +
"    <li><a href='faire.htm'>Colonial Faire</a></li>" +
"    <li><a href='12thNiteBall.htm'>Twelfth Night Ball</a></li>" +
"    <li><a href='GrandBall.htm'>Grand Ball at the Redhorse Tavern</a></li>" +
"    <li><a href='redhorsetavern.htm'>Battle at the Redhorse Tavern</a></li>" +
"    <li><a href='Door_Duty.htm'>Door Duty</a></li>" +
"    <li><a href='EveningOrdinary.htm'>Ordinary Evening</a></li>" +
"    <li><a href='pastevents.htm' onmouseover='image2.src=loadImage2.src;' onmouseout='image2.src=staticImage2.src;'>Past Events</a>" +
"    	<ul>" +
"        <li><a href='redhorsetavern_2011.htm'>Battle of the Red Horse Tavern - 2011</a></li>" +
"        <li><a href='MemorialDay2011.htm'>Sudbury Memorial Day Parade - 2011</a></li>" +
"        <li><a href='redhorsetavern_2010_2.htm'>Battle of the Red Horse Tavern - 2010</a></li>" +
"        <li><a href='redhorsetavern_2010.htm'>Battle of the Red Horse Tavern - 2010</a></li>" +
"        <li><a href='faire-2010.htm'>Colonial Faire - 2010</a></li>" +
"        <li><a href='july 4 2010.htm'>Sudbury Fourth of July Parade - 2010</a></li>" +
"        <li><a href='march-2010.htm'>March to Concord - 2010</a></li>" +
"        <li><a href='gristmill-slides.htm'>80th Anniversary of the Grist Mill</a></li>" +
"        <li><a href='gristmill.htm'>80th Anniversary of the Grist Mill - video</a></li>" +
"       <li><a href='redhorsetavern_2009.htm'>Battle of the Red Horse Tavern - 2009</a></li>" +
"        <li><a href='skirmish_2009.htm'>Skirmish at 2009 Colonial Faire</a></li>" +
"        <li><a href='RegBall2009.htm'>Regimental Ball- 2009</a></li>" +
"        <li><a href='12thNightBall2009.htm'>Twelfth Night Ball - 2009</a></li>" +
"        <li><a href='faire-2007.htm'>Colonial Faire -2007</a></li>" +
"    </ul>" +
"        </li>" +
"    </ul>" +
"</li>" +
"<li><a href='musters.htm'>Musters</a>" +
"    <ul>" +
"    <li><a href='musters.htm'>Musters</a></li>" +
"    <li><a href='notice.pdf'>Muster Notice</a></li>" +
"    </ul>" +
"</li>" +
"<li><a href='PatriotsDay.htm'>Patriots Day</a>" +
"    <ul>" +
"    <li><a href='PatriotsDay.htm'>Patriots Day</a></li>" +
"    <li><a href='SudburyMarch.htm'>March through Wayland</a></li>" +
"    <li><a href='WaylandMarch.htm'>March from Sudbury to Concord</a></li>" +
"    </ul>" +
"</li>" +
"<li><a href='resources.htm'>Resources</a>" +
"    <ul>" +
"    <li><a href='resources.htm'>Resources</a></li>" +
"    <li><a href='clothing.htm'>Clothing and Accoutrements</a></li>" +
"    <li><a href='HistoricalResources.htm'>Historical Resources</a></li>" +
"    <li><a href='HistoricalSites.htm'>Historical Sites</a></li>" +
"    <li><a href='drills.htm' onmouseover='image3.src=loadImage3.src;' onmouseout='image3.src=staticImage3.src;'>Drills</a>" +
"	    <ul>" +
"    	<li><a href='drills.htm'>Drills</a></li>" +
"	    <li><a href='1764Commands.htm'>1764 Crown Manual</a></li>" +
"    	<li><a href='drillresources.htm'>Other Drill Resources</a></li></ul>" +
"    	</li>" +
"    	<li><a href='ContraDanceResources.htm'>Contra Dance Resources</a></li>" +
"    	</ul>" +
"</li>" +
"<li><a href='history.htm'>History</a>" +
"    <ul>" +
"	 <li><a href='ToKillaSquirrel.htm'>To Kill a Squirrel</a>" +
"		<ul>" +
"	 	<li><a href='ToKillaSquirrel.htm'>To Kill a Squirrel</a></li>" +
"		<li><a href='ToKillaSquirrel1.htm'>First Appendix</a></li>" +
"		<li><a href='ToKillaSquirrel2.htm'>Second Appendix</a></li>" +
"		</ul>" +
"		</li>" +
"    <li><a href='history.htm'>History</a></li>" +
"    <li><a href='colonels.htm'>Colonels</a></li>" +
"    <li><a href='NorthMilitia.htm'>North Militia</a></li>" +
"    <li><a href='EastMilitia.htm'>East Militia</a></li>" +
"    <li><a href='SouthMilitia.htm'>South Militia</a></li>" +
"    <li><a href='TroopHorse.htm'>Troop of Horse</a></li>" +
"    <li><a href='MinuteCompanyEast.htm'>Minute Company (East Side)</a></li>" +
"    <li><a href='MinuteCompanyWest.htm'>Minute Company (West Side)</a></li>" +
"    <li><a href='PineTree.htm'>Pine Tree</a></li>" +
"    </ul>" +
"</li>" +
"<li><a href='services.htm'>Public Service</a>" +
"	<ul>" +
"    <li><a href='services.htm'>Public Service</a></li>" +
"    <li><a href='education.htm'>Educational Services</a></li>" +
"    <li><a href='Door_Duty.htm'>Door Duty</a></li>" +
"    </ul>" +
"</li>" +
"<li><a href='faire.htm'>Colonial Faire</a>" +
"    <ul>" +
"    <li><a href='faire.htm'>Colonial Faire</a></li>" +
"    <li><a href='musterfield.htm'>Muster Field Activities</a></li>" +
"    <li><a href='children.htm'>Children's Activities</a></li>" +
"    <li><a href='FaireContraDance.htm'>Colonial Faire Contra Dance</a></li>" +
"    <li><a href='parade.htm'>Parade of Companies of Fyfes and Drums</a></li>" +
"    <li><a href='musicmuster.htm'>Muster of Companies of Fyfes and Drums</a></li>" +
"    <li><a href='vendors.htm'>Vendors</a></li>" +
"    <li><a href='directions.htm'>Directions</a></li>" +
"    <li><a href='info.htm'>Other Information</a></li>" +
"    </ul>" +
"</li>" +
"<li><a href='ContraDances.htm'>Contra Dances</a>" +
"    <ul>" +
"    <li><a href='ContraDances.htm'>Contra Dances</a></li>" +
"    <li><a href='12thNiteBall.htm'>Twelfth Night Ball</a></li>" +
"    <li><a href='GrandBall.htm'>Grand Ball at the Red Horse Tavern</a></li>" +
"    <li><a href='FaireContraDance.htm'>Colonial Faire Contra Dance</a></li>" +
"    <li><a href='ContraDanceResources.htm'>Contra Dance Resources</a></li>" +
"    </ul>" +
"</li>" +
"<li><a href='mailinglist.php'>Sign Up</a>" +
"</li>" +
"</ul>");
}

function fairemenu()	{
document.write("<ul id='suckerfishnav2' class='sf-menu'>" +
"    <li><a href='musterfield.htm'>Muster Field Activities</a></li>" +
"    <li><a href='children.htm'>Children's Activities</a></li>" +
"    <li><a href='FaireContraDance.htm'>Colonial Faire Contra Dance</a></li>" +
"    <li><a href='parade.htm'>Parade of Companies of Fyfes and Drums</a></li>" +
"    <li><a href='musicmuster.htm'>Muster of Companies of Fyfes and Drums</a></li>" +
"    <li><a href='vendors.htm'>Vendors</a></li>" +
"    <li><a href='directions.htm'>Directions</a></li>" +
"    <li><a href='info.htm'>Other Information</a></li>" +
"</ul>");
}
