  function shide ( which ) {
    document.getElementById('sub' + which).style.display = 'none';
  }

  function sinit ( which, dir ) {
    var child = document.getElementById('sub' + which);
    
	
    child.style.top = '80%';
    child.style.left = '100%';
    child.style.display = '';
  }

  function hide ( which ) {
    document.getElementById('sub' + which).style.display = 'none';
  }

  function init ( which, dir ) {
    var parent = document.getElementById(which);
    var child = 'sub' + which;
    
    switch ( dir ) {
      case 'h':
        var top  = 0;
        var left = parent.offsetWidth;
        break;

      case 'v':
        var top  = parent.offsetHeight;
        var left = 0;
        break;
    }
	
    while ( true ) {
      top  += parent.offsetTop;
      left += parent.offsetLeft;

      if ( parent.tagName != 'BODY' ) {
         parent = parent.offsetParent;
      }
      else { break; }
    }
    
    document.getElementById(child).style.top     = top + 'px';
    document.getElementById(child).style.left    = left + 'px';
    document.getElementById(child).style.display = '';

    try {
      document.getElementById(child).style.width   = document.getElementById(which).clientWidth + 'px';
    }
    catch ( ignore ) {}
  }

