function menu_click(location) {
	document.location.href=location;
}

function changeImage(nr) {
	element = document.getElementById('main_image');
	element.src = "gallery/" + nr + ".jpg";
}

function showSubmenuContent(nr) {
	objHide = document.getElementById('submenu_content_'+selectedSubmenu);
	if (objHide != null) {
		objHide.style.display = "none";
	}
	objShow = document.getElementById('submenu_content_'+nr);
	if (objShow != null) {
		document.getElementById('submenu_content_'+nr).style.display = "";
		selectedSubmenu = nr;
	}
}

function initEvents() {
  if (!document.getElementById) return
	for(var i = 1; i <= submenuNr; i++){
   obj = document.getElementById('submenu_' + i);
   if (obj == null) continue;
   obj.onmouseover = function() {this.className = 'submenu-hover';};
   obj.onmouseout = function() {this.className = 'submenu';};
   obj.onclick = function() {showSubmenuContent(this.id.replace('submenu_', ''));};
  }
  for(var i = 0; i < 7; i++){
   obj = document.getElementById('menu_' + i);
   if (obj == null) continue;
   obj.onmouseover = function() {this.src = this.src.replace(".png", "_over.png");}
   obj.onmouseout  = function() {this.src = this.src.replace("_over.png", ".png");}
  }
}
