// JavaScript Document for Homepage

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function ShowMenu(name) {

	if (!document.styleSheets) {
		alert('no stylesheets found');
		return;
	}
	
	var theRules = new Array();
	if (document.styleSheets[1].cssRules)
		theRules = document.styleSheets[1].cssRules
	else if (document.styleSheets[1].rules)
		theRules = document.styleSheets[1].rules
	else return;

	MM_swapImage(name,'','/gfx/jpg/voorkant_' + name + '_over.jpg',1);

	//alert([theRules.length-1]);

	switch(name) {
		case 'home': 
			theRules[0].style.visibility = 'visible';
			break
        case 'utiliteitsbouw':   
			theRules[1].style.visibility = 'visible';
			break
        case 'woningbouw':
			theRules[2].style.visibility = 'visible';
			break
	 	case 'renovatie':   
			theRules[3].style.visibility = 'visible';
			break
		case 'actueel':   
			theRules[4].style.visibility = 'visible';
			break
		case 'contact':   
			theRules[5].style.visibility = 'visible';
			break
        default: 
			alert("Please update your switch statement\nDidn\'t find the stylesheet for" + name);         
	}
	
}

function HideMenu() {
	
	if (!document.styleSheets) {
		return;
	}
	var theRules = new Array();
	if (document.styleSheets[1].cssRules)
		theRules = document.styleSheets[1].cssRules
	else if (document.styleSheets[1].rules)
		theRules = document.styleSheets[1].rules
	else return;
	//theRules[theRules.length-1].style.visibility = 'hidden';
	theRules[0].style.visibility = 'hidden';
	theRules[1].style.visibility = 'hidden';
	theRules[2].style.visibility = 'hidden';
	theRules[3].style.visibility = 'hidden';
	theRules[4].style.visibility = 'hidden';
	theRules[5].style.visibility = 'hidden';

	MM_swapImgRestore();
}
