/*
 * stats.js
 */

var successAlert = function(){
	alert("Votre demande a \351t\351 prise en compte.");
	document.location = "index.php";
}
var statsInsertRead = function(id_page){
    url = "php/stats/index.php?do=insert_read";
    params = "id_page=" + id_page;
    new Ajax.Request(url, { method: 'POST', parameters: params } );
}

var statsInsertForm = function(id_page, thematique, mail, alternative_mail,
                               civilite, prenom, nom, adresse_postal, code_postal,
                               ville, telephone, message, navigateur, ecran, resolution){

    url = "php/stats/index.php?do=insert_form";
    params = "id_page=" + id_page +
             "&thematique=" + thematique +
             "&mail=" + mail +
             "&alternative_mail=" + alternative_mail +
             "&civilite=" + civilite +
             "&prenom=" + prenom +
             "&nom=" + nom +
             "&adresse_postal=" + adresse_postal +
             "&code_postal=" + code_postal +
             "&ville=" + ville +
             "&telephone=" + telephone +
             "&message=" + message+
             "&navigateur=" + navigateur+
             "&ecran=" + ecran+
             "&resolution=" + resolution;

    new Ajax.Request(url, { method: 'POST', parameters: params, onSuccess: successAlert() } );
}


var statsInsertSatisfaction = function(id_page, satisfaction){
    url = "php/stats/index.php?do=insert_satisfaction";
    params = "id_page=" + id_page +
             "&satisfaction=" + satisfaction;
	    new Ajax.Request(url, { method: 'POST', parameters: params } );
}
