var menuTimer = 0;

var walkthrough = function() {
	secList = getElementsByClass('li', 'sectionitem');
	for (i=0; i<secList.length; i++) {
		secList[i].onmouseover = function() { clearTimer(); showLayer(this); }
		secList[i].onmouseout = function() { setTimer(); }
	}
	secList2 = getElementsByClass('li', 'sectionitem_selected');
	for (i=0; i<secList2.length; i++) {
		secList2[i].onmouseover = function() { clearTimer(); showLayer(this); }
		secList2[i].onmouseout = function() { setTimer(); }
	}
}
window.onload = walkthrough;

function getElementsByClass(elem, theclass) {
	classes = new Array();
	alltags = document.getElementsByTagName(elem);
	for (k=0; k<alltags.length; k++) {
		if (alltags[k].className == theclass) { classes[classes.length] = alltags[k]; }
	}
	return classes;
}

function setTimer() { menuTimer = setTimeout("hideAll()", 500); }

function clearTimer() { clearTimeout(menuTimer); }

function hideAll() {
	plists = getElementsByClass('ul', 'pagelist');
	for (m=0; m<plists.length; m++) {
		plists[m].style.visibility="hidden";
	}
}

function showLayer(lyr) {
	hideAll();
	for (i=0; i<lyr.childNodes.length; i++) {
		if (lyr.childNodes[i].className == "pagelist") { lyr.childNodes[i].style.visibility="visible"; }
	}
}
