var xmlhttp = false;
if (window.XMLHttpRequest) { // <- Mozilla/Firefox/Safari
        xmlhttp = new XMLHttpRequest();
} else if (window.ActiveXObject) { // <- IE
        xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
}

function AjaxLoad(strID, strURL, booAsynchronous) {
        AjaxLoadGet(strID, strURL, booAsynchronous);
}

function AjaxLoadGet(strID, strURL, booAsynchronous) {
        booAsynchronous = booAsynchronous ? booAsynchronous : true; // <- booAsynchronous is optional (default to true)
        objTarget = document.getElementById(strID);
        xmlhttp.open('GET', strURL, booAsynchronous);
        xmlhttp.onreadystatechange = XMLStateChangeLoad;
        xmlhttp.send(null);
}

function AjaxLoadPost(strID, strURL, arrPosting, booAsynchronous) {
        
                // arrPosting is an associative array
        booAsynchronous = booAsynchronous ? booAsynchronous : true; // <- booAsynchronous is optional (default to true)
        objTarget = document.getElementById(strID);
        xmlhttp.open('POST', strURL, booAsynchronous);
        xmlhttp.onreadystatechange = XMLStateChangeLoad;
        // need to set a header for passing *form* information
        xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        // xmlhttp.send will pass everything at once, so format it like query string (even though it is being posted)
        strQS = '';
        for (strKey in arrPosting) {
                strQS += strKey + '=' + escape(arrPosting[strKey]) + '&';
        }
        xmlhttp.send(strQS);
}


function XMLStateChangeLoad() {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
		var data = xmlhttp.responseText;
	        
                 objTarget.innerHTML  = data;
        } else {
                objTarget.innerHTML = 'Searching . . .';
        }
}
