function stats(loc) {
	fields = "loc="+loc;
	var url = "stats.php";
	loadXMLDoc_stats(url);
}

function loadXMLDoc_stats(url) {
	// native XMLHttpRequest object
	if (window.XMLHttpRequest) {
			req = new XMLHttpRequest();
			req.onreadystatechange = processReqChange_stats;
			req.open("POST",url,true);
			req.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
			req.send(fields);
	// IE/Windows ActiveX version
	} else if (window.ActiveXObject) {
			isIE = true;
			req = new ActiveXObject("Microsoft.XMLHTTP");
			if (req) {
				req.onreadystatechange = processReqChange_stats;
				req.open("POST",url,true);
				req.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
				req.send(fields);
			}
	}
}
function processReqChange_stats() {
	// only if req shows "loaded"
	if (req.readyState == 4) {
			// only if "OK"
			if (req.status == 200) {
				buildTopicList_stats();
			} else {
				//alert("There was a problem retrieving the XML data:\n" + req.statusText);
			}
	}
}
function buildTopicList_stats() {
	var response = req.responseText;
	//alert(response)
	//////////////////////////////////////////////
	// Parse the XML ////////////////////////////
	if (window.XMLHttpRequest) {
			if (version == "IE7") {
				var xmlDocument = new ActiveXObject('Microsoft.XMLDOM');
				xmlDocument.async = false;
				var loaded = xmlDocument.loadXML(response);
				if (loaded) {
					//alert(xmlDocument.documentElement.nodeName);
				} else {
					alert(xmlDocument.parseError.reason + xmlDocument.parseError.srcText);
					// shows error with end tag </gods> not matching start tag <god>
				}
			} else {
				var domParser = new DOMParser();
				var xmlDocument = domParser.parseFromString(response, 'application/xml');
				var parseError = checkForParseError(xmlDocument);
				if (parseError.errorCode == 0) {
					//alert(xmlDocument.documentElement.nodeName);
				} else {
					alert(parseError.reason + '\r\n' + parseError.srcText);
					// shows detailed error message
				}
			}
	//////////
	} else if (window.ActiveXObject) {
			var xmlDocument = new ActiveXObject('Microsoft.XMLDOM');
			xmlDocument.async = false;
			var loaded = xmlDocument.loadXML(response);
			if (loaded) {
				//alert(xmlDocument.documentElement.nodeName);
			} else {
				alert(xmlDocument.parseError.reason + xmlDocument.parseError.srcText);
				// shows error with end tag </gods> not matching start tag <god>
			}
	}
	//////////////////////////////////////////////
	//////////////////////////////////////////////
	var item = xmlDocument.getElementsByTagName("item")[0];
	var content = getElementTextNS("content", "", item, 0);
	
//	
}

