itemForHide = new Array();

function hideItem() {
    for (var i=itemForHide.length-1; i>=0; i--) {
	if (itemForHide[i] != null) {
	    itemForHide[i].className=itemForHide[i].className.replace(new RegExp("sfhover", 'g'), "");
//u	    itemForHide[i].style.border = '1px solid #0D294E';
	    itemForHide[i] = null;
	}
    }
	
}

sfHover = function() {


	if (document.getElementById("left_menu") == null)
		return;
	var sfEls = document.getElementById("left_menu").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		
		
		if (sfEls[i] != null) {
			if (sfEls[i].className.indexOf('act') != -1 && sfEls[i].className.indexOf('noact') == -1) {
				node = sfEls[i].parentNode;
				sfEls[i].lastChild.className += " expanded";
//				alert('expanded');
				while (node != null) {
//					alert(node.nodeName);
					if (node.nodeName == 'UL')
						node.className += " expanded";
					node = node.parentNode;
				}
			}
		}
		if (sfEls[i].lastChild.nodeName == 'UL') {
			if (sfEls[i].childNodes[0] != null && sfEls[i].childNodes[0].childNodes[1] != null && sfEls[i].childNodes[0].childNodes[1].childNodes[0] != null && sfEls[i].childNodes[0].childNodes[1].childNodes[0].nodeName == 'A') {
				sfEls[i].childNodes[0].childNodes[1].childNodes[0].onclick=function() {
					if (this.href.indexOf('#') != -1) {
						if (this.parentNode.parentNode.parentNode.lastChild.className.indexOf("expanded") != -1) 
							this.parentNode.parentNode.parentNode.lastChild.className = this.parentNode.parentNode.parentNode.lastChild.className.replace(new RegExp("expanded\\b"), "");
						else {
							this.parentNode.parentNode.parentNode.lastChild.className += " expanded";						
						}
					}
					if (this.href.indexOf('#') != -1)
					    return false;
					return true;			
				}
			}
			else {
				sfEls[i].childNodes[1].childNodes[0].onclick=function() {
					if (this.href.indexOf('#') != -1) {
						if (this.parentNode.parentNode.lastChild.className.indexOf("expanded") != -1) 
							this.parentNode.parentNode.lastChild.className = this.parentNode.parentNode.lastChild.className.replace(new RegExp("expanded\\b"), "");
						else {
							this.parentNode.parentNode.lastChild.className += " expanded";						
						}
					}
					if (this.href.indexOf('#') != -1)
					    return false;
					return true;			
				}
			}
		}
	}
}
//if (window.attachEvent) window.attachEvent("onload", sfHover);

window.onload = sfHover;
