
function CenterIt(theObj)
{
 /*
  This function centers the specified object horizontally
  in the browser window 
 */
 var objWidth
 var winWidth
 var xOffset

 
 // get width of object and window 
 objWidth=GetWidth(theObj);
 winWidth=GetWinWidth();
 // compute X offset needed to center object 
 xOffset=(winWidth-730)/2-15;
 if (xOffset<0)
     xOffset=0;
 MoveBy(theObj, xOffset, 0);
 return;
}

function GetWinWidth ()
{
 /*
  This function returns the current window width 
 */
 
 if (isN4)
  return window.innerWidth;
 else if (isIE)
  return document.body.clientWidth
}

function GetWidth(theObj) 
{
 /*
  This function returns the object's width 
 */
 if (isN4) 
  return theObj.clip.width;
 else if (isIE)
  return theObj.offsetWidth;
}

function MoveBy (movedObj, dx, dy) 
{
 var objLeft
 var objTop
 
 // get object's current position 
 objLeft=GetRealLeft(movedObj);
 objTop=GetRealTop(movedObj);
 // move it by specified amount
 MoveTo (movedObj, objLeft+dx, objTop+dy);
    
 return; 
} 

function MoveTo (movedObj, newLeft, newTop) 
{

 if (isN4)
 {
     movedObj.left = newLeft;
    movedObj.top = newTop;
   }
 else if (isIE)
 {
     movedObj.style.left = newLeft;
    movedObj.style.top = newTop;
   }
    
 return; 
} 

function GetNestedObj ()
{
 var nestedObj
 var args = GetNestedObj.arguments

 if (isN4) 
 {
  nestedObj = window; // the window object
  for (var i = 0; i < args.length; i++) 
  {
   nestedObj = nestedObj.document[args[i]];
  }
 } 
 else if (isIE)
 {
  nestedObj = document.all[args[args.length - 1]];
 }

 return nestedObj;
}


function GetRealLeft (theObj) 
{
 /* 
  This function finds the left coordinate of the specified
  object. It will handle nested elements. 
 */
 
 var leftSide = 0; // initialize coord 

 if (isN4)
     leftSide = theObj.pageX;
   else if (isIE)
   {
    // for IE, loop through any parent elements
     do
      leftSide += theObj.offsetLeft;
    while ((theObj = theObj.offsetParent));
   } return leftSide;
}

function GetRealTop (theObj) 
{
 /* 
  This function finds the top coordinate of the specified
  object. It will handle nested elements. 
 */
 var topSide = 0; // initialize count

 if (isN4)
      topSide = theObj.pageY;
   else if (isIE)
   {
    // for IE, loop through any parent elements
    do
      topSide += theObj.offsetTop;
    while ((theObj = theObj.offsetParent));
   }
    
    return topSide;
}
