// JavaScript Document

n_st=3;
n_nd=6;

mlevel=new Array();
mflag=new Array();

for (i=0; i<n_st; i++){
	if (i==0) {
		mlevel[0]=new Array();
		mflag[0]=new Array();
	}
	mlevel[0][i]='SUB'+i;
	mflag[0][i]=false;
}
for (i=0; i<n_nd; i++){
	if (i==0) {
		mlevel[1]=new Array();
		mflag[1]=new Array();
	}
	mlevel[1][i]='SUBSUB'+i;
	mflag[1][i]=false;
}

timeout=500;
h=null;
function Redir(path){
	window.location.href=path;
}
function OverAndOutEmpty(object,over){
	if (!object) return;
	if (over) object.style.background="URL(./images/sub_over.jpg)";
	else object.style.background="#FFFFFF";
}
function EmptyMain(object,over){
	if (over){
		object.style.background="URL(images/menu_over.jpg)";
		//object.style.background="#CCCCCC";
		document.getElementById(object.id+'_arrow').style.visibility="visible";
	}else{
		object.style.background="URL(images/menu_out.jpg)";
		//object.style.background="#EEEEEE";
		document.getElementById(object.id+'_arrow').style.visibility="hidden";
	}
}
function Over(child,level,index,parent,style){
	clearInterval(h);
	if (!child) return;
	mflag[level-1][index]=true;
	child.style.display="inline";
	
	parent.style.background="URL(./images/sub_over.jpg)";
	//parent.style.background="#CCCCCC";
	if (style==0) {
		parent.style.background="URL(images/menu_over.jpg)";
		document.getElementById(parent.id+'_arrow').style.visibility="visible";
		//alert(parent.id);
	}
	fvoid(child.id,level,index);
	
}
function Out(child,level,index,parent,style){
	mflag[level-1][index]=false;
	parent.style.background="#FFFFFF";
	//parent.style.background="#EEEEEE";
	if (style==0) {
		parent.style.background="URL(images/menu_out.jpg)";
		document.getElementById(parent.id+'_arrow').style.visibility="hidden";
	}
	h=setTimeout("fvoid('"+child.id+"','"+level+"','"+index+"')",timeout);
}
function OutChild(child,level,index,parent,style){
	mflag[level-1][index]=false;
	parent.style.background="#FFFFFF";
	//parent.style.background="#EEEEEE";
	if (style==0) {
		parent.style.background="URL(images/menu_out.jpg)";
		document.getElementById(parent.id+'_arrow').style.visibility="hidden";
	}
	fvoid(child.id,level,index);
}
function fvoid(child,level,index){
		for (i=0; i<mlevel[level-1].length; i++) 
			if (mflag[level-1][i]==false){
				o=document.getElementById(mlevel[level-1][i])
				if (o) o.style.display="none";
			}
		clearInterval(h);
}