function getUniqueID()
{
	var now = new Date();
	return now.getDate().toString() + now.getMonth() + now.getFullYear() + now.getHours() + now.getMinutes() + now.getSeconds() + now.getMilliseconds();
}

function AjaxRequest(url, reciever_function) {

    var http_request = false;

    if (window.XMLHttpRequest) { // Mozilla, Safari,...
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) {
            http_request.overrideMimeType('text/xml');
            // See note below about this line
        }
    } else if (window.ActiveXObject) { // IE
        try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
        }
    }

    if (!http_request) {
        alert('Giving up :( Cannot create an XMLHTTP instance');
        return false;
    }
    http_request.onreadystatechange = function() { AjaxRecieve(http_request, reciever_function); };
    // add unique id to url
    if (url.indexOf("?") == -1) url += "?"; else url += "&";
    url += "UniqueID=";
    url += getUniqueID();
    
    http_request.open('GET', url, true);
    http_request.send(null);
}

function AjaxRecieve(http_request, reciever_function) {
    if (http_request.readyState == 4) {
        if (http_request.status == 200) {
            if (reciever_function) reciever_function(http_request.responseText);
        } else {
			window.open('about:blank', 'ErrorWindow').document.write(http_request.responseText);
			//alert('Server communication closed. (' + http_request.status + ')');
        }
    }
}

