﻿function isDOM(){
  return document.getElementById ? true : false;
}
function isIE(){
  return document.all ? true : false;
}
function isNS4(){
  return document.layers ? true : false;
}

//
// get element from a target doc from the various object models
// if targetdoc is not provided, use the base document object
//
function getElementById(id, targetdoc){
  var theDocument = (targetdoc) ? targetdoc : document;
  BrowserIsDOM = isDOM();
    BrowserIsIE  = isIE();
  BrowserIsNS4 = isNS4();

  //browser not known...
  if(!(BrowserIsDOM||BrowserIsIE||BrowserIsNS4)) return true;

  var theElement = (BrowserIsDOM) ? theDocument.getElementById(id) : (BrowserIsIE) ? theDocument.all(id) : theDocument.layers[id];

  return theElement;
}

function display(elementid, show, targetdoc) {
  var theElement = getElementById(elementid, targetdoc);

  if(!theElement) return true;

  if(isDOM()||isIE()) {
    theElement.style.display = show ? "" : "none";
  }
  return true;
}

function showProcessing(){
  display('processing-content',false);
  display('processing-msg',true);
  setTimeout("startAnimation()", 100); 
}

function startAnimation() 
{ 
  var processingImage = getElementById("processingImage");
  processingImage.src = processingImage.src; 
} 
