<!--
// Dit javascript is eigendom van Vrecom

var interv1,interv2,interv3,interv4,interv5;
var interv1close,interv2close,interv3close,interv4close,interv5close;
var timeout1;

var closingMenu = '';
var closingMenuContent = '';
var closingMenuHeight = 0;

var activeMenu = "";

var openingMenu = '';
var openingMenuContent = "";
var openingMenuCurrentHeight = 0;
var openingMenuHeight = 0;
var openingMenuWidth = 0;
var busyClosing = false;
var runningOpenIntervals = 0;

function switch_menu(menu_name,e) {
	// (String) menu_name is the div object which holds the submenu items
	// (Event) e is the event, that triggered this action
	
	if ((e.type=='mouseout') && (openingMenu!='')) {
		switch_menu_close();
		return;
	}
	
	if ((e.type=='mouseout') && (activeMenu!="")) {
		timeout1 = window.setTimeout("switch_menu_close();",1000);
		return;
  }
		
	switch_menu_open(menu_name);
	return;
	
  if (activeMenu!=menu_name) {
	  if (activeMenu!="") {
		  window.clearTimeout(timeout1);
		  switch_menu_close(activeMenu); 
		}
	 	switch_menu_open(menu_name);
  } else {
	  if (e.type=='mouseout') {
	 	  
 	  }
  }
}

function switch_menu_open(menu_name) {
	
	
	if (activeMenu==menu_name) {
	  window.clearTimeout(timeout1);
	  return;
  } else if (activeMenu!='') {
	  window.clearTimeout(timeout1);
	  switch_menu_close();
  }
  
  menu_obj = document.getElementById('menu_'+menu_name);
  openingMenu = menu_name;

  table_obj = document.getElementById('menu_'+menu_name+'_table');
  openingMenuHeight = table_obj.clientHeight;
  openingMenuContent = menu_obj.innerHTML;
	openingMenuCurrentHeight = 0;
	menu_obj.innerHTML = '';
	menu_obj.style.height = '0px';
	menu_obj.style.visibility = 'visible';
	
	interv1 = window.setInterval('switch_menu_performOpenOperation()',10);
	interv2 = window.setInterval('switch_menu_performOpenOperation()',10);
	interv3 = window.setInterval('switch_menu_performOpenOperation()',10);
	interv4 = window.setInterval('switch_menu_performOpenOperation()',10);
	interv5 = window.setInterval('switch_menu_performOpenOperation()',10);
  runningOpenIntervals = 5;
}


function switch_menu_close() {
	
	if (activeMenu!='') {
	  menu_obj = document.getElementById('menu_'+activeMenu);
	  table_obj = document.getElementById('menu_'+activeMenu+'_table');
	  menu_obj.style.height = '0px';
		menu_obj.style.visibility = 'hidden';
		activeMenu = '';
		return;
  }
	
	if (openingMenu!='') {
		
		stopInterval1();
	  menu_obj = document.getElementById('menu_'+openingMenu);
	  menu_obj.style.height = '0px';
		menu_obj.style.visibility = 'hidden';
		menu_obj.innerHTML = openingMenuContent;
		openingMenu = '';
		return;
  }
  
  
}

function switch_menu_performOpenOperation() {
	menu_obj = document.getElementById('menu_'+openingMenu);
	
	if (openingMenuCurrentHeight < openingMenuHeight) {
		openingMenuCurrentHeight++;
		menu_obj.style.height = String(openingMenuCurrentHeight)+'px';
    if (openingMenuHeight<100) { multiplier=100/openingMenuHeight; } else { multiplier=0; }
		if ((openingMenuCurrentHeight*multiplier)<=90) {
		  set_opacity(menu_obj,(openingMenuCurrentHeight*multiplier));
	  }
	} else {
		runningOpenIntervals--;
		if (runningOpenIntervals==0) {
		  stopInterval1();
		  menu_obj.innerHTML = openingMenuContent;
		  activeMenu = openingMenu;
		  openingMenu = '';
	  }
	}
}

function stopInterval1() {
	// stopping all interv* intervals
	window.clearInterval(interv1);
	window.clearInterval(interv2);
	window.clearInterval(interv3);
	window.clearInterval(interv4);
	window.clearInterval(interv5);
	interv1 = undefined;
	interv2 = undefined;
	interv3 = undefined;
	interv4 = undefined;
  interv5 = undefined;
}

function set_opacity(div, val) {
  if (div.filters) {  // Voor IE
    // val *= 100;
    try {
	    
      div.filters.item("DXImageTransform.Microsoft.Alpha").opacity = val;
    } catch (e) { 
      // Wanneer de filter nog niet gezet was, komt hij in dit catch blok, en zetten wij alsnog een filter
      div.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity='+val+')';
    }
  } else {
    div.style.opacity = val;
    div.style.MozOpacity = val; // Voor oudere browsers zoals van Mozilla
  }
} 

function settxt(txt,spannumber) {
	document.getElementById('span'+String(spannumber)).innerHTML = txt;
}
function settxt2(txt) {
	document.getElementById('span2').innerHTML = document.getElementById('span2').innerHTML+'<br />'+txt;
}
//-->
