/* = TOP NAVIGATION JS---------------------------------------------------------------	control which submenu is showing in the navigation	depending on which subdirectory we're in---------------------------------------------------------------*/function findLocation() {	if(!document.getElementById) return false;	if(!document.getElementsByTagName) return false;		var url = new String(location);	var urlArray = new Array();	urlArray = url.split("/");	var directory = urlArray[3];		/* select the directory */	switch(directory) {		case "attractions":			if(document.getElementById('nav-attractions'))			var selectedNav = document.getElementById('nav-attractions');			break;		case "galleries":			if(document.getElementById('nav-galleries'))			var selectedNav = document.getElementById('nav-galleries');			break;		case "admission":			if(document.getElementById('nav-admission'))			var selectedNav = document.getElementById('nav-admission');			break;		case "visit":			if(document.getElementById('nav-visit'))			var selectedNav = document.getElementById('nav-visit');			break;		case "press_room":			if(document.getElementById('nav-press'))			var selectedNav = document.getElementById('nav-press');			break;		case "calendar":			if(document.getElementById('nav-calendar'))			var selectedNav = document.getElementById('nav-calendar');			break;		case "occasions":			if(document.getElementById('nav-occasions'))			var selectedNav = document.getElementById('nav-occasions');			break;		case "memberships":			if(document.getElementById('nav-memberships'))			var selectedNav = document.getElementById('nav-memberships');			break;		case "giving":			if(document.getElementById('nav-giving'))			var selectedNav = document.getElementById('nav-giving');			break;		case "store":			if(document.getElementById('nav-store'))			var selectedNav = document.getElementById('nav-store');			break;		default:			break;	}		if(!parent) return false;	/* change the current directory menu item to selected */	if(!selectedNav) return false;	if(selectedNav.className)	{		selectedNav.className += " selected";	}	else {		selectedNav.className = "selected";	}}addLoadEvent(findLocation);/* = check body height---------------------------------------------------------------	If the content height is less than the window height	then a different class is applied to the HTML tag	to fix 100% hight div issues---------------------------------------------------------------*/function checkBodyHeight() {	window.onresize = checkBodyHeight;		var windowHeight = 0;	var bodyHeight = 0;  if( typeof( window.innerWidth ) == 'number' ) {    //Non-IE    windowHeight = window.innerHeight;  } else if( document.documentElement && document.documentElement.clientHeight ) {    //IE 6+ in 'standards compliant mode'    windowHeight = document.documentElement.clientHeight;  } else if( document.body && document.body.clientHeight ) {    //IE 4 compatible    windowHeight = document.body.clientHeight;  }	bodyHeight = document.getElementById('centered').offsetHeight;		if(bodyHeight < windowHeight) {		document.getElementsByTagName('html')[0].className = "hundred";	}}addLoadEvent(checkBodyHeight);/* = CLEAR FIELD-------------------------------------------------	Clears any input when clicked on if it contains	its default value.  All that is required is	that you put the class "clearDefault" on the	input.-------------------------------------------------*/function clickClear() {	if(!document.getElementsByTagName) return false;		var inputs = document.getElementsByTagName("INPUT");		for ( var i = 0; i < inputs.length; i++)	{		if(inputs[i].className.indexOf("clearDefault") != -1)		{			inputs[i].onclick = function() {				if(this.value == this.defaultValue)				{					this.value = "";				}			}			inputs[i].onfocus = function() {				if(this.value == this.defaultValue)				{					this.value = "";				}			}			inputs[i].onblur = function() {				if(this.value == "")				{					this.value = this.defaultValue;				}			}		}	}}addLoadEvent(clickClear);/* = EVENT HANDLER---------------------------------------------------------------*/function addLoadEvent(func) {	var oldOnLoad = window.onload	if (typeof window.onload != 'function') 	{		window.onload = func;	}	else {		window.onload = function() {			oldOnLoad();			func();		}	}}
