// Check Browser CSS Compatibility
	
// alert(document.compatMode);
	
// Supress BOM Script Errors	
	
function errorsuppressor(){
return true;

}

window.onerror = errorsuppressor;

// Multiple Onload Utility

function addLoadEvent(func) {

	var oldonload = window.onload;

	if (typeof window.onload != 'function') {
		
		window.onload = func;
	
	} else {
		
		window.onload = function() {
		oldonload();
		func();
		
		}
	}
}

// Insert-after Function

function insertAfter(newElement, targetElement) {

var parent = targetElement.parentNode;

if (parent.lastChild == targetElement) {

	parent.appendChild(newElement);
	
} else {

	parent.insertBefore(newElement, targetElement.nextSibling);
	
	}
}

// Global Pop-up (parse through DOM, if viewpage class exists, append event)

function newWinLinks() {

	for (var i=0; i < document.links.length; i++) {
		
		if (document.links[i].className == "newwindow") {
		
			document.links[i].onclick = displayNewWindow;
		
		}

	}
		
}

addLoadEvent(newWinLinks);

function displayNewWindow() {

	var featureWindow = window.open(this.href,"win", 'toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=yes,resizable=1,top=100,left=100,width=800,height=600');
	featureWindow.focus();
	return false;
	
}

// *** Begin List Code ***

// Pick a Park - An Unobtrusive Dropdown by Michael "Spell" Spellacy

// Toggle, Show/Hide Element(s)

function toggleElement(val, obj){

	if(document.getElementById(val).style.display == "none") { 

		obj.className = "expand";
		document.getElementById("parks").className = "expand";
		document.getElementById(val).style.display = "block";

	} else {

		obj.className = ""; 
		document.getElementById("parks").className = "";
		document.getElementById(val).style.display = "none";
	}
}

function killList() {
	
	// Shut off list
	
	document.getElementById("list").style.display = "none";
	document.getElementById("pick").className = ""; 
	document.getElementById("parks").className = "";
	
}

function backToTop() {

	// Scroll back to top

	document.getElementById("list").scrollTop = 0; 

}

function prepParkList() {

	if (!document.getElementById("parks")) return false;
	
		// Set div back to top
	
		var body = document.body;
		var pick = document.getElementById("pick");
		var list = document.getElementById("list");
						
		// Apply events and associated functions
		
		// Container node
	
		// Parent node
	
		pick.onclick = function() {
		toggleElement("list", this);
		backToTop();
		}
	
		pick.onmouseover = function() {
		var e=arguments[0] || event; 
		cancelProp(e);
		}
	
		// Drop-down
	
		list.onclick = function() {
		killList();
		backToTop();
		}
	
		list.onmouseover = function() {
		var e=arguments[0] || event; 
		cancelProp(e);
		}
	
		// Hack: When body is hovered over -- kill menu!
	
		body.onmouseover = function() {
	
			if(list.style.display != "none") {
		
			setTimeout(killList,250); // Eliminate list after couple of seconds
			
			} 
		}
}

addLoadEvent(prepParkList);

// Kill Pesky Event Bubbling

function cancelProp(e) {

	e.cancelBubble = true;

}

// *** End List Code ***

// Text/Flash Image Replacement

addLoadEvent(setIFRFont);

// That's all, Folks!
