/**
*   poll functionality
*
*   @author     no1@kristofferhell.net
*   @version    May 1, 2007
*/

function handlePoll(poll, pollItem) {
    var pstn = document.getElementById(poll);
    updatePoll(pstn, pollItem);
    return false;
}     

function updatePoll(pstn, pollItem) {
    var myAjax = AjaxUtils.xmlHttpRequest();
    var myPollRequest = location + "?vote=" + document.getElementById(pollItem).value;
    myAjax.onreadystatechange = function() {
        if (myAjax.readyState == 4 && myAjax.status == 200) {
            pstn.innerHTML = myAjax.responseText;
        }
    }
    myAjax.open('GET', myPollRequest, true);                    
    myAjax.send(null);
}
