var MenuOn=0, MenuSH = new Array, TimeId;

browser_name = navigator.appName;
browser_version = parseFloat(navigator.appVersion);

if (browser_name == "Netscape" && browser_version >= 3.0) { roll = 'true'; }
else if (browser_name == "Microsoft Internet Explorer" && browser_version >= 3.0) { roll = 'true'; }
else { roll = 'false'; }

function over(img,ref) { if (roll == 'true') { document.images[img].src = ref; } }
function out(img,ref)  { if (roll == 'true') { document.images[img].src = ref; } }

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";
} // end if type=0

if (type==1) {
MenuSH[par]=0;
if (source=="div") {
	MenuOn=0;
	clearTimeout(TimeId);
	TimeId=setTimeout('HideAllDivs()',500);
} else {
	if (MenuOn) {
		clearTimeout(TimeId);
		TimeId=setTimeout('MenuOff("'+par+'")',500);
	}

}
} // end if type==1

}
function hideChild(arr) {
		for (i=0; i < arr.length; i++) {
			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";
		}
	}
}

function MenuOff (lid) {
	if ( (!MenuSH[lid]) ) {
		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;
}
if (p==2) {
document.getElementById(td).style.background=color; 
document.getElementById(tdi).style.color=colorf; 
}

}
