function getObject(obj) {
   if (document.layers) {
      if (typeof obj == "string") {
         // just one layer deep
         return document.layers[obj];
      } else {
         // can be a nested layer
         return obj;
      }
   }
   if (document.all) {
      if (typeof obj == "string") {
         return document.all(obj).style;
      } else {
         return obj.style;
      }
   }
   if (document.getElementById) {
      if (typeof obj == "string") {
         return document.getElementById(obj).style;
      } else {
         return obj.style;
      }
   }
   return null;
}
