

var popup_window = null;
var netXOffset    = 0;
var netYOffset    = 0;



function findPosX( obj )
{
  var curleft = 0;

  if( document.getElementById || document.all )
  {
    while( obj.offsetParent )
    {
      curleft += obj.offsetLeft;
      obj      = obj.offsetParent;
    }
  }
  else
  if( document.layers )
  {
    curleft += obj.x;
  }

  return( curleft );
}

function findPosY( obj )
{
  var curtop = 0;

  if( document.getElementById || document.all )
  {
    while( obj.offsetParent )
    {
      curtop += obj.offsetTop;
      obj     = obj.offsetParent;
    }
  }
  else
  if( document.layers )
  {
    curtop += obj.y;
  }

  return( curtop );
}

function getX( o )
{
  var x = 0;

  var o_string = "window.document." + o;
  var o_div    = eval( o_string );

  x = findPosX( o_div );

  return( x + netXOffset );
}

function getY( o )
{
  var y = 0;

  var o_string = "window.document." + o;
  var o_div    = eval( o_string );

  y = findPosY( o_div );

  return( y + netYOffset );
}

function setpic( bg, the_div_name, offx, offy )
{
  var the_div, div_string;
  var o;
  var gx, gy;

  gx = getX( bg );
  gy = getY( bg );

  if( navigator.appName == "Netscape" )
  {
    gx = gx - netXOffset;
    gy = gy - netYOffset;
  }

  if( (document.all) || (document.getElementById) )
  {
    o = document.getElementById( the_div_name );
    o.style.left = gx + offx + "px";
    o.style.top  = gy + offy + "px";
  }
  else
  if( document.layers )
  {
    div_string = "window.document." + the_div_name;
    the_div    = eval( div_string );

    the_div.left = gx + offx;
    the_div.top  = gy + offy;
  }
  else
  {
    alert( "unsupported browser" );
  }
}

function getStyleObject( objectId )
{
    // checkW3C DOM, then MSIE 4, then NN 4.

  if( document.getElementById && document.getElementById( objectId ) )
  {
    return( document.getElementById( objectId ).style );
  }
  else
  if( document.all && document.all( objectId ) )
  {
    return( document.all( objectId ).style );
  }
  else
  if( document.layers && document.layers[ objectId ] )
  {
    return( document.layers[ objectId ] );
  }
  else
  {
    return( false );
  }
}



