// findDOM.js
// DOM <===> Document Object Model
// Find out which DOM, if any, that the browser supports

var isDHTML  = 0; // 1 - supports some kind of DOM - isDHTML || isID || isLayers
var isID     = 0; // 1 - supports W3C ID DOM (MSIE5.0, MacMSIE5, MSIE6.0, NN6.2)
var isAll    = 0; // 1 - supports Internet Explorer All DOM (MSIE4)
var isLayers = 0; // 1 - browser supports Netscape Layer DOM (nn4.8)

// Detect IE_All and W3C_ID using feature sensing to include compatible browsers
// Detect NN_Layers using browser sensing to work-around NN4 bug that causes 
//   feature sensing to fail in external scripts
if( document.getElementById ) 
 { isID = 1; isDHTML = 1; }
else if( document.all )
 { isAll = 1; isDHTML = 1; }
else
 {
 browserVersion = parseInt(navigator.appVersion);
 if( (navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4) )
  { isLayers = 1; isDHTML = 1; }
 }

// Return a pointer to the DOM for an object, or an objects style
function findDOM( objectID, withStyle )
 {
 if( withStyle == 1 )
  {
  if( isID )
   { return (document.getElementById(objectID).style) ; }
  else if( isAll ) 
   { return (document.all[objectID].style); }
  else if( isLayers )
   { return( document.layers[objectID] ); }
  }
 else
  {
  if( isID )
   { return (document.getElementById(objectID)) ; }
  else if( isAll )
   { return (document.all[objectID]); }
  else if( isLayers )
   { return (document.layers[objectID]); }
  }
 }