var MTime = 500;
var elem = null;
var parent_elem =null;
var MTimeID;


function hide() {
  if (elem != null) {
    elem.style.visibility = "hidden";
  }
}

function klik(elemId) {
  if (elemId != null) {
    elem = document.getElementById(elemId);
    elem.style.visibility = "visible"; 
    elem.style.position = "";
    
    elem.onmouseout = function() {
      setTimeout('hide()', MTime);
    }
    
  }
}

function slideup(boxid, boxfather) {
  if (boxid != null && boxfather != null) {
    _box = document.getElementById(boxid);
    _box.style.visibility = "hidden";
    _box.style.position = "absolute";	
    
    _boxfather = document.getElementById(boxfather);
    _boxfather.style.visibility = "visible";
  }
}

function slidedown(boxid, boxfather) {
  if (boxid != null && boxfather != null) {
    _boxfather = document.getElementById(boxfather);
    _boxfather.style.visibility = "hidden";
     
    _box = document.getElementById(boxid);
    _box.style.visibility = "visible";
    _box.style.position = "relative";	   

    _box.onmouseover = function() {
      clearTimeout(MTimeID);
    }

    _box.onmouseout = function() {
      MTimeID = setTimeout('slideup("'+boxid+'","'+boxfather+'")', 1);
    } 
    
    _boxfather.onmouseover = function() {
      clearTimeout(MTimeID);
    }
    
    _boxfather.onmouseout = function () {
          MTimeID = setTimeout('slideup("'+boxid+'","'+boxfather+'")', 1);
    } 

 }
}
