function showleaf(leafID) {
	//alert (leafID);
	leafhandle = document.getElementById(leafID);
	maphandle = document.getElementById("navtree");
	leafhandle.style.zIndex = 100;
	maphandle.style.zIndex = 50;
	removeClass(leafhandle,"hidden");
}

function hideleaf(leafID) {
	//alert (leafID);
	leafhandle = document.getElementById(leafID);
	addClass(leafhandle,"hidden");
}

function rolloverInit() {
	//alert('rolloverInit');
	//alert('document.images.length: ' + document.images.length);
	for (var i=0; i<document.images.length; i++) {
		if (document.images[i].parentNode.tagName == "A") {
			setupRollover(document.images[i]);
		}		
	}
	//alert('done');
}

function setupRollover(thisImage) {	
	//alert('setupRollover');
	thisImage.outImage = new Image();
	thisImage.outImage.src = thisImage.src;
	thisImage.onmouseout = rollOut;
	
	thisImage.overImage = new Image();
	thisImage.overImage.src = "/css/skin/" + thisImage.id + "-over.png";
	thisImage.onmouseover = rollOver;
}

function rollOver() {
	//alert('rollOver: ' + this.overImage.src);
	this.src = this.overImage.src;
}

function rollOut() {
	this.src = this.outImage.src;
}

function hasClass(ele,cls) {
	return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
}

function addClass(ele,cls) {
	if (!this.hasClass(ele,cls)) ele.className += " "+cls;
}

function removeClass(ele,cls) {
	if (hasClass(ele,cls)) {
    	var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
		ele.className=ele.className.replace(reg,' ');
	}
}

initializeList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("navigation");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() { this.className+=" over";}
				node.onmouseout=function() { this.className=this.className.replace(" over", "");}				
			}
		}
	}
}