<!--   
<!-- warn users of version 3 browsers -->  
if(navigator.appVersion.charAt(0) < 4){
    alert("This page requires the use of a 4.x or above browser.\n You're experience at this site may be unpredictable\n and/or sub-standard as a result.")
}

<!-- netscape resize bug fix -->
if(document.layers){
	widthCheck = window.innerWidth;
	heightCheck = window.innerHeight;
	window.onResize = resizeFix;
}
function resizeFix(){
	if (widthCheck != window.innerWidth || heightCheck != window.innerHeight);
	document.location.href = document.location.href;
}

<!-- set some browser identity variables -->
var isIE = (document.all)? 1 : 0;
var isNS = (document.layers)? 1 : 0;
var isN6 = (document.getElementById && !document.all)? 1 : 0;

function makeObj(obj){
  //build a reference to the object for 3 browsers
  if(isIE){
    this.css = document.all[obj].style;
    this.ref = document.all[obj];//reference for non css properties
    this.x = parseInt(this.css.left); //assign x property
    this.y = parseInt(this.css.top); //assign y property
  }
  else if(isNS){
    this.css = document.layers[obj];
    this.ref = document.layers[obj];//reference for non css properties
    this.x = this.css.left; //assign x property
    this.y = this.css.top; //assign y property
  }  
  else if(isN6){
    this.css = document.getElementById(obj).style;
    this.ref = document.getElementById(obj);//reference for non css properties
    this.x = parseInt(this.css.left); //assign x property
    this.y = parseInt(this.css.top); //assign y property
  }
  
  //set functions as methods of the object
  this.moveObjTo = moveObjTo;
  this.moveObjBy = moveObjBy;
  this.hide = hide;
  this.show = show;
  this.writeTo = writeTo;
  this.getClip = getClip;
  this.clipTo = clipTo;
  this.clipBy = clipBy;
  this.setZ = setZ;
  this.getWidth = getWidth;
  this.getHeight = getHeight;
  this.getDivX = getDivX;
  this.getDivY = getDivY;
  this.displayOff = displayOff;
  this.displayOn = displayOn;

  
  //return the object
  return this
}

function moveObjTo(x,y){
  this.x = x;
  this.y = y;
  this.css.left = this.x;
  this.css.top = this.y;
}

function moveObjBy(x,y){
  this.x += x;
  this.y += y;
  this.css.left = this.x;
  this.css.top = this.y; 
}

function hide(){
  this.css.visibility = "hidden";
}

function show(){
  this.css.visibility = "visible";
}

function writeTo(text){
    //using .ref instead of .css since innerHTML property isn't a css property
    if(isIE || isN6) this.ref.innerHTML = text;
    else if(isNS) {
        this.css.document.open();
        this.css.document.write(text);
        this.css.document.close();
    }
}

/*
clipEdge abbreviations:

tp = top
rgt = right
bttm = bottom
lft = left
*/

function getClip(clipEdge){
  if(isIE || isN6){
    var theString = this.css.clip;
    
    var clipRegExp = /(\d+)/g; //grab all sets of digits from IE clip string
    var theStringArray = theString.match(clipRegExp); //create an array out of digit groups
    for(var i=0; i < theStringArray.length; i = i+4){ 
      //assign variable names to array inexes
      var tp = theStringArray[i]; 
      var rgt = theStringArray[i+1];
      var bttm = theStringArray[i+2];
      var lft = theStringArray[i+3];
      
      //return the values
      if(clipEdge == 'tp') return tp;
      else if(clipEdge == 'rgt') return rgt;
      else if(clipEdge == 'bttm') return bttm;
      else if(clipEdge == 'lft') return lft;
    }
  }
  else if(isNS){
      if(clipEdge == 'tp') return this.css.clip.top;
      else if(clipEdge == 'rgt') return this.css.clip.right;
      else if(clipEdge == 'bttm') return this.css.clip.bottom;
      else if(clipEdge == 'lft') return this.css.clip.left;
  }
}

function clipTo(tp,rgt,bttm,lft){
  if(isIE || isN6){
    this.css.clip = "rect(" +tp+ "px " +rgt+ "px " +bttm+ "px " +lft+ "px)";
  }
  else if(isNS){
    this.css.clip.top = tp;
    this.css.clip.right = rgt;
    this.css.clip.bottom = bttm;
    this.css.clip.left = lft;
  }
}

function clipBy(t,r,b,l){
  if(isIE || isN6){
    clipTop = this.getClip('tp'); clipTop = parseInt(clipTop) + parseInt(t);
    clipRight = this.getClip('rgt'); clipRight = parseInt(clipRight) + parseInt(r);
    clipBottom = this.getClip('bttm'); clipBottom = parseInt(clipBottom) + parseInt(b);
    clipLeft = this.getClip('lft'); clipLeft = parseInt(clipLeft) + parseInt(l);
    
    this.clipTo(clipTop,clipRight,clipBottom,clipLeft);
  }
  else if(isNS){
    clipTop = this.css.clip.top; clipTop = clipTop + t;
    clipRight = this.css.clip.right; clipRight = clipRight + r;
    clipBottom = this.css.clip.bottom; clipBottom = clipBottom + b;
    clipLeft = this.css.clip.left; clipLeft = clipLeft + l;
    
    this.clipTo(clipTop,clipRight,clipBottom,clipLeft);
  }
}

function setZ(theZ){
    this.css.zIndex = theZ;
}

<!-- these two functions not part of object methods -->
function winWidth(){
    if(isIE) return document.body.offsetWidth - 20; //scrollbar width subtracted
    else if(isNS || isN6) return window.innerWidth - 16; //scrollbar width subtracted
}
function winHeight(){
    if(isIE) return document.body.offsetHeight; 
    else if(isNS || isN6) return window.innerHeight;
}

function getWidth(){
    if(isIE || isN6) return this.ref.offsetWidth;
    else if(isNS) return this.css.clip.width;
}

function getHeight(){
    if(isIE || isN6) return this.ref.offsetHeight;
    else if(isNS) return this.css.document.height;
}

//retrieves left coord of relative positioned div or layer
function getDivX(){
  if(isIE) return this.ref.offsetLeft;
  else if(isNS) return this.css.pageX;
  else if(isN6) return this.ref.offsetLeft; // left position not gettable by NS6
}

//retrieves top coord of relative positioned div or layer
function getDivY(){
  if(isIE) return this.ref.offsetTop;
  else if(isNS) return this.css.pageY;
  else if(isN6) return this.ref.offsetTop;
}

function displayOff()
{
    if(isIE || isN6)
    {
        this.css.display = "none";
    }   
}

function displayOn()
{
    if(isIE || isN6)
    {
        this.css.display = "block";
    }   
}

//-->
