xpwbxul84n=xppr('xul84_0.gif');xpwbxul84o=xppr('xul84_1.gif');xpwbxul84c=xppr('xul84_2.gif');xpwbsul84n=xppr('sul84_0.gif');xpwbsul84o=xppr('sul84_1.gif');xpwbsul84c=xppr('sul84_2.gif');xpwb4ul84n=xppr('4ul84_0.gif');xpwb4ul84o=xppr('4ul84_1.gif');xpwb4ul84c=xppr('4ul84_2.gif');xpwbtul84n=xppr('tul84_0.gif');xpwbtul84o=xppr('tul84_1.gif');xpwbtul84c=xppr('tul84_2.gif');xpwbpul84n=xppr('pul84_0.gif');xpwbpul84o=xppr('pul84_1.gif');xpwbpul84c=xppr('pul84_2.gif');xpwbbul84n=xppr('bul84_0.gif');xpwbbul84o=xppr('bul84_1.gif');xpwbbul84c=xppr('bul84_2.gif');xpwb7ul84n=xppr('7ul84_0.gif');xpwb7ul84o=xppr('7ul84_1.gif');xpwb7ul84c=xppr('7ul84_2.gif');xpwbyul84n=xppr('yul84_0.gif');xpwbyul84o=xppr('yul84_1.gif');xpwbyul84c=xppr('yul84_2.gif');xpwb8ul84n=xppr('8ul84_0.gif');xpwb8ul84o=xppr('8ul84_1.gif');xpwb8ul84c=xppr('8ul84_2.gif');xpwblul84n=xppr('lul84_0.gif');xpwblul84o=xppr('lul84_1.gif');xpwblul84c=xppr('lul84_2.gif');xpwbdul84n=xppr('dul84_0.gif');xpwbdul84o=xppr('dul84_1.gif');xpwbdul84c=xppr('dul84_2.gif');xpwbuul84n=xppr('uul84_0.gif');xpwbuul84o=xppr('uul84_1.gif');xpwbuul84c=xppr('uul84_2.gif');xpwbful84n=xppr('ful84_0.gif');xpwbful84o=xppr('ful84_1.gif');xpwbful84c=xppr('ful84_2.gif');
  // Menu Type 2
  function xppr(im)
  {
    var i=new Image();
    i.src='index.htm.images/bt'+im;
    return i;
  }

  function xpe(id)
  {
    x=id.substring(0,id.length-1);
    if(document['xpwb'+x])
    {
    document['xpwb'+x].src=eval('xpwb'+id+'.src');
        if (id.indexOf('e')!=-1)
      document['xpwb'+x+'e'].src=eval('xpwb'+id+'e.src');
    }
    return false;
  } 


 function xpinit()
 {
   var o, i, uls = document.getElementsByTagName('UL');
   for (i=0, cnt=uls.length; i<cnt; i++)
     if (uls[i].id && uls[i].id.substring(0, 7)=='xpwbUL_')
     {
        o=uls[i];
        if (o)
        {
            var lis = o.getElementsByTagName('LI');
            for (var k=0; k<lis.length; k++)
            {
              lis[k].onmouseover = function (){ this.className = 'over'; }
              lis[k].onmouseout  = function (){ this.className = ''; }
            }
        }
     }
 }
 
 xpinit();

  /**
   * It searchs the parent
   *
   * @param _object object
   * @return unique variable from table-id
   *
   */
  function xpgetparent( _object )
  {
    var _id = null;
    while ( _object && _object.tagName != 'TABLE' ) _object = _object.parentNode;
    if ( _object.id && _object.id.indexOf(':') != -1 ) _id  = _object.id.split(':')[1];
    return _id;
  }
  
  function xpshow(ind, isVertical, _id)
  {
    if (xobtn != ind) xphide();
	
    // create unique variable
    _id = xpgetparent( _id );
    if ( !_id ) return;
    if ( global[ _id ] ) global[ _id ] = null;
    global[ _id ] = document.getElementById('xpwbUL_'+ind);
    xpsm = global[ _id ];
	
    // it saves button
    xobtn = ind;
    if (!xpsm) return;

    var img = document.getElementById('xpi_'+ind);
    var pos = xppos(img);

    if (isVertical)
    {
      xpsm.style.left = pos[0] + img.width + 'px';
      xpsm.style.top  = pos[1] + 'px';
    }
    else
    {
      xpsm.style.left = pos[0] + 'px';
      xpsm.style.top  = pos[1] + img.height + 'px';
    }

    xpsm.style.visibility = 'visible';
  }


  function xphide()
  {
    if ( xpsm )
    {
      if (xpsmt)
        clearTimeout(xpsmt);

      xpsm.style.visibility = 'hidden';
      xpsm = null;
      // clear selected
      xpe(xobtn + 'n');
    }
  }


  function xpsmout()
  {
    if ( xpsm )
    {
      xpsmt = setTimeout( 'xphide();', 1000);
    }
    else
    {
      // clear selected
      xpe(xobtn + 'n');
    } 
  }

  function xpsmover()
  {
    if (xpsmt)
      xpsmt = clearTimeout(xpsmt);
  }

  function xppos(o)
  {
    var l=0, t=0;
    while (o)
    {
      l += o.offsetLeft;
      t += o.offsetTop;
      o = o.offsetParent;
    }
    return [l, t];
  }

  // init global vars
  if (!global) var global = this;
  var xpsm  = null;
  var xpsmt = null;
  var xobtn = null;
