
MaxMenuItems = 7
MaxSubMenuItems = new Array()
MaxSubMenuItems[1] = 0
MaxSubMenuItems[2] = 2
MaxSubMenuItems[3] = 5
MaxSubMenuItems[4] = 4
MaxSubMenuItems[5] = 4
MaxSubMenuItems[6] = 2
MaxSubMenuItems[7] = 0

WaitTimeInSec = (5 * 1000)
TimerID = setInterval("",WaitTimeInSec) 
if (document.images)
	{
		arrowRed = new Image
		arrowGreen = new Image
		arrowRed.src =  "../Grafics/Beeldelementen/Driehoek2.gif"
		arrowGreen.src = "../Grafics/Beeldelementen/SelectedDriehoek2.gif"
	}	
	else
	{
		arrowRed = ""
		arrowGreen = ""
		document.arrow = ""
	}

function PlaatsArrow(ID){
	ArrowID = 'arrow' + ID
	ArrowObject =document.getElementById(ArrowID)
	ArrowObject.src = arrowGreen.src
}
function Reset(MainID,SubID){
		ResetSubMenuCollor(MainID,SubID)
		ToggleAllMenusOff()

}
function ResetSubMenuCollor(MainID,SubID){
		LinkID = 'sublink' + MainID + '_' + SubID
		LinkObject =document.getElementById(LinkID).style
		LinkObject.color = "#FFFFFF"
}

function SetSubMenuCollor(MainID,SubID){
		LinkID = 'sublink' + MainID + '_' + SubID  
		LinkObject =document.getElementById(LinkID).style
		LinkObject.color = "#CCCCCC"

}
function SetMenuItemCollor(ID){
		clearInterval(TimerID)
		LinkID = 'link' + ID
		LinkObject =document.getElementById(LinkID).style
		LinkObject.color = "#66FF00"
		TimerID = setInterval("ToggleAllMenusOff()",WaitTimeInSec) 		
}		

function ToggleAllMenusOff(){
	for (i=1; i < MaxMenuItems + 1; i++){
		MenuID = 'menu' + i
		ArrowID = 'arrow' + i
		LinkID = 'link' + i
		if ((i > 1) && (i < MaxMenuItems )){
			thisMenu2 =document.getElementById(MenuID).style
			thisMenu2.display = "none"	
		}
		ArrowObject =document.getElementById(ArrowID)
		ArrowObject.src = arrowRed.src
		
		LinkObject =document.getElementById(LinkID).style
		LinkObject.color = "#FFFFFF"			
	}
}
function HomeSituationMouseOut(ID){
	LinkID = 'link' + ID
	LinkObject =document.getElementById(LinkID).style
	LinkObject.color = "#FFFFFF"
	ArrowID = 'arrow' + ID
	ArrowObject =document.getElementById(ArrowID)
	ArrowObject.src = arrowRed.src
}
function HomeSituationMouseOn(ID){
	ToggleAllMenusOff()
	PlaatsArrow(ID)
	SetMenuItemCollor(ID)

}
function toggleMenu(ID) {
	currMenu = 'menu' + ID
	if (document.getElementById) {
			thisMenu = document.getElementById(currMenu).style
			if (thisMenu.display == "block") {

				<!--  thisMenu.display = "none" -->
			}
			else {
				ToggleAllMenusOff()
				PlaatsArrow(ID)
				SetMenuItemCollor(ID)
				thisMenu.display = "block"
			}
			return false
			}
			else {
				return true
			}
}

