/*
  Handle mouse click on a menu (header)
*/

function menuClick(my_id,container_id,the_url){		  
	menucontainer=document.getElementById(container_id);
  if(menucontainer.style.display=="block") {
    menucontainer.style.display="none";
    my_id.className=my_id.className.replace(/ wm-open/g,' wm-closed');
  }	else {
    menucontainer.style.display="block";
    my_id.className=my_id.className.replace(/ wm-closed/g,' wm-open');
  }
}

/*
 * Handle mouse click on a menu (item)
 */	  	
function itemClick(the_url){	  	  
  window.location=the_url;
}

 /**
 * Hover emulator. 
 * Since IE doesn't support hovering we have to do this ourselves for the webpage tree
 */

function Hover(my_id,level){
    my_id.className+=' wm-hover-'+level;
}

function unHover(my_id){
  my_id.className=my_id.className.replace(/ wm-hover-./g,'');
}

/**
* Hover effects for the menu
*/

function menuHover(my_id){  
  my_id.className+=' menu-hover';
}

function menuUnHover(my_id){
  my_id.className=my_id.className.replace(/ menu-hover/g,'');
}


/**
* Loading of the page; focus the first non-hidden field.
*/

function onLoad() {
  if (document.Edit) {
    for (i=0;i<document.Edit.elements.length;i++) {
      if(document.Edit.elements[i].type!='hidden'){
        document.Edit.elements[i].focus();
        break;
      }    
    }  
  }
}