// Begin Suckerfish dropdown code for IE:
// http://www.htmldog.com/articles/suckerfish/dropdowns/
sfHover = function() {
	var sfEls = document.getElementById("menu").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);









//Begin switchable stylesheet code from http://www.alistapart.com/articles/alternate/
/*
	I had to alter this function to allow for multiple possibilities for the preferred styleesheet.
	It could be either level1 or level2and3. So if the cookie had been set to level1, then you move to level2, 
	it wouldn't find the level1 stylesheet; therefore, no stylesheet would be applied.
	Now I check to see if no stylesheets were applied by incrementing a counter.
	If the counter is zero, set to the preferred stylesheet.
	--EMS
*/
function setActiveStyleSheet(title) {
	var i, a, main;
	var numStylesheets = 0; //added by escull to increment number of stylesheets applied.
	for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
		if(a.getAttribute("rel").indexOf("style")!= -1 && a.getAttribute("title")) {
			a.disabled = true;
			if(a.getAttribute("title") == title) {
				a.disabled = false;
				numStylesheets++;
			}
		}
	}
	//now, if numStylesheets is still 0, enable the preferred stylesheet using recursion.
	if(numStylesheets==0){
		//alert("no stylesheet found.");
		
		setActiveStyleSheet(getPreferredStyleSheet());
	}
}

function getActiveStyleSheet() {
	var i, a;
	for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
		if(a.getAttribute("rel").indexOf("style")!= -1 && a.getAttribute("title") &&!a.disabled) return a.getAttribute("title");
	}
	return null;
}

function getPreferredStyleSheet() {
	var i, a;
	for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
		if(a.getAttribute("rel").indexOf("style")!= -1 && a.getAttribute("rel").indexOf("alt") == -1 && a.getAttribute("title")) return a.getAttribute("title");
	}
	return null;
}

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;
}

window.onload = function(e) {
	var cookie = readCookie("style");
	var title = cookie? cookie : getPreferredStyleSheet();
	setActiveStyleSheet(title);
	//alert("Active stylesheet: " + title);
}

window.onunload = function(e) {
	var title = getActiveStyleSheet();
	createCookie("style", title, 365);
	//alert("Setting cookie: " + title);
}

var cookie = readCookie("style");
var title = cookie? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title); 

//End Switchable stylesheet code





//Dreamweaver Functions:

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}