function toggle(id) {
  if (document.getElementById) {
  	if (window.name.charAt(id) == '0')  {
  	  window.name = exchange(window.name, 1, id.charCodeAt(0)-48);
  	  document.getElementById(String.fromCharCode(48+id.charCodeAt(0))).style.display = "block";
  	}
  	else {
  		window.name = exchange(window.name, 0, id.charCodeAt(0)-48);
  		document.getElementById(String.fromCharCode(48+id.charCodeAt(0))).style.display = "none";
		}      		
  }
}

function initNavigation() {
  if (window.name.length != 32) window.name = "00000000000000000000000000000000";  
	if (window.name.charAt(1) == '0')
		document.getElementById("a").style.display = "none";
	else document.getElementById("a").style.display = "block";
	
	if (window.name.charAt(2) == '0')
		document.getElementById("b").style.display = "none";
	else document.getElementById("b").style.display = "block";

	if (window.name.charAt(3) == '0')
		document.getElementById("c").style.display = "none";
	else document.getElementById("c").style.display = "block";
	
	if (window.name.charAt(4) == '0')
		document.getElementById("d").style.display = "none";
	else document.getElementById("d").style.display = "block";
	
	if (window.name.charAt(5) == '0')
		document.getElementById("e").style.display = "none";
	else document.getElementById("e").style.display = "block";		

	if (window.name.charAt(6) == '0')
		document.getElementById("f").style.display = "none";
	else document.getElementById("f").style.display = "block";
}

function exchange(s, c, i) {
  return s.substring(0,i) + c + s.substring(i+1, 32);
}

