function element( elementId )
{
   if ( document.getElementById )
   {
      return document.getElementById( elementId )
   }
   else if ( document.all )
   {
      return document.all[elementId]
   }
   else if ( document.layers ) 
   {
      return document[ elementId ]
   }
   else
   {
      //alert( "no element: " + elementId )
   }
}


function setClass(name, classname) {
   if (!name || !classname) return;
   var elm = element(name);
   if (elm) elm.className = classname;
}

function setDisplay(name, displayName) {
   if (!name || !displayName) return;
   var elm = element(name);
   if (elm) elm.style.display = displayName;
}


var agent = navigator.userAgent.toLowerCase();
var notOpera = agent.indexOf('opera') == -1;

function getIframeById(fId) {
   if (document.frames && notOpera) {
     // this is for IE5 Mac, because it will only allow access to the document object
     // of the IFrame if we access it through the document.frames array
     return document.frames[fId];
   }
   else {
      return element(fId);
   }
}

function getIframeDoc(iFrame) {
  var iFrameDoc;      
  if (iFrame.contentDocument) {
    // For NS6
    iFrameDoc = iFrame.contentDocument; 
  } else if (iFrame.contentWindow) {
    // For IE5.5 and IE6
    iFrameDoc = iFrame.contentWindow.document;
  } else if (iFrame.document) {
    // For IE5
    iFrameDoc = iFrame.document;
  }
  return iFrameDoc;
}