/**************************************
AFFICHAGE DES NOTIFICATIONS DEPUIS LES 
COOKIES, LE CAS ÉCHÉANT
**************************************/

function rediriger_avec_notification(page, message, classe_notification) {
  // On enregistre le nouveau message dans un simple cookie
  $.cookie('notification_' + classe_du_message, message);//, { path: '/', domain: 'sdv.fr' });
  location.href = page;
}

$(document).ready(function() {
  if($.cookie('notification_info')) {
		jAlert($.cookie('notification_info').decodeUrl(), "Information");
    $.cookie('notification_info', null);
  }
  
  if($.cookie('notification_erreur')) {
		jAlert($.cookie('notification_erreur').decodeUrl(), "Erreur");
    $.cookie('notification_erreur', null);
  }
});





/**
  Cette fonction utilitaire rectifie le message qui se trouve 
  dans le cookie en enlevant les +.
*/
String.prototype.decodeUrl = function() {
  return unescape(this.replace(/\+/g,  " "));
}

