function SetCookie (name, value)
{
 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;
 document.cookie = name + "=" + escape (value) +
 ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
 ((path == null) ? "" : ("; path=" + path)) +
 ((domain == null) ? "" : ("; domain=" + domain)) +
 ((secure == true) ? "; secure" : "");
}

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 null;
}

function LireParam(msg, Objet, Nom)
{
var P=GetCookie(Nom)
if (P==null || P=="")
 { // if (msg) alert("Rien n'a &eacute;t&eacute; sauv&eacute; !");
 return;
 }
var l = P.length
var a,b,c,d=0,f,g,r,s,v,i=0,va,vb;
while (d<l)
	{
	f = P.indexOf ("/", d);
 	if (f == -1) break
	s = P.substring(d+1,f-2);
	v = P.charAt(f-1)=="1"
	g = s.indexOf(".")
	if (g == -1) Objet[s] = v
	else
		{
		a = s.substring(0,g)
		va=Objet[a]
		b = s.substring(g+1,100)
		g = b.indexOf(".")
		if (g ==-1)	va[b]=v
		else
			{
			r = b.substring(0,g);
			s = b.substring(g+1,100)
			vb=va[r]; vb[s]=v; va[r]=vb;
			}
		Objet[a]=va
		}
	d = f+1
	}
}

function ChangeItem(it)
{
if (ChangeItem.arguments.length==1) ItemDate[it] = !ItemDate[it];
else{
	var a=ItemDate[it]
	if (ChangeItem.arguments.length==2)
		a[ChangeItem.arguments[1]] = !a[ChangeItem.arguments[1]];
	else{
		var b = a[ChangeItem.arguments[1]];
		b[ChangeItem.arguments[2]] = !b[ChangeItem.arguments[2]];
		a[ChangeItem.arguments[1]] = b;
		}
	ItemDate[it]=a;
	}
}
