var activeButton = "button0" function init(){ buttonOn(document.getElementById("button0")); } function buttonOn(obj){ obj.className = "buttonPressed"; } function buttonOff(obj){ if (activeButton != obj.id){ obj.className = "buttonNormal"; } } function buttonClick(obj){ //activate the newly pressed button and goto prefered link //todo: get this stuff from db! buttonOn(obj); activeButton = obj.id; buttonNr = activeButton.substring(6); //substring is id minus the word "button" document.location.href = "/index.php?ptv="+buttonNr; //deselect all other items, so only the newly selected one will be "active" menu = document.getElementById('menu'); els = menu.getElementsByTagName('div'); for (var i=0; i