var MenuOn=0, MenuSH = new Array, TimeId;

function navig_d (par,type,nIdDiv,source) {
var lay=document.getElementById(par);

if (type==0) {
MenuSH[par]=1;
MenuOn=1;
clearTimeout(TimeId);
//lay.style.visibility="visible";
lay.style.display="block";
lay.style.visibility="visible";
} //end if type=0

if (type==1) {
MenuSH[par]=0;
if (source=="div") {
	MenuOn=0;
	clearTimeout(TimeId);
	TimeId=setTimeout('HideAllDivs()',0);
} else {
	if (MenuOn) {
		clearTimeout(TimeId);
		TimeId=setTimeout('MenuOff("'+par+'")',0);
	}

}
}//end if type==1

}
function hideChild(arr) {
		for (i=0; i < arr.length; i++) {
//			document.getElementById(arr[i]).style.visibility="hidden";
			document.getElementById(arr[i]).style.display="none";
			document.getElementById(arr[i]).style.visibility="hidden";
		}
}

function HideAllDivs () {
	if (!MenuOn) {
		for (i=0; i < MainDivs.length; i++) {
//			document.getElementById(MainDivs[i]).style.visibility="hidden";
			document.getElementById(MainDivs[i]).style.display="none";
			document.getElementById(MainDivs[i]).style.visibility="hidden";
		}
	}
}

function MenuOff (lid) {
	if ( (!MenuSH[lid]) ) {
//		document.getElementById(lid).style.visibility="hidden";
		document.getElementById(lid).style.display="none";
		document.getElementById(lid).style.visibility="hidden";
	}
}

function add_click (url,target) {
if (url) {
//alert("Debug:"+url);
//alert("Debug:"+target);
if (target=="_parent") {
parent.location.href=url;
}
if (target=="_blank") {
window.open(url);
}
if (target=="_self") {
location.href=url;
}
if (target=="_top") {
top.location.href=url;
}
}//end if !url
}

function menu (td,p,color,a,colorf)
{
tdi="i"+td;
if (p==1) {
document.getElementById(td).style.background=color; 
document.getElementById(tdi).style.color=colorf;
document.getElementById(tdi).style.textDecoration="underline"; 
}
if (p==2) {
document.getElementById(td).style.background=color; 
document.getElementById(tdi).style.color=colorf; 
document.getElementById(tdi).style.textDecoration="none"; 
}

}