function DOM() {
}

//generate the right kind of object reference based on user's browser
DOM.prototype.getLayerReference = function (divId) {
	var objRef;
	if (document.getElementById)
  {
  objRef = document.getElementById(divId);
	//objRef.style = document.getElementById(divId).style;
  }
  else if (document.all)
  {
	objRef = document.all[divId];
	//objRef.style = document.all[divId].style;
  }
  else if (document.layers)
  {
   	objRef = document.layers[divId];
   	objRef.style = document.layers[divId];
  }
  
  return objRef;
	
}

/**
//this object looks like a good replacement for getLayerReference
function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

**/

//traverse up the DOM intLevelsUp times to get this element's
//parent
//if intLevelsUp is unspecified, then we'll go just one 
//level up
DOM.prototype.getParent = function(objRef, intLevelsUp) {
	if (intLevelsUp == null) {
		intLevelsUp = 1;
	}
	
	var objParent = objRef;
	
	for (var i = 0; i < intLevelsUp; ++i) {
		if (objBrowser.ns)  {
			objParent = objParent.parentNode;
		} else {
			objParent = objParent.parentElement;
		}
	}
	
	return objParent;

}

//gets the browser width and height
DOM.prototype.getBrowserSize = function() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else {
    if( document.documentElement &&
        ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      //IE 6+ in 'standards compliant mode'
      myWidth = document.documentElement.clientWidth;
      myHeight = document.documentElement.clientHeight;
    } else {
      if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
      }
    }
  }
  //compensate here for scrollbar, status bar
  if (myWidth < 750) {
  	myWidth = 750;
  }
  if (myHeight < 400) {
  	myHeight = 400;
  }
  arrPair = new Array();
  arrPair["width"] = myWidth;
  arrPair["height"] = myHeight;
  return arrPair;
}

//instantiate for global use
var objDOM = new DOM();