function xmlhttpPostVote(strQueryStr, updatefield) {
    var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', '/vote.php', true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatevote(updatefield,self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(strQueryStr);
//    alert(strQueryStr);
}

function updatevote(fld,str){
    document.getElementById(fld).innerHTML = str;
}

function hilitestars(id,num) {
    var i;
    for (i=1; i<=num; i++){
        document.getElementById('vote-' + i + '-' + id).src = 'http://www.256pixels.com/staron.gif';
    }
}

function clearstars(id){
    var i;
    for(i=1; i<=5; i++){
        document.getElementById('vote-' + i + '-' + id).src = 'http://www.256pixels.com/staroff.gif';
    }
}
