var timeoutid = new Array()
var speed = 1000;

function clear_t() {
  for (var i in timeoutid){
    if (timeoutid[i] != 0) {
      clearTimeout(timeoutid[i]);
      if (document.getElementById(i))
        timeoutid[i] = setTimeout("document.getElementById('"+i+"').style.visibility = 'hidden'",10);      
    }
  }
}
function shw(elem) {
  clearTimeout(timeoutid["s"+elem.id]);
  timeoutid["s"+elem.id] = 0;
  clear_t();
  if (document.getElementById("s"+elem.id))
    document.getElementById("s"+elem.id).style.visibility = "visible";
}
function hde(elem) {
  if (document.getElementById("s"+elem.id))
    timeoutid['s'+elem.id] = setTimeout("document.getElementById('s"+elem.id+"').style.visibility = 'hidden'",speed);
}
function shw_sub(elem) {
  clearTimeout(timeoutid[elem.id]);
  timeoutid[elem.id] = 0;  
}
function hde_sub(elem) {
  if (document.getElementById(elem.id))
    timeoutid[elem.id] = setTimeout("document.getElementById('"+elem.id+"').style.visibility = 'hidden'",speed);
}
