/*define variables and functions related to menu handling*/
on_menu = new Array();
/*
old state trackers :
on_menu['group'] = 0;
on_menu['news'] = 0;
*/

on_menu['daher_uk'] = 0;

var TimeoutIds=new Array();
function TimeOutMenu(menu_name){
  if(on_menu[menu_name]==0){
    document.getElementById(menu_name+'_link_menu').style.display='none';
    document.getElementById(menu_name+'_link').style.backgroundImage='';
  }
  clearTimeout(TimeoutIds[menu_name]);
}

function debug(debug_value)
{
  document.getElementById('debug_box').innerHTML += debug_value + "<br />";
}

function root_menu_over(evt)
{
  clearTimeout(TimeoutIds[this.name]);
  if(evt!=undefined){evt==window.event;}
  on_menu[this.name] = 0;
  document.getElementById(this.name+'_link_menu').style.display='block';
}
function root_menu_out(evt)
{
  if(evt!=undefined){evt==window.event;}
  on_menu[this.name] = 0;
  TimeoutIds[this.name]=setTimeout("TimeOutMenu('"+this.name+"')", 100);
}

function menu_container_over(evt)
{
  clearTimeout(TimeoutIds[this.getAttribute("name")]);
  on_menu[this.getAttribute("name")] = 0;
  if(evt!=undefined){evt==window.event;}

  this.style.display='block';
  //document.getElementById(this.getAttribute("name")+'_link').style.backgroundImage='url(/images/menus/'+this.getAttribute("name")+'_over.gif)';
}

function menu_container_out(evt)
{

  if(evt != undefined){evt == window.event;}
  if(on_menu[this.getAttribute("name")] == 1){
    this.style.display = 'none';
    document.getElementById(this.getAttribute("name")+'_link').style.backgroundImage='';
    on_menu[this.getAttribute("name")] = 0;
  }
  TimeoutIds[this.getAttribute("name")]=setTimeout("TimeOutMenu('"+this.name+"')", 50);
}

function menu_element_over(evt)
{

  on_menu[this.getAttribute("name")] = 0;
  if(evt!=undefined){evt==window.event;}
  on_menu[this.name]=0;
}
function menu_element_out(evt)
{
  if(evt!=undefined){evt==window.event;}
  on_menu[this.getAttribute("name")] = 1;
}

