/*
** Requires ajax.js
*/
function sendVote( rating, existing_votes, cid, rpc ) {
   
    if( rating > 0 )    { rating = 1;   }
    else                { rating = -1;  }

    var submit_url  = rpc + "&cr=" + rating + "&cid=" + cid;
    var http        = createRequestObject();

    http.open('get', submit_url );

    http.onreadystatechange = function() {
        if( http.readyState == 4 ) {
            var response = http.responseText;
            var temp_array = new Array();
            temp_array = response.split( '~' );
            var ranking = temp_array[0];
            if( ranking > 0 ) ranking = '+' + ranking;

            document.getElementById( 'votes' + cid ).innerHTML      = ranking;
            document.getElementById( 'vote_text' + cid ).innerHTML  = temp_array[1] + " votes";
            document.getElementById( 'voteStatus' + cid ).innerHTML = "<strong>Thanks for voting</strong><img src=\"http://i.zdnet.com/images/icn/icn_postvote_32x32.gif\">";
            document.getElementById( 'voteStatus' + cid ).className = "postvote";
            Set_Cookie('service',existing_votes + '~' + cid, 30, '/' );

        }

    }

    http.send(null);
}
/*
function handleResponse()
{
    if(http.readyState == 4)
    {
        var response = http.responseText;
        var temp_array = new Array();
        temp_array = response.split('~');
        var ranking = temp_array[0];
        if (ranking > 0) ranking = '+' + ranking;
        document.getElementById('votes').innerHTML = ranking;
        document.getElementById('vote_text').innerHTML = temp_array[1] + " votes";
        document.getElementById('voteStatus').innerHTML = "<strong>Thanks for voting</strong><img src=\"http://i.zdnet.com/images/icn/icn_postvote_32x32.gif\">";
        document.getElementById('voteStatus').className = "postvote";
        Set_Cookie('service',(existing_votes + '~<?php echo $table_prefix . $id; ?>'),30,'/');
    }
}
*/
