//add getElementById if it doesn't exist.  This shouldn't be needed because
//all browswer we want to support should be Dom compliant.
//however its in the existing stuff I'm trying to match functionality on
//so I'm going to play with it.
if(document.all && !document.getElementById) {
  document.getElementById = function(id) {
    return document.all[id];
  }
}

/* 
  functions
*/

//not strictly speaking a compatability function, this is similar.  Finds the 
//first descendant node with a given attribute.

function findFirstDecendantByAttribute(element, attribute, match) {
  var list = element.getElementsByTagName("*");
  for(var i=0; i < list.length; i++) {
    if (list[i].getAttribute(attribute) == match) {
      return list[i];
    }
  }
  
  return null;
}


/*
  classes
*/

//this is here to provide a compatability layer for elements.  I don't think
//we *really* need it, but its in the old code
function compatabilityElement(id) {
  this.obj = document.getElementById(id);
  this.getStyle = function (name) {
    return this.obj.style.getStyle(name);
  } 
  this.setStyle = function (name, value) {
    this.obj.style.setStyle(name, value, "");
  }
}

