Voter = {
  vote : function(what_in){
    var what = what_in.substring(0,what_in.indexOf("."));
    var up_down = what_in.substring(what_in.indexOf(".")+1,what_in.length);

    var voted = Cookies.read(what);
    if(voted == null){
	$(what_in).innerHTML = parseInt($(what_in).innerHTML)+1;
	this.voted=true;
	pars="vote="+up_down+"&ref="+what;
	Cookies.create(what,"voted",1);
	var myAjax = new Ajax.Request( '/ajax/vote.php', { method: 'get', parameters: pars, onComplete: this.showResponse })
    }else{
	$(what+'.msg').innerHTML="Vous avez déjà voté";
    }
  },
  showResponse : function(originalRequest){
	$(what+'.result').innerHTML = originalRequest.responseText;
  }
}
Action = {
	action : function(id){
		var what=id;
		pars="id="+id;
		var myAjax = new Ajax.Request( '/ajax/delcomment.php', { method: 'get', parameters: pars, onComplete: this.showResponse })
	},
    showResponse : function(originalRequest){
 		$(what).style.display='none';
    }
}