function loadurl(url,id) {

    try {
        // Moz supports XMLHttpRequest. IE uses ActiveX.
        // browser detction is bad. object detection works for any browser
        xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e) {
    // browser doesn't support ajax. handle however you want
    }

    // the xmlhttp object triggers an event everytime the status changes
    // triggered() function handles the events
    xmlhttp.onreadystatechange= function() {
        if (xmlhttp.readyState==4)
            if (xmlhttp.status==200)
                document.getElementById(id).innerHTML = xmlhttp.responseText;
    }
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
}
