// JavaScript Document
/*
  Deze functie moet je aanpassen om alles te laten werken!!
*/
function setMenu(id){ // BvO v3.1 Active State zetten
  var xi = document.getElementById(id); 
  if (xi) {
    var classDinges = document.getElementById(id).className;
    var act = classDinges+" act";
    document.getElementById(id).className = "act"; 
  }
  else {
	  return;
  }
}

function GetSection(id) { //BvO v2.1 Filteren op URL (AllOnline)(met Priscilla hack!!)
  var query = window.location.href; 
  var pairs = query.split("/"); 
  var lengte = pairs.length; 
  var section = pairs[lengte-1].split("."); 
  if(section!=null){ 
    var convert = section[0].replace("_","-");//(Priscilla Hack)
    var section2 = convert.split("-");
	if (section2!=null){
	  if (id != null || id != "") {
		return section2[id];	
	  }
	  else {
        return section2[0];
	  }
    }
	else {
      return false;
    }
  }
  else {
    return false;
  }
}

function showActive() { //BvO v2.0 activeren Active state
var s = GetSection('0');
var s1 = GetSection('1');
  if (s!=null && s!="") {
      setMenu(s);
	    if (s1!=null && s1!="") {
		  	setMenu(s1);
		}
  }else{
	  setMenu('home');
    return;
  }
}

