// http://stackoverflow.com/questions/8567114/how-to-make-an-ajax-call-without-jquery
// no dependencies
// contentDiv is optional
function doAjaxGet(ajaxUrl, elementID) {
    var xmlhttp;
    elementID = elementID || 0;

    if (window.XMLHttpRequest) {
        // code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp = new XMLHttpRequest();
    } else {
        // code for IE6, IE5
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }

    xmlhttp.onreadystatechange = function () {
        if (xmlhttp.readyState == XMLHttpRequest.DONE) {
            if (xmlhttp.status == 200) {
                if (elementID != 0) {
                    document.getElementById(elementID).innerHTML = xmlhttp.responseText;
                    return true;
                }
            }
            else if (xmlhttp.status == 400) {
                alert('There was an error 400')
            }
            else {
                alert('something else other than 200 was returned')
            }
            return false;
        }
    }

    xmlhttp.open("GET", ajaxUrl, true);
    xmlhttp.send();
}