<!--
//Ferdinand Herve
function getCookieVal (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 getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0)
			break;
	}
	return false;
}  
function SetCookie (name, value) 
{
    //recuperation des arguments et du nombre d'argument 
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	var path = (argc > 3) ? argv[3] : null;
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
	//pose du cookie
	document.cookie = name + "=" + escape (value) +
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
	((path == null) ? "" : ("; path=" + path)) +
	((domain == null) ? "" : ("; domain=" + domain)) +
	((secure == true) ? "; secure" : "");
}      

function DelCookie (name,path) 
{
  if (GetCookie(name)) {
    document.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    ret = GetCookie('cadie');
  }
}

function DelCookie2 (name,ref,path)
{
var refs = GetCookie(name);
var flag = 0;
var expdate = new Date ();
expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000)); // 24 hrs from now 

var tab = refs.split("_");
for(imax=0;tab[imax];imax++);
 for(i=0;tab[i];i++)
  {
   if(tab[i] == ref)
      flag = 1;
	if(flag == 1)
	{
	  if(i==imax)
	   tab[i]=0;
	  else
          tab[i]=tab[i+1];
	}
	tab[i]='\0';
  }
for(i=0;tab[i];i++)
var newcookie="";
 for(i=0;tab[i];i++)
 {
  if(i==0)
  newcookie = tab[i];
  else
  newcookie = newcookie+"_"+tab[i];
 }

SetCookie ('cadie',newcookie,expdate,'/');
var ret = GetCookie('cadie');
}
// -->

