var ajaxObject = null;

try { ajaxObject = new window.XMLHttpRequest(); }
catch (e) {
	try { ajaxObject = new window.ActiveXObject("Microsoft.XMLHTTP"); }
		catch (e) { }
}

function httpGetFile(fileLocation) {
	var outObjectId, requestMedhod, postVars;
	if (arguments[1]) outObjectId 	= arguments[1]; else outObjectId 	= 'content';
	if (arguments[2]) requestMethod = arguments[2]; else requestMethod 	= 'GET';
	if (arguments[3]) postVars		= 'ajaxRequested=&'+arguments[3]; else postVars = null;
	
	if (!document.getElementById(outObjectId) && outObjectId != 'nothing') return true;
	
	if (ajaxObject != null) {
		if (!ajaxActive) {
			ajaxActive=true;
			ajaxObject.open(requestMethod, fileLocation, true);
			ajaxObject.onreadystatechange = function () {
				if (ajaxObject.readyState == 4 && outObjectId != 'nothing' && ajaxObject.status == 200) {
					document.getElementById(outObjectId).innerHTML = ajaxObject.responseText;
				}
				ajaxActive=false;
			}
			if (requestMethod == 'POST') { ajaxObject.setRequestHeader("Content-Type","application/x-www-form-urlencoded");	}
			ajaxObject.send(postVars);
		} else setTimeout("httpGetFile('"+fileLocation+"', '"+outObjectId+"');", 100);
		return false;
	} else return true;
}
