
var http;

function gethttp() {
    if (typeof XMLHttpRequest != 'undefined') {
        return new XMLHttpRequest();
    }
    
    try {
        return new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        return new ActiveXObject("Microsoft.XMLHTTP");
    }
}

function pollresult() {
    if (http.readyState == 4) {
        var container = document.getElementById("poll_container");
    
        if (http.status == 200)
            container.innerHTML = http.responseText;
        else
            container.innerHTML = "<div align=\"center\">" . http.statusText + "</div>";
    }
}

function submitpoll(a) {
    http = gethttp();
    http.onreadystatechange = pollresult;
    http.open("GET", "poll_process.php?a=" + a, true);
    http.send(null);
    
    // var container = document.getElementById("poll_container");
    // container.innerHTML = "<div align=\"center\">...</div>";
}
