//here you place the ids of every element you want.
var ids=new Array('home','opbouw','gebruik','maten', 'pads', 'verkoop');
var btns=new Array('btnhome','btnopbouw','btngebruik', 'btnpads' ,'btnmaten', 'btnverkoop');

function switchid(id){	
  hideallids();
  showdiv(id);
  deactvatedbuttons();
  activatebutton(id);
}

function hideallids(){
  //loop through the array and hide each element by id
  for (var i=0;i<ids.length;i++){
    hidediv(ids[i]);
  }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}

function hidediv(id) {
  //safe function to hide an element with a specified id
  if (document.getElementById) { // DOM3 = IE5, NS6
    document.getElementById(id).style.display = 'none';
  }
  else {
    if (document.layers) { // Netscape 4
      document.id.display = 'none';
    }
    else { // IE 4
      document.all.id.style.display = 'none';
    }
  }
}

/*
function showdiv(id) {
  //safe function to show an element with a specified id
  var timer = 0;
  
  //make object transparant
  changeOpac(0, id);    
  
  if (document.getElementById) { // DOM3 = IE5, NS6
    document.getElementById(id).style.display = 'block';
  }
  else {
    if (document.layers) { // Netscape 4
      document.id.display = 'block';
    }
    else { // IE 4
      document.all.id.style.display = 'block';
    }
  }
  
  //fade in object
  for(i = 0; i <= 100; i++) {
    setTimeout("changeOpac(" + i + ",'" + id + "')",(timer*8));
    timer++;
  }  
}
*/

function showdiv(id) {
  //safe function to show an element with a specified id
  if (document.getElementById) { // DOM3 = IE5, NS6
    document.getElementById(id).style.display = 'block';
  }
  else {
    if (document.layers) { // Netscape 4
      document.id.display = 'block';
    }
    else { // IE 4
      document.all.id.style.display = 'block';
    }
  }
}  


function deactvatedbuttons(){
  for (var i=0;i<btns.length;i++){
    deactivatebutton(btns[i]);
  }		  
}

function deactivatebutton(id) {
  //safe function to hide an element with a specified id
  if (document.getElementById) { // DOM3 = IE5, NS6
    document.getElementById(id).className = 'buttonblue';
  }
}    

function activatebutton(id) {
  //safe function to hide an element with a specified id
  var btnId = 'btn'+id;
  if (document.getElementById) { // DOM3 = IE5, NS6
    document.getElementById(btnId).className = 'buttonblueactive';
  }
}    



