// JavaScript Document

var nowid=0;
function show_menu(sid) {
	if(document.getElementById('s'+sid)) {
		if (document.getElementById(nowid)) document.getElementById(nowid).style.visibility='hidden';
		document.getElementById('s'+sid).style.visibility='visible';
	}
}

function hide_menu(sid) {
	if(document.getElementById('s'+sid)) {
		if (document.getElementById(nowid)) document.getElementById(nowid).style.visibility='visible';
		document.getElementById('s'+sid).style.visibility='hidden';
	}
}

function show_down(did) {
	if (document.getElementById(nowid)) document.getElementById(nowid).style.visibility='hidden';
	document.getElementById(did).style.visibility='visible';
}

function hide_down (did) {
	if (document.getElementById(nowid)) document.getElementById(nowid).style.visibility='visible';
	document.getElementById(did).style.visibility='hidden';
}

function init() {
	var all_div = document.getElementsByTagName("div");
	for (var i=0; i<all_div.length; i++) {
		var new_div = all_div[i];
		if (new_div.className=="g-menu" || new_div.className=="g-menu-on" ) {
			if (new_div.id) {
				new_div.onmouseover=function(){show_menu(this.id)};
				new_div.onmouseout=function(){hide_menu(this.id)};
			}
		}
		if (new_div.className=="down") {
			if (new_div.id) {
				new_div.onmouseover=function(){show_down(this.id)};
				new_div.onmouseout=function(){hide_down(this.id)};
			}
		}
	}
}

window.onload=init;

function hosm(oid) {
 if(document.getElementById(oid).style.display=="none") {
  document.getElementById(oid).style.display="block";
 }
 else {
  document.getElementById(oid).style.display="none";
 }
}

