/* This is the function which brings about the transform using the loaded xml file and the loaded xsl stylesheet. Notice it has a different method for Mozilla type browsers than for IE type browsers */

  function doTransform(divId){
  var nodeObj = document.getElementById(divId);
  if (typeof XSLTProcessor != "undefined") {
  var fragment = xsltProcessor.transformToFragment(xmlDocument, document);
  nodeObj.innerHTML = "";
  nodeObj.appendChild(fragment);
  }
  else if ("transformNode" in xmlDocument) {
  // If the node has a transformNode() function (in IE), use that.
  // Note that transformNode() returns a string.
  nodeObj.innerHTML = xmlDocument.transformNode(xslStylesheet);
  }
  else {
  // Otherwise, we're out of luck.
  throw "XSLT is not supported in this browser";
  }
  }

var transCallCount = 0;

function doTransOnLoad(divId){
    ++transCallCount;
    if (transCallCount == 2) {
	doTransform(divId);
	transCallCount = 1;
    }
}
