/*
Copyright © 2004
Author: Avery Perich
Date: 7-30-2004
Description: Code for the Swap Shop™ site
*/

//========== WARNING =========== WARNING =========== WARNING ===========
//
// Ensure that the HTML object ID is unique!
// Including META tags and other HTML elements.
// If this is not done, you may get undesired results, or no results at all!
//
//========== WARNING =========== WARNING =========== WARNING ===========


// Get the specified layer or element as an object.
function GetLayer(layerID)
{
  if(document.getElementById)
  { // IE specific extension; implemented in some newer browsers
    return document.getElementById(layerID);
  }
  else if(document.all)
  { // Older IE method
    return document.all[layerID];
  }
  else if(document.layers)
  { // Standard JavaScript method
    return document.layers[layerID];
  }
}

// Create a handler function if this function was not implemented in the browser.
// This should allow faster access for browsers that have implemented the getElementById function.
// Based on: http://www.mozilla.org/docs/web-developer/upgrade_2.html#dom
if (!document.getElementById)
  document.getElementById = GetLayer;

//
//=================== NEW CODE BELOW THIS LINE ===================================
//



// Update the HTML text for a layer
function LayerText(layerID, sHTML)
{
  // Get the element
  var elm = document.getElementById(layerID);  
  if (!elm) return false;

  if (elm.innerHTML)
  { // IE specific property
    elm.innerHTML = sHTML;
  }
  else if(document.layers)
  { // Standard JavaScript method
    document.layers[layerID].document.open(); // For older & nonconforming browsers
    document.layers[layerID].document.write(sHTML);
    document.layers[layerID].document.close();
  }
  return true;
}

