       var sort, ie, dom, sourceDoc, styleDoc;
       ie=false;
       dom=false;
       navigator.appName == "Microsoft Internet Explorer"?ie=true:dom=true;

function init(sourceFile, styleFile, divName){
       targetDiv = divName;
	   theSource = sourceFile;
	   theStyle = styleFile;
       if (dom) {
          xsltProc = new XSLTProcessor(); 
          sourceDoc = document.implementation.createDocument("", "", null); 
          styleDoc = document.implementation.createDocument("", "", null); 
          resultDoc = document.implementation.createDocument("", "", null); 
          sourceDoc.onload = loadStyle;
          sourceDoc.load(theSource);
       } else {
          sourceDoc = new ActiveXObject("MSXML2.DOMDocument.3.0"); 
          sourceDoc.async = false;
          sourceDoc.load(theSource);
          styleDoc = new ActiveXObject("MSXML2.DOMDocument.3.0"); 
          styleDoc.async = false;
          styleDoc.load(theStyle);
		  transform();
       }

}

       function loadStyle() { 
          styleDoc.onload = transform;   
          styleDoc.load(theStyle);
       } 
        
       function transform() { 
	   
          if (dom){			
             xsltProc.transformDocument(sourceDoc, styleDoc, resultDoc, null); 
             myResult = new XMLSerializer().serializeToString(resultDoc); 
          } else {
             myResult = sourceDoc.transformNode(styleDoc);
          }
             document.getElementById(targetDiv).innerHTML = myResult; 
       } 
			
