function ncBPGetDomFromXml(xml){if(typeof ActiveXObject!='undefined'){var dom=new ActiveXObject("Microsoft.XMLDOM");dom.async=false;dom.loadXML(xml)}else{parser=new DOMParser();dom=parser.parseFromString(xml,"text/xml")}return dom}function ncBPXslt(xmlDoc,xslDoc){var transform;if(typeof ActiveXObject!='undefined'){try{transform=xmlDoc.transformNode(xslDoc)}catch(e){window.alert(e.message)}}else{var xsl=new XSLTProcessor();xsl.importStylesheet(xslDoc);var fragment=xsl.transformToFragment(xmlDoc,document);if(fragment.childNodes.length>0)transform=fragment.childNodes[0].innerHTML;else alert("error")}return transform}function processXML(xmlData,xslData,divName){var xmlobject=ncBPGetDomFromXml(xmlData);var xslobject=ncBPGetDomFromXml(xslData);var htmlString=ncBPXslt(xmlobject,xslobject)+'';var divReportContainer=document.getElementById(divName);divReportContainer.innerHTML=htmlString}function trim(stringToTrim){return stringToTrim.replace(/^\s+|\s+$/g,"")}function ltrim(stringToTrim){return stringToTrim.replace(/^\s+/,"")}function rtrim(stringToTrim){return stringToTrim.replace(/\s+$/,"")}function ncFixHTML(htmlString){htmlString=htmlString.replace(/&gt;/g,'>');htmlString=htmlString.replace(/&lt;/g,'<');return htmlString}