function newXML() {
    var A=null;
    try { // Try IE 6
        A=new ActiveXObject("Msxml2.XMLHTTP");
    } catch(e) {
        try { // Try older IE
            A=new ActiveXObject("Microsoft.XMLHTTP");
        } catch(oc) {
            A=null;
        }
    }
    if (!A&&typeof XMLHttpRequest!="undefined") {
        // Otherwise, use XMLHttpRequest
        A=new XMLHttpRequest();
    }
    return A;
}

function getBelcheck(url) {
    try {
        var req = newXML();
        if (req) {
            req.onreadystatechange = function() {
                if (req.readyState == 4 && req.status == 200) {
                    $('belcheck_advies').innerHTML = req.responseText;
                }
            };
            req.open('GET', url + $('belcheck_input').value, true);
            req.send('');
        }
    } catch(e) {
        try {
            var debug_div = document.getElementById('debug');
            var debug_div_content = debug_div.innerHTML;
            debug_div.innerHTML = e + "<br />" + debug_div_content;
        } catch(e){}
    }
} 

