var JoursVie = 60;
var Expiration = new Date(); 
Expiration.setTime(Expiration.getTime() + (JoursVie*24*60*60*1000));
var Compteur
var BlancGris;

function AfficherListe() {
var NbreTaches = RecupererCookie('PT_NbreTaches');
var i;
var Tache;
if (NbreTaches == null) {
	NbreTaches = 0;
	}
Compteur = 0; BlancGris = 0;
for (i=1; i <= NbreTaches; i++) {
	Tache = RecupererCookie('PT_Tache'+i);
	if (Tache != null) {
		AfficherTache(Tache, i);
      }
   }
}

function SupprimerTache(Num) {
EffacerCookie('PT_Tache'+Num);
window.location = window.location;
}

function AfficherTache (Tache, Num) {
var color = "";
BlancGris = 1 - BlancGris;
if (BlancGris==1) {color = "bgcolor='#FFCC66'"} ;
Compteur++;
document.write("<tr " + color + ">");
document.write("<td width=10% align=center valign=top><b>"+"<font face='MS Sans Serif'>"+Compteur);
document.write("<td width=75% align=left  >"+"<font face='MS Sans Serif'>"+Tache+"</font>");
document.write("<td width=15% align=center>"+"<a href='javascript:SupprimerTache(" + Num + ")'><small>Effacer</a>");
}

function AjouterTache() {
var NbreTaches = RecupererCookie('PT_NbreTaches');
var i;
var Tache;
if (NbreTaches == null) {NbreTaches = 0;}
Tache = prompt("Entrez une nouvelle action dans votre Aide-Mémoire Corail-Net !","action ?");
if ((Tache != null) && (Tache != "undefined" )) {
	NbreTaches++;
	EcrireCookie('PT_Tache'+NbreTaches, Tache, Expiration);
	EcrireCookie('PT_NbreTaches',NbreTaches, Expiration);
	window.location = window.location;
   }
}

function RecupererValCookie (rang) {  
var finchaine = document.cookie.indexOf (";", rang);  
if (finchaine == -1)    
	{finchaine = document.cookie.length;}
return unescape(document.cookie.substring(rang, finchaine));
}

function RecupererCookie (nom) {  
var argument = nom + "=";  
var longueurArgument = argument.length;  
var NbreCookies = document.cookie.length;  
var i = 0;  
while (i < NbreCookies) {    
	var j = i + longueurArgument;    
	if (document.cookie.substring(i, j) == argument)      
		{return RecupererValCookie (j);}
	i = document.cookie.indexOf(" ", i) + 1;    
	if (i == 0) break;   
}  
return null;
}

function EcrireCookie (nom, valeur, expire) {  
var valeurArgument = EcrireCookie.arguments;  
var CpteArgument = EcrireCookie.arguments.length;  
document.cookie = nom + "=" + escape (valeur) +"; expires=" + expire.toGMTString() + "; ";
}

function EffacerCookie (nom) {  
var Expiration = new Date();  
Expiration.setTime (Expiration.getTime() - 1);  
var cval = RecupererCookie (nom);  
document.cookie = nom + "=" + cval + "; expires=" + Expiration.toGMTString();
}

function affiche() {
arg =  "scrollbars=yes,resizable=yes,width=350,height=380,left=0,top=0,";
AffWindow= window.open("liste.html","fen1",arg);
}

function pop_up() {
	cond="toolbar=0,location=0,menubar=0,scrollbars=1,resizable=1,width=400,height=350,top=200,left=150";
	mafen2=window.open("","zz2",cond)
	mafen2.document.write("<HTML><HEAD><LINK REL=styleSheet HREF='corail22.css' TYPE='text/css'></HEAD>"); 
	mafen2.document.write("<body scroll=auto onBlur='window.close()'><div align=center>");
	msg= "<table width=90%><tr><td align=left><div class='Bandeau_Form' style='background-color:#FF80FF;font-size:1.1em;font-weight:bold'>AIDE-M&Eacute;MOIRE Corail-Net</div><br><span style='font-weight:bold;color:red'>Explications :</span><br>";
	msg+= "<br><span style='font-size:0.75em'>L'Aide-M&eacute;moire Corail-Net est un petit m&eacute;mo pour lister quelques actions simples et les m&eacute;moriser.<br>";
	msg+= "<br>Ajoutez une action en cliquant sur le lien et en rentrant votre texte dans l'invite de script.<br>";
	msg+= "<br>Vous les supprimerez lorsqu'elles seront ex&eacute;cut&eacute;es ou périm&eacute;es, en cliquant sur le lien 'Effacer'.<br>";
	msg+= "<br>Vous seul avez acc&egrave;s &agrave; votre Aide-M&eacute;moire Corail-Net par l'utilisation d'un petit fichier texte (cookie) r&eacute;sidant sur votre PC.</font><br>";
	msg+= "</span></td></tr></table><br><input type=button value='fermer la fen&ecirc;tre' onClick=self.close()><br><br>";
	mafen2.document.write(msg) ;
	mafen2.document.close();
}

