var showmenu = 0;
var hide_timer = 0;

function sMenu(id, action){
  window.status = id + ' a ' + action;
  // show specified element
  if (action=="show") {
    if(hide_timer) {
    	window.clearTimeout(hide_timer); hide_timer=0;
    }
    _hmenu();
    if (document.getElementById(id))
     $('#'+id).show();
  } else {
    if(showmenu==2) showmenu=1;
    else  if(!hide_timer) {
    	hide_timer=window.setTimeout('_hmenu()',500);
    }
    // hide all elements

  }
}


function hMenu(){
  window.status = "hide "+showmenu;
  if(showmenu==0 && !hide_timer) {
    hide_timer=window.setTimeout('_hmenu()',500);
  }
  else {
  	showmenu=0;
  	window.setTimeout('hMenu()',1000);
  }
}

function _hmenu() {
  window.status = "_hide";
  $("div.pagemenu").hide();
  hide_timer=0;
}

function chLang(obj) {
  location.href=obj.value;
}