var submenu = '';
var t = null;

function show(id){
	clearTimeout(t);
	if(submenu == id) return;
	else if(submenu != '') destroy(submenu);
	
  var o_obj = document.getElementById(id);
	if(o_obj == null) return;

	o_obj.style.zIndex = 1000;
	o_obj.style.display = 'block';

	submenu = id;
}

function hide(id){
	t = setTimeout ( "destroy('"+id+"')", 500);
}

function destroy(id){
	clearTimeout(t);
	var o_obj = document.getElementById (id);
	if ( o_obj == null ) return;
	o_obj.style.display = 'none';
	submenu = '';
}
