if (!window.ActiveXObject) {
	XMLDocument.prototype.selectNodes = function (sXPath) {

		var oEvaluator = new XPathEvaluator();
		var oResult = oEvaluator.evaluate(sXPath, this, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);

		var aNodes = new Array;

		if (oResult != null) {
			var oElement = oResult.iterateNext();

			while(oElement) {
				aNodes.push(oElement);
				oElement = oResult.iterateNext();
			}
		}

		return aNodes;
	}


	XMLDocument.prototype.selectSingleNode = function (sXPath) {

		var oEvaluator = new XPathEvaluator();
		var oResult = oEvaluator.evaluate(sXPath, this, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);

		if (oResult != null) {
			return oResult.singleNodeValue;
		} else {
			return null;
		}
	}
}


function getTOCLocation() { return(location.protocol + "//" + location.host + location.pathname.substring(0, location.pathname.lastIndexOf("/") + 1) + "toc.xml"); }


function getCookie( sName ) {

	var aCookie = document.cookie.split("; ");
	var aCrumb;

	for (var i = 0; i < aCookie.length; i++) {
		aCrumb = aCookie[i].split("=");

		if (sName == aCrumb[0])
			return unescape(aCrumb[1]);
	}

	return null;
}


function isIE() { return(navigator.appName == "Microsoft Internet Explorer"); }


function gid( id ) { return(document.getElementById(id)); }


function fixXMLTags( text ) { return(text.toString().replace(/\[/g, "<").replace(/\]/g, ">")); }


function stripXMLTags( text ) { return(text.toString().replace(/\[[^\]]*\]/g, "")); }

