var MenuOn=0, MenuSH = new Array, TimeId, MainDivs=new Array('menu1','menu2','menu3','menu4','menu5');


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 preloadImg(file){
  image = new Image();
  image.src = file;
}

function rol_img() {
preloadImg('/images/lang/bg.gif');
preloadImg('/images/lm/lm_over.gif');
}




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()',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.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.display="none";
			document.getElementById(MainDivs[i]).style.visibility="hidden";
		}
	}
}

function MenuOff (lid) {
	if ( (!MenuSH[lid]) ) {	
		document.getElementById(lid).style.display="none";
		document.getElementById(lid).style.visibility="hidden";
	}
}

function HideShow (par,t) {
var lay=document.getElementById(par);
if (t==0) { 
	lay.style.display="block";
	lay.style.visibility="visible"; 
	}
if (t==1) {
	lay.style.display="none"; 
	lay.style.visibility="hidden";
	}
}


function menu (td,p,color,colorf,img)
{
if (p==1) {
document.getElementById(td).style.background=color; 
document.getElementById(td).style.color=colorf;
//document.getElementById(td).style.textDecoration="underline";
}
if (p==2) {
document.getElementById(td).style.background=color+' url(/images/'+img+') no-repeat right'; 
document.getElementById(td).style.color=colorf; 
document.getElementById(td).style.textDecoration="underline"; 
}
if (p==3) {
document.getElementById(td).style.background=color+' url(/images/'+img+') no-repeat center'; 
document.getElementById(td).style.color=colorf; 
//document.getElementById(td).style.textDecoration="none"; 
}

}
function menuIns (td,p,color,colorf,img)
{
if (p==1) {
document.getElementById(td).style.background=color+' url(/images/'+img+') no-repeat left'; 
//document.getElementById(td).style.color=colorf;
//document.getElementById(td).style.textDecoration="underline"; 
}
if (p==2) {
document.getElementById(td).style.background=color+' url(/images/'+img+') no-repeat center top'; 
//document.getElementById(td).style.color=colorf;
document.getElementById(td).style.textDecoration="none"; 
}

}

function menuImg (td,p,color,colorf)
{
if (p==1) {
document.getElementById(td).style.backgroundImage='url(/images/'+color+')'; 
document.getElementById(td).style.color=colorf;
}
if (p==2) {
document.getElementById(td).style.backgroundImage='url(/images/'+color+')';
document.getElementById(td).style.color=colorf; 
}

}

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
}