/* First, initialize the global variables that will be needed,
 then set them all to zero initially.
 The dhtml variable is for use later, when calling functions that will use this script so that we can check for non-dhtml browsers.*/

var using_layers = 0;
var using_all = 0;
var using_w3c = 0;
var dhtml = 0;
     
/* Now, check for each DOM, and assign the variables
a value of 1 if that particular DOM is found. */
if (document.getElementById) {
  using_w3c = 1;
  dhtml = 1;
}
else if (document.all) {
  using_all = 1;  dhtml = 1;
}
else {
  // Old detection method to check for Netscape 4.
  var browser_ver = parseInt(navigator.appVersion);
  var is_netscape = navigator.appName.indexOf('Netscape');
  if ((is_netscape != -1)&&(browser_ver == 4)) {
    using_layers = 1;
    dhtml = 1;    }}
// The function that sets up the object for each DOM.
function getObject(the_object,parental,objstyle) {
  // First, check to see if the object's style needs to be accessed.
  if (objstyle == 1) {
    // Now, for each DOM that was detected, the proper object will be returned
    if (using_w3c == 1) {
      return (document.getElementById(the_object).style);
    }
    else if (using_all == 1) {
      return (document.all[the_object].style);
    }
    else if (using_layers == 1) {
	 if (parental) {
	  return (document.layers[parental].layers[the_object]);
	 }
	 else {
      return (document.layers[the_object]);
	 }
    }
  }
 // If the object's style is not needed.
  else {
    if (using_w3c == 1) {
      return (document.getElementById(the_object));
    }
    else if (using_all == 1) {
      return (document.all[the_object]);
    }
    else if (using_layers == 1) {
	 if (parental) {
	  return (document.layers[parental].layers[the_object]);
	 }
	 else {	
      return (document.layers[the_object]);
	 }
    } 
  }
}
