<!--
// Menu rollovers 

function preLoadImages () {
	var list = new Array (
		"menu-bg-hover.gif",
		"menu-bg-hover-home.gif"
	);

	if (document.images) {
		noImages = list.length;
		preloadedImages = new Array (noImages);
		for (x = 0; x < noImages; x++) {
			preloadedImages[x] = new Image;
			preloadedImages[x].src = '/images/' + list[x];
		}
	}
}

function swapImage(imageName, newImage) {
    if (document.images) {
      document.images[imageName].src = newImage;
  }
}

preLoadImages();

// Auto-menu highlighter. Copyright Cayenne Web Development 2003 - www.cayenne.co.uk


	function getPathPositions(url) {
		var pos = 0;
		positions = new Array();
		pathParts = url.split("/");
		count = pathParts.length;
		for (x = 0; x < count; x++) {
			pos = pos + pathParts[x].length + 1;
			positions[x] = pos;
		}
		return positions;
	}


	function urlsMatch(url, testUrl, level, positions) {
		if (testUrl.substr(0,1) == "/") {
			testUrl = testUrl.substr( 1 );
		}
		if(level == 0) {
			return (url.substr(1) == testUrl);
		} else {
			return (url.substr(1, positions[level]-1) == testUrl.substr(0, positions[level]-1))
		}
	}


// set highlight styles for menus

function linkHighlight() {
	var positions = getPathPositions(location.pathname);
	var count = document.links.length;
	for (i = 0; i < count; i++) {
		thisLink = document.links[i];
		if (urlsMatch(location.pathname, thisLink.pathname, 0, positions) && thisLink.className == "nav2") {
			thisLink.style.color = "#C00";
			continue;
		} 
		if (urlsMatch(location.pathname, thisLink.pathname, 0, positions) && thisLink.className == "nav3") {
			thisLink.style.color = "#C00";
			continue;
		}
	}
}

// Open page in new window

function newWindow(object) {
	window.open(object.href, "");
	return false;
}


// Suckerfish Dropdowns
sfHover = function() { 
	if (document.getElementById && document.getElementById("mainnav")) {
		var sfEls = document.getElementById("mainnav").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); 


//-->