
//http://www.fabrique.nl

//framebuster
if (window!= top)top.location.href=location.href;

//flash check
function getE(el){return document.getElementById(el);}

function hasMinFlashVersion(versionNumber){
    var appN = navigator.appName.toLowerCase();
	if (appN.indexOf('microsoft') != -1 && appN.indexOf('opera') == -1 &&
		  navigator.userAgent.toLowerCase().indexOf('windows') != -1){
		try{
			var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + versionNumber);
			return 1;
		}
		catch(e){
			return 0;
		}
	}
	else {
		if(navigator.plugins.length){
			for (var i=0; i < navigator.plugins.length; i++){
				var pluginIdent = navigator.plugins[i].description.split(" ");
				if(pluginIdent[0] == "Shockwave" && pluginIdent[1] == "Flash"){
					var versionArray = pluginIdent[2].split(".");
					return versionArray[0] >= versionNumber;
				}
			}
		}
	}
	return 0;
}
  var properVersion = hasMinFlashVersion(7);
	if (!properVersion){
		document.write ('<style type="text/css">#home #header{ background: url(images/background_home_header.gif) #666666 no-repeat !important;}</style>');
}

//nav
var activeSubMenu;
activeSub = function(id) {
  var subnav = document.getElementById(id);
  if (!subnav){return;}
	var e = subnav.getElementsByTagName("DIV");
	for (var i=0; i<e.length; i++) {
		if (e[i].parentNode.className.indexOf('active') != -1){
			activeSubMenu = e[i];
		}
		e[i].onclick = function() {
			var oldActiveSubMenu = activeSubMenu;
			activeSubMenu = null;
			if (oldActiveSubMenu){
				oldActiveSubMenu.onclick();
			}
			this.parentNode.className = this.parentNode.className.indexOf('active') != -1 ? '' : 'active';
			activeSubMenu = this;
		}
	}
	//navFocus(id);
}
/*navFocus = function(id){
  var subnav = document.getElementById(id);
  var list = subnav.getElementsByTagName("A");
  for (var i = 0; i < list.length; i++){
    var e = list[i];
    if (e.parentNode.parentNode.id == id){
    e.onfocus = function(){this.parentNode.childNodes[0].onclick();}
    }
  }
}*/
  
//mdi, client side selector
function showActiveMenu(id){	
  var list = document.getElementById(id).getElementsByTagName('A');
  var loc = location.href;
  if(loc.charAt(loc.length-1) == '/'){
    loc = loc + 'index.htm';
  }
  for (var i = 0; i < list.length; i++){
    if (list[i].href == loc){
      var p = list[i];
      var pClassName = 'active';
      while (p.id != id){
        if (p.tagName == 'LI'){
           p.className = pClassName;
           pClassName = 'active';
        }
        p = p.parentNode;
      }
      return;
    }
  }
}
  window.onload = function(){
   if (document.getElementById('subnav') != null)showActiveMenu('subnav');activeSub('subnav');
  }