function FillMenu(document){
	//alert(document.formFillMenu.selFillMenu.selectedIndex)
	//alert(document.formFillMenu.selFillMenu.value)
	//alert(document.formFillMenu.selFillMenu.value)
	if (document.formFillMenu.selFillMenu.selectedIndex == 0){
	 	SetPictures(ImgObjArray, ImgOnObjArray, ImgStayObjArray, AfbKennismaken, RefKennismaken)
	}
//dve omgewisseld 1 antwoorden met 2 verdiepen en selectedIndex ipv value
	if (document.formFillMenu.selFillMenu.selectedIndex == 1){
	 	SetPictures(ImgObjArray, ImgOnObjArray, ImgStayObjArray, AfbAntwoorden, RefAntwoorden)
	}
	if (document.formFillMenu.selFillMenu.selectedIndex == 2){
	 	SetPictures(ImgObjArray, ImgOnObjArray, ImgStayObjArray, AfbVerdiepen, RefVerdiepen)
	}
	if (document.formFillMenu.selFillMenu.value == 3){
	 	alert("ik download")
		SetPictures(ImgObjArray, ImgOnObjArray, ImgStayObjArray, AfbDownloaden, RefDownloaden)
	}
	if (document.formFillMenu.selFillMenu.value == 4){
	 	SetPictures(ImgObjArray, ImgOnObjArray, ImgStayObjArray, AfbZoeken, RefZoeken)
	}
	RefreshImg()
}

//function SetA(aaa){
//aaa=6
//alert("inFunctie: " + aaa)
//}

function initiate(){    
	if (navigator.appVersion.indexOf("2.") != -1){check = false;}
	if ((navigator.appVersion.indexOf("3.") != -1) && (navigator.appName.indexOf("Explorer") != -1)){check = false;}
	else {check = true;}
	//om preloaden van afbeeldingen
	if (check == true){
 		imageStay = ""
	 	SetPictures(ImgObjArray, ImgOnObjArray, ImgStayObjArray, AfbKennismaken, RefKennismaken)
		RefreshImg()
	}	
}

function RefreshImg(){
	imageStay=""
	for(i = 1; i <= 7; i++){
		off('image' + i)
	}
}


function SetPictures(Rij, RijOn, RijStay, RijImgSrc, RijImgRef){
	for(i =0; i<=(RijImgSrc.length-1); i++){
		Rij[i].src = RijImgSrc[i] + ".gif"
		RijOn[i].src = RijImgSrc[i] + "1.gif"
		RijStay[i].src = RijImgSrc[i] + "1.gif"
		document.links[i].href = RijImgRef[i]
	}
	for (i=RijImgSrc.length; i <= Rij.length-1; i ++){
		Rij[i].src = "wp.gif"
		RijOn[i].src = "wp.gif"
		RijStay[i].src = "wp.gif"
	}
}

function on(name){
	//alert(name)
	if (check == true){
			 if (imageStay != name){document[name].src = eval(name + "on.src");}
	}
}

function off(name){
	if (check == true){
		if (imageStay != name){document[name].src = eval(name + ".src");}	
	}
}

function stay(name){
	if (check == true){
		document[name].src = eval(name + "stay.src");
		if (imageStay != name){
			if (imageStay != ""){
				document[imageStay].src = eval(imageStay + ".src");
			}
		}
		imageStay = name
	}
}

//DIT HERSCRIJFT DE TABEL (een keer bij opladen, vervolgens als er onClickevent van selectiebox)
//kan weg
function FillMenuOud(hrefs){
//	for(i = 1;i <= aantal; i++){
		parent.frames[3].document.open()
		parent.frames[3].document.write("<SCRIPT LANGUAGE = JAVASCRIPT SRC=\"massage.js\"></script>")
//<A HREF="menu-kennismaken.html" TARGET="menutwee" OnMouseOver="on('image1');"  OnMouseOut="off('image1');" OnClick="stay('image1');"><IMG NAME="image1" BORDER=0 ALT="" >	
//menutwee veranderd in nmenu
		parent.frames[3].document.write("<A HREF=" + hrefs[0] + " TARGET=nmenu OnMouseOver=\"on('image1')\"> <IMG SRC=" + ImgObjArray[0].src + "></a>")
		parent.frames[3].document.close()
//	} 
	
}



//een frame herladen binnen zijn normale frameset
function checkIt(){
if  (document.location==top.location)
   window.location.href="http://www.capriool.nl/protosite/massage/index.html";
  }



