
try {
  document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}

/* Calls searchForLIs for both menu's. This replaces the csshover.htc
   functionality in the menu's */


function isdefined( variable)
{
    return (typeof(window[variable]) == "undefined")?  false: true;
}

function parseLists() {
	if (document.all&&document.getElementById) {
		menuRoot = document.getElementById("menu");
		searchForLIs(menuRoot);

 	} 	
}

/* Recursive function. Searches the childs of the passed object for LI's or UL's. 
   When found they are passed to this function again. LI's are also given 2 events (mouseover / mouseout). */

function searchForLIs(objectReference) {
	for (var i=0; i < objectReference.childNodes.length; i++) {
		node = objectReference.childNodes[i];
		switch (node.nodeName) {
			case "LI": {
				name = node.id;
				name = name.replace("menu", "");
				addMouseOver = false;
				if(!isNaN(name) && name != "") {
					addMouseOver = true;
				}
				this.menuId = name;
				if (addMouseOver) {
					node.onmouseover = function() {
						this.className += " over";
						Highlight(this.id.replace("menu", ""));	
					}
				
				}
				else {
					node.onmouseover = function() {
						this.className += " over";
					}
  				}
  				
				if (addMouseOver) {
					node.onmouseout = function() {
						this.className = this.className.replace(" over", "");
						Lowlight(this.id.replace("menu", ""));
					}
				}
				else {
					node.onmouseout = function() {
						this.className = this.className.replace(" over", "");
					}
				}
		
				//searchForLIs(node);	
				break;
			}
			case "UL": {
				searchForLIs(node);
				break;
			}		
		}
	}
	return;
}







