var akt_menu;
var akt_item;
var akt_position;
function isIE(){
	return document.all;
}
function show_submenu(which,level){
	if (level>1){
		return cancelReset();
	}

	window.clearTimeout(tOut);
	if(!which){
	return false;
	}

		if(which.innerHTML=='Home'){
			position=1;
		}else{
			position=2;
		}

	if (akt_menu){
		akt_menu.style.display='none';
		if(akt_item.id!='submenu_currently_true_1'){
			akt_item.className="selected_false border_"+akt_position;
		}
	}
	akt_item=which;
	akt_position=position;
	which.className="selected_true border_"+position;
	oParent=which.parentNode;
	arr_nodes=oParent.childNodes;
	for(i=0;i<arr_nodes.length;i++){
		if(arr_nodes[i].tagName=="UL"){
			if(isIE()){
				arr_nodes[i].style.marginLeft=((-1)*(oParent.clientWidth+4))+"px";
				if(IEVersion()==6){
				arr_nodes[i].style.marginTop=(24)+"px"
				}else{
					arr_nodes[i].style.marginTop=(22)+"px"
				}
			}
			akt_menu=arr_nodes[i];
			arr_nodes[i].style.display='block'
			arr_nodes[i].style.width="400px";
			arr_nodes[i].style.visibility='visible';
			oLIs=arr_nodes[i].childNodes;
			li_width=0;
			for(j=0;j<oLIs.length;j++){
				if(oLIs[j].tagName=='LI'){
					li_width=li_width+oLIs[j].clientWidth;
				}
				//alert(oLIs[j].clientWidth);
			}
			arr_nodes[i].style.width=(li_width)+"px";
			arr_nodes[i].style.display='block'
			//alert(li_width);
			break;
		}
	}
	
	
}
var tOut;
function startReset(){
	tOut=window.setTimeout("resetOriginal()",400);
}
function resetOriginal(){
	if (akt_menu){
		akt_menu.style.display='none';
		if(akt_item.id!='submenu_currently_true_1'){
			akt_item.className="selected_false border_"+akt_position;
		}
	}
	//show_submenu(document.getElementById('submenu_currently_true_1'));
}
function cancelReset(){
	window.clearTimeout(tOut);
}
function IEVersion() {
    var ua = navigator.userAgent;
    var MSIEOffset = ua.indexOf("MSIE ");
    
    if (MSIEOffset == -1) {
        return 0;
    } else {
        return parseFloat(ua.substring(MSIEOffset + 5, ua.indexOf(";", MSIEOffset)));
    }
}
function chkurl(w,l){
	return true;
	return (l>1 || w=='/index.php' || w=='/content/index.php' || w=='index.php' || w=='/content/info_portal.php')
}

