$(document).ready(function() {

	if(getCookie("ecitizenflash") == null) {
		date = new Date;
		date.setMonth(date.getMonth() + 1);
		setCookie("ecitizenflash", "true", date);
        if(getCookie("ecitizenflash") != null) {
			var t = "Réductions et ventes flash sur e-Citizen";
			var url = AJAX_PATH + "flash.ajax.php";
			var a = url +"?width=410&height=510";
			var g = false;
			tb_show(t,a,g);
		}
	}
	
});

/* Fonctions de gestion des cookies */
function setCookie(name, value, exp) {
  document.cookie = name + "=" + escape(value) +
  ((exp == null) ? "" : ("; expires=" + exp.toGMTString())) + 
  ";path=/";
}

function getCookieArgs(offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1) endstr=document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr)); 
}

function getCookie(name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i<clen) {
	var j = i + alen;
	if (document.cookie.substring(i, j) == arg)
	   return getCookieArgs(j);
	i = document.cookie.indexOf(" ", i) + 1;
	if (i == 0) break;
  }
  return null; 
}