/* 
 * @author Christophe Ferreboeuf <christophe.ferreboeuf@looki-france.com>
 * 
 */
function plus(id,nbvotespos,nbvotesneg){
    // Récupération des variables
    $("btnplus-"+id).disabled = 1;
    var baseUrl = document.getElementById("baseUrl").value;
    var nbVotes = document.getElementById("nbpts-"+id);
    var fiche = document.getElementById("votedansfiche");

    // Envoi en AJAX du vote via MOOTOOLS [Controller: Hitparade & Action: AJAX].
    var ajxRequest = new Request({
            url: baseUrl+'/Hitparade/ajax/ajax/1/id/'+id+'/vote/1',
            onSuccess: function(data){ 
                if (data == "ok") {
                    bgpos = Math.round((nbvotesneg/(nbvotesneg+nbvotespos+1))*100,0);
                    $("btnplus-"+id).set('class','pouceHautS');
                    if ((nbVotes != "undefined")&&(nbVotes!=null)){
                        nbVotes.set('html', (parseInt(nbvotespos)+1));
                    }
                }
            },
            onFailure: function(){
               alert(window.locale.captcha.inconnu);
            }
    });

    ajxRequest.send();
}

