/******************************************************************

Copyright © Global Knowledge Software LLC 2006.  All Rights Reserved.

This program is protected by U.S. and International Copyright and
Patent Laws.  Unauthorized duplication and/or distribution of this
program is strictly prohibited. Distribution and duplication of this
program are limited by license. If you do not currently have a valid
license from Global Knowledge for this program, any copying or
distribution of the program is unauthorized.  If you do have a current
license from Global Knowledge to utilize this program, your use is
strictly limited by the terms of that license.

Patent Pending.

******************************************************************/
//
// Browser-independent object access (NS4, IE5+, Mozilla)
//

function getDIV(id)
{
  if(document.all)
    return document.all(id);
  else if(document.getElementById)
    return document.getElementById(id);
  else if(document.layers)
  {
    var obj = document.layers.screen.document.layers[id]
    if(!obj)
      obj = document.layers[id]
    return obj
  }
  return 0;
}

function getDIVstyle(id)
{
  if(document.all)
    return document.all(id).style;
  else if(document.getElementById)
    return document.getElementById(id).style;
  else if(document.layers)
  {
    var obj = document.layers.screen.document.layers[id]
    if(!obj)
      obj = document.layers[id]
    return obj
  }
  return 0;
}

function shiftTo(id, x, y)
{
  var obj = getDIVstyle(id)
  if(obj.moveTo)
  {
    obj.moveTo(x,y)
  }
  else
  {
    obj.left = x + "px"
    obj.top = y + "px"
  }
}

function getObjHeight(id)
{
  var obj = getDIV(id)
  if(obj.clip)
  {
    return obj.clip.height
  }
  else
  {
    return obj.offsetHeight
  }
}

function getObjWidth(id)
{
  var obj = getDIV(id)
  if(obj.clip)
  {
    return obj.clip.width
  }
  else
  {
    return obj.offsetWidth
  }
}

function getObjLeft(id)
{
  var obj = getDIVstyle(id)
  if(obj.pixelLeft)
  {
    return obj.pixelLeft
  }
  else
  {
    return parseInt(obj.left)
  }
}

function getObjTop(id)
{
  var obj = getDIVstyle(id)
  if(obj.pixelTop)
  {
    return obj.pixelTop
  }
  else
  {
    return parseInt(obj.top)
  }
}


function getInsideWindowWidth()
{
  if(window.innerWidth)
  {
    return window.innerWidth
  }
  else
  {
    return document.body.clientWidth
  }
}

function getInsideWindowHeight()
{
  if(window.innerHeight)
  {
    return window.innerHeight
  }
  else
  {
    return document.body.clientHeight
  }
}

function getScrollLeft()
{
  if(window.pageXOffset || window.pageXOffset==0)
  {
    return window.pageXOffset
  }
  else
  {
    return document.body.scrollLeft
  }
}

function getScrollTop()
{
  if(window.pageYOffset || window.pageYOffset==0)
  {
    return window.pageYOffset
  }
  else
  {
    return document.body.scrollTop
  }
}

function show(id)
{
  var obj = getDIVstyle(id)
  obj.visibility = "visible"
}

function hide(id)
{
  var obj = getDIVstyle(id)
  obj.visibility = "hidden"
}

