// JavaScript Document

function menusetup(){
	document.getElementsByTagName("ul");
}
function imhere(){
	//var listitems = new Array('index', 'articles', 'resources');
	var itemURL;
	var i;
	var allLinks = document.getElementsByTagName('li'); //use <li>, then firstchildnode to get url?
	alert (allLinks[0].childNodes[0]);
	alert (location.href);
	alert (allLinks[0].style.backgroundColor);

	for (i; i>=0; i--){
		itemURL = allLinks[i].firstchild;
		if (allLinks[i].firstchild.href == location.href){
			allLinks[i].style.backgroundColor='#fff000';
	alert (allLinks[0].style.backgroundColor);
		}
	}
	//alert (itemURL);
}


function flyout(element){
	var linkid = element.id;
	var menu;
	var submenu;
	
	if (!document.getElementById) return true;
	
	menu = linkid + '-menu';
	document.getElementById(menu).style.display=(document.getElementById(menu).style.display=='block')?'none':'block';
	return false;
}	


function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp('(^|\\s)'+searchClass+'(\\s|$)');
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

