var current_open_menu_id='-1';
var objDivToBeRolledOver='';
var intHeight=0;
var intMaxHeight=0;
var rollOutInProcess=false;

function closeMenu(id) {
	debugprint ('current open menu=['+id+']');
	try {
		if (id!='-1') {		
			document.getElementById('menu'+id).style.display='none';			
		}
	} catch(e) {
	}
}

function klapMenuUit() {
	// intOpenTopMenu en intEersteMenu zijn globaal gedefinieerde variabelens	
	showMenu(intOpenTopMenu)
	showSelect(intEersteMenu);
}

function showMenu(id) {
	closeSelect(current_open_menu_id);
	closeMenu(current_open_menu_id);
	showSubMenu(id);
	showSelect(id);

	current_open_menu_id=id;
}

function showSubMenu(id) {
	try {
		document.getElementById('menu'+id).style.display='block';		
		debugprint ('open menu=['+id+']');
	} catch(e) {
	}	
}

function showSelect(id) {
	try {
		document.getElementById('img'+id).style.display='inline';
	} catch(e) {
	}
}

function closeSelect(id) {
	try {
		document.getElementById('img'+id).style.display='none';
	} catch(e) {
	}
}

function rollOutOver(toBeRolledOverDivId, toRollOutDivId,intiMaxHeight) {
	if (!rollOutInProcess) {
		intMaxHeight=intiMaxHeight;
		objDivToBeRolledOver=document.getElementById(toBeRolledOverDivId);
		objDivToRollOut=document.getElementById(toRollOutDivId);
		// make the to be rolled over disappear
		objDivToBeRolledOver.style.display='none';
		objDivToBeRolledOver.style.zIndex=1;
		// set properties on the to roll out div	
		objDivToRollOut.style.overflow="hidden";
		objDivToRollOut.style.height="0px";
		objDivToRollOut.style.display="block";
		objDivToRollOut.style.zIndex=20;
		
		intHeight=0;
		// alert(objDivToRollOut);
		rollOutInProcess=true;
		setTimeout("rollOutOverPhase2(objDivToRollOut,intHeight,intMaxHeight)",10);
	}
}

function rollOutOverPhase2() {
	intHeight=intHeight+15;
	if (intHeight>intMaxHeight) intHeight=intMaxHeight;
	objDivToRollOut.style.height=intHeight + "px";
	
	
	if (intHeight<intMaxHeight) {
		setTimeout("rollOutOverPhase2(objDivToRollOut,intHeight,intMaxHeight)",10);
	} else {
		rollOutInProcess=false
	}	
}
