//functie als de muispointer OVER een hoofdmenu item komt
function m_over(menu_item){
	if(vorige_geselecteerd != ""){
	m_out(vorige_geselecteerd); // toevoeging voor vijf
}
start_waarden();
	for(i=0; i<submenu.length; i++){
					document.getElementById(submenu[i]).style.display = 'none';
				}
				document.getElementById(submenu[(menu_item.id)-1]).style.display = 'block';
	if(tselected == menu_item.id){
	}else{
		switch(menu_item.id){
			case "1":
				menu_item.style.backgroundImage = 'url(opmaak/hm_images/hm_o_bgr.jpg)';
				
				document.getElementById(tst[(menu_item.id)-1]).style.backgroundImage = 'url(opmaak/hm_images/hm_o_begin2.jpg)';
				if(menu_item.id == tselected-1){
					document.getElementById(tst[(menu_item.id)]).style.backgroundImage = 'url(opmaak/hm_images/hm_o_einde.jpg)';
				}else{
					document.getElementById(tst[(menu_item.id)]).style.backgroundImage = 'url(opmaak/hm_images/hm_o_tst_r.jpg)';
				}
				break

			case "10": // deze waarde moet gelijk zijn aan het aantal items in het hoofdmenu
				menu_item.style.backgroundImage = 'url(opmaak/hm_images/hm_o_bgr.jpg)';
				if(menu_item.id == tselected+1){
					document.getElementById(tst[(menu_item.id)-1]).style.backgroundImage = 'url(opmaak/hm_images/hm_o_b2.jpg)';
				}else{
					document.getElementById(tst[(menu_item.id)-1]).style.backgroundImage = 'url(opmaak/hm_images/hm_o_tst_l.jpg)';
				}
				
				document.getElementById(tst[(menu_item.id)]).style.backgroundImage = 'url(opmaak/hm_images/hm_o_einde.jpg)';
				document.getElementById(tst[(menu_item.id)]).style.width = 19;
				break
			
			default:
				menu_item.style.backgroundImage = 'url(opmaak/hm_images/hm_o_bgr.jpg)';

				if(menu_item.id == tselected+1){
					document.getElementById(tst[(menu_item.id)-1]).style.backgroundImage = 'url(opmaak/hm_images/hm_o_b2.jpg)';
				}else{
					document.getElementById(tst[(menu_item.id)-1]).style.backgroundImage = 'url(opmaak/hm_images/hm_o_tst_l.jpg)';
				}
			
				if(menu_item.id == tselected-1){
					document.getElementById(tst[(menu_item.id)]).style.backgroundImage = 'url(opmaak/hm_images/hm_o_einde.jpg)';			
				}else{
					document.getElementById(tst[(menu_item.id)]).style.backgroundImage = 'url(opmaak/hm_images/hm_o_tst_r.jpg)';
				}
				break
				break
		}
	}
	
	vorige_geselecteerd = huidige_geselecteerd;
}

//functie als de muispointer WEGGAAT van een hoofdmenu item
function m_out(menu_item){
	if(tselected == menu_item.id){
	}else{
		switch(menu_item.id){
			case "1":
				menu_item.style.backgroundImage = 'url(opmaak/hm_images/hm_bgr.jpg)';
				
				document.getElementById(tst[(menu_item.id-1)]).style.backgroundImage = 'url(opmaak/hm_images/hm_begin.jpg)';
				if(menu_item.id == tselected-1){
					document.getElementById(tst[(menu_item.id)]).style.backgroundImage = 'url(opmaak/hm_images/hm_e2.jpg)';
				}else{
					document.getElementById(tst[(menu_item.id)]).style.backgroundImage = 'url(opmaak/hm_images/hm_tst.jpg)';
				}
				break
		
			case "10": // deze waarde moet gelijk zijn aan het aantal items in het hoofdmenu
				menu_item.style.backgroundImage = 'url(opmaak/hm_images/hm_bgr.jpg)';
				
				if(menu_item.id == tselected+1){
					document.getElementById(tst[(menu_item.id)-1]).style.backgroundImage = 'url(opmaak/hm_images/hm_b2.jpg)';
				}else{
					document.getElementById(tst[(menu_item.id)-1]).style.backgroundImage = 'url(opmaak/hm_images/hm_tst.jpg)';
				}
			
				document.getElementById(tst[(menu_item.id)]).style.backgroundImage = 'url(opmaak/hm_images/hm_e2.jpg)';
				break
		
			default:
				menu_item.style.backgroundImage = 'url(opmaak/hm_images/hm_bgr.jpg)';
				
				if(menu_item.id == tselected+1){
					document.getElementById(tst[(menu_item.id)-1]).style.backgroundImage = 'url(opmaak/hm_images/hm_b2.jpg)';
				}else{
					document.getElementById(tst[(menu_item.id)-1]).style.backgroundImage = 'url(opmaak/hm_images/hm_tst.jpg)';
				}
			
				if(menu_item.id == tselected-1){
					document.getElementById(tst[(menu_item.id)]).style.backgroundImage = 'url(opmaak/hm_images/hm_e2.jpg)';
				}else{
					document.getElementById(tst[(menu_item.id)]).style.backgroundImage = 'url(opmaak/hm_images/hm_tst.jpg)';
				}
				break
				break
		}
	}
}


function start_waarden(){
//alert("start waarden");
	if(tselected != ""){
		switch (tselected){
			case 1:
				document.getElementById(tselected).style.backgroundImage = 'url(opmaak/hm_images/)';
				document.getElementById(tst[tselected-1]).style.backgroundImage = 'url(opmaak/hm_images/hm_s_begin.jpg)';
				document.getElementById(tst[tselected-1]).style.width = 22;
				document.getElementById(tst[tselected]).style.backgroundImage = 'url(opmaak/hm_images/hm_b2.jpg)';
				document.getElementById(submenu[(tselected)-1]).style.display = 'block';
				break
			case 10: // deze waarde moet gelijk zijn aan het aantal items in het hoofdmenu
				document.getElementById(tselected).style.backgroundImage = 'url(opmaak/hm_images/)';
				document.getElementById(tst[tselected-1]).style.backgroundImage = 'url(opmaak/hm_images/hm_e2.jpg)';
				document.getElementById(tst[tselected]).style.backgroundImage = 'url(opmaak/hm_images/)';
				document.getElementById(submenu[(tselected)-1]).style.display = 'block';
				break
			default:
				document.getElementById(tselected).style.backgroundImage = 'url(opmaak/hm_images/)';
				document.getElementById(tst[tselected-1]).style.backgroundImage = 'url(opmaak/hm_images/hm_e2.jpg)';
				document.getElementById(tst[tselected]).style.backgroundImage = 'url(opmaak/hm_images/hm_b2.jpg)';
				document.getElementById(submenu[(tselected)-1]).style.display = 'block';
				break
		}
	}
}