

function MakeServerXmlCall( strUrl ) {


	if(document.implementation && document.implementation.createDocument){
		// Mozilla

		var xsltProcessor = new XSLTProcessor();

		// load the xslt file
		var myXMLHTTPRequest = new XMLHttpRequest();
		myXMLHTTPRequest.open("GET", strUrl, false);
		myXMLHTTPRequest.send(null);

		return myXMLHTTPRequest;

	}else if(window.ActiveXObject){
		// IE

		// Load XML
		xml = new ActiveXObject("MSXML2.DOMDocument");
		xml.async = false
		xml.load( strUrl )

		return xml;
		
	}else{
		// Browser unknown
		alert("WRFS / XSTL - Browser unknown");
	}

}



function InsertStringIntoDomDiv( strValue, strElementID ){


	if(document.implementation && document.implementation.createDocument){
		// Mozilla

		if (strElementID != null && strElementID != undefined) {
			
			document.getElementById( strElementID ).innerHTML = strValue;
			
		
		}

	}else if(window.ActiveXObject){
		// IE


		if (strElementID != null && strElementID != undefined) {

			document.getElementById( strElementID ).innerHTML = strValue;

		}
		
	}else{
		// Browser unknown
		alert("WRFS / XSTL - Browser unknown");
	}

}




function WRFS_TransformXML( strXML, strXSL, strElementID ){


	if(document.implementation && document.implementation.createDocument){
		// Mozilla

		var xsltProcessor = new XSLTProcessor();

		// load the xslt file
		var myXMLHTTPRequest = new XMLHttpRequest();
		myXMLHTTPRequest.open("GET", strXSL, false);
		myXMLHTTPRequest.send(null);



		// get the XML document
		xslStylesheet = myXMLHTTPRequest.responseXML;
		xsltProcessor.importStylesheet(xslStylesheet);

		// load the xml file
		myXMLHTTPRequest = new XMLHttpRequest();
		myXMLHTTPRequest.open("GET", strXML, false);
		myXMLHTTPRequest.send(null);

		var xmlSource = myXMLHTTPRequest.responseXML;

		//transform
		 var resultDocument = null;
		 try {
		 	resultDocument = xsltProcessor.transformToFragment( xmlSource, document );
		 } catch (e) {
		 	alert( e );
		 }
		 
		 if (strElementID != null && strElementID != undefined) {
			
			document.getElementById( strElementID ).appendChild( resultDocument );
			
		} else {
		
			return resultDocument;
		
		}

	}else if(window.ActiveXObject){
		// IE

		// Load XML
		xml = new ActiveXObject("MSXML2.DOMDocument");
		xml.async = false
		xml.load( strXML )

		// Load XSL
		xsl = new ActiveXObject("MSXML2.DOMDocument");
		xsl.async = false
		xsl.load( strXSL )

		if (strElementID != null && strElementID != undefined) {
		// Transform
			document.getElementById( strElementID ).innerHTML = xml.transformNode( xsl );
			
		} else {
		
			return xml.transformNode( xsl );
		
		}
		
	}else{
		// Browser unknown
		alert("WRFS / XSTL - Browser unknown");
	}

}







function WRFS_TransformXMLDoc( oXML, strXSL, strElementID ) {


	if(document.implementation && document.implementation.createDocument){
		// Mozilla

		var xsltProcessor = new XSLTProcessor();

		// load the xslt file
		var myXMLHTTPRequest = new XMLHttpRequest();
		myXMLHTTPRequest.open("GET", strXSL, false);
		myXMLHTTPRequest.send(null);



		// get the XML document
		xslStylesheet = myXMLHTTPRequest.responseXML;
		xsltProcessor.importStylesheet(xslStylesheet);


		var xmlSource = oXML;

		//transform
		 var resultDocument = null;
		 try {
		 	resultDocument = xsltProcessor.transformToFragment( xmlSource, document );
		 } catch (e) {
		 	alert( e );
		 }
		 
		 if (strElementID != null && strElementID != undefined) {
			alert( resultDocument );
			document.getElementById( strElementID ).appendChild( resultDocument );
			
		} else {
		
			return resultDocument;
		
		}

	}else if(window.ActiveXObject){
		// IE
/*
		// Load XML
		xml = new ActiveXObject("MSXML2.DOMDocument");
		xml.async = false
		xml.load( strXML )

		// Load XSL
		xsl = new ActiveXObject("MSXML2.DOMDocument");
		xsl.async = false
		xsl.load( strXSL )

		if (strElementID != null && strElementID != undefined) {
		// Transform
			document.getElementById( strElementID ).innerHTML = xml.transformNode( xsl );
			
		} else {
		
			return xml.transformNode( xsl );
		
		}
		*/
		
		alert( 'unsupported! because im lazy!' );
		
		
	}else{
		// Browser unknown
		alert("WRFS / XSTL - Browser unknown");
	}

}






function runTransform(){
	if(document.implementation && document.implementation.createDocument){
		// Mozilla

		var xsltProcessor = new XSLTProcessor();

		// load the xslt file
		var myXMLHTTPRequest = new XMLHttpRequest();
		myXMLHTTPRequest.open("GET", "test.xsl", false);
		myXMLHTTPRequest.send(null);

		// get the XML document
		xslStylesheet = myXMLHTTPRequest.responseXML;
		xsltProcessor.importStylesheet(xslStylesheet);

		// load the xml file
		myXMLHTTPRequest = new XMLHttpRequest();
		myXMLHTTPRequest.open("GET", "test.xml", false);
		myXMLHTTPRequest.send(null);

		var xmlSource = myXMLHTTPRequest.responseXML;

		//transform
		 var resultDocument = xsltProcessor.transformToFragment(xmlSource, document);
		document.getElementById("example").appendChild(resultDocument);

	}else if(window.ActiveXObject){
		// IE

		// Load XML
		xml = new ActiveXObject("MSXML2.DOMDocument");
		xml.async = false
		xml.load("test.xml")

		// Load XSL
		xsl = new ActiveXObject("MSXML2.DOMDocument");
		xsl.async = false
		xsl.load("test.xsl")


		// Transform
		document.getElementById("example").innerHTML=xml.transformNode(xsl);
	}else{
		// Browser unknown
		alert("WRFS / XSTL - Browser unknown");
	}

}