/*
 * Function: findObj
 * Params: theObj = the object to which a pointer must be found.
 *         theDoc = the document in which theObj is contained.
 * Returns: A pointer to theObj
 *
 * Usage Example: obj = findObj("image1");
 *
 * Dependencies: None
 */
function findObj(theObj, theDoc)
{
  var p, i, foundObj;

  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++)
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);

  return foundObj;
}

/*
 * Function: findObj
 * Params: objName = the name of the object to be changed.
 *         displayStyle = the display style to be applied to objName (e.g. inline, block, none).
 * Returns: Nothing
 *
 * Usage Example: setVisible('span1', 'inline');
 *
 * Dependencies: findObj(theObj, theDoc)
 */
function setVisible(objName, displayStyle)
{
  obj = findObj(objName);
  if (obj != null && obj.style)
  {
    obj.style.display=displayStyle;
  }
}


