﻿var Utilities = (function() {
	function fnUtilitiesConstructor() {
	
	}
	
	fnUtilitiesConstructor.loadXML = function(sXML) {
		var oXML;
		if (window.ActiveXObject) {
			oXML = Try.these(
				function() { return new ActiveXObject("MSXML2.DOMDocument.6.0") },
				function() { return new ActiveXObject("MSXML2.DOMDocument.5.0") },
				function() { return new ActiveXObject("MSXML2.DOMDocument.4.0") },
				function() { return new ActiveXObject("MSXML2.DOMDocument.3.0") },
				function() { return new ActiveXObject("MSXML2.DOMDocument") },
				function() { return new ActiveXObject("MSXML.DOMDocument") }
			);
			oXML.async = false;
			oXML.loadXML(sXML);
		}
		else {
			var oParser = new DOMParser();
			oXML = oParser.parseFromString(sXML, "text/xml");
		}
	    
		return oXML;
	}
	
	return fnUtilitiesConstructor;
})();