//declare and create the request object
var req;

function initialize() {	try { req = new ActiveXObject("Msxml2.XMLHTTP"); }
    catch(e) { try { req=new ActiveXObject("Microsoft.XMLHTTP"); }
		catch(oc) {	req=null; } }
    if(!req && typeof XMLHttpRequest != "undefined")
        req = new XMLHttpRequest();
}

function askserver(thingtoask){
	//run the above
    initialize();

	//if we have a browser capable of making a request
    if(req!=null) {
		//get something
        req.open("GET", thingtoask, true);
		//when we get something, process it (i.e. call the next function)
        req.onreadystatechange = process;
        req.send(null);
    }	
}

function process()
{
    if (req.readyState == 4) {
        // readystate 4 means we're ready and and status 200 means it worked
		if (req.status == 200) {
			if(req.responseText == "")
				nothinghappened();
			else {
				dealwiththismofo(req.responseText);
			}
		} else {
			shitasserror(req.responseText);
		}
	}
}

