<!--//--><![CDATA[//><!--
function flashWrite(flashfile,x,y,flashvar) {
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='"+ x +"' height='"+ y +"'>");
	document.write("<param name='movie' value='"+ flashfile +"' />");
	document.write("<param name='quality' value='high' />");
	document.write("<param name='flashvars' value='"+ flashvar +"' />");
	document.write("<param name='wmode' value='transparent' />");
	document.write("<embed src='"+ flashfile +"' wmode='transparent' ");
	document.write("flashvars='"+ flashvar +"'  ");
	document.write("quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+ x +"' height='"+ y +"'></embed>");
	document.write("</object>");
}

function createMarker(point, address) {
	var marker = new GMarker(point);
	GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml(address);
	});

	return marker;
}


function validateSearch(obj) {
	if(obj.value == "") {
		alert("Please enter a search phrase");
		return false;
	} else {
		location.href = '/cms/search/search2.asp?zoom_query=' + obj.value;
		return false;
	}
}

function changeStyles(type, style) {	
	if (type == 'text') {
		document.body.className = document.body.className.split(' ')[0] + ' ' + style;	
	} else if (type == 'background') {
		document.body.className = style + ' ' + document.body.className.split(' ')[1];	
	}
	
	return false;
}

function printPage() {
	window.print();
	return false;
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

activeLink = function() {
	var sfEls = document.getElementById("topnavigation").getElementsByTagName("LI");
	
	for (var i=0; i<sfEls.length; i++) {		
		if (location.href.indexOf((sfEls[i].getElementsByTagName("SPAN"))[0].innerHTML.toLowerCase().replace(' ','-')) != -1) {	
			sfEls[i].className+=(sfEls[i].className.length>0? " ": "") + "active";
			sfEls[i].childNodes[0].className+=(sfEls[i].childNodes[0].className.length>0? " ": "") + "current";
		}
	}
		
	/*if(document.getElementById("subnav")) {

		var sfEls = document.getElementById("subnav").getElementsByTagName("LI");

		for (var i=0; i<sfEls.length; i++) {
			if (location.href.substring(location.href.lastIndexOf('/')).indexOf((sfEls[i].getElementsByTagName("SPAN"))[0].innerHTML.toLowerCase().replace(' ','-')) != -1) {	
				sfEls[i].className+=(sfEls[i].className.length>0? " ": "") + "active";
			}
		}
	}*/	
}

if(window.addEventListener) window.addEventListener('load', activeLink, false);
else if(document.addEventListener) document.addEventListener('load', activeLink, false);
else if(window.attachEvent) {
	window.attachEvent('onload', activeLink);
} else {
	if(typeof window.onload == 'function') {
		var existing = onload;
		window.onload = function() {
			activeLink();
		}
	} else {
		window.onload = function() {
			activeLink();
		}
	}
}

//window.onunload = function(e) {
//	var background = document.body.className.split(' ')[0];
//	var textSize = document.body.className.split(' ')[1];
//	createCookie('style3', textSize, 365);
//	createCookie('style4', background, 365);
//}
//--><!]]>
