resul="";i=0;bon=0;
function verifier(nom, valeur)
{ status=nom
  status=valeur
  if (nom == "pw")
  resul=document.mdp.pw.value;
  { if (resul !="JLS" )
    { document.mdp.case1.value = ("mauvais mot de passe, retaper !")
      effacer(0)
      return
    }
	bon=1;
    document.mdp.case1.value = ("OK, c'est bon !")
    return
  }  
}
/*  else
    document.formulaire.case1.value = "Rien ici, svp !"
}*/
function effacer(qui)
{ document.mdp.elements[qui].value = ('')
}
function suite()
{
	alert("on est dans suite")
//	resul=toto.document.titi.document.mdp.pw.value;
//if(bon==1) 
toto.titi.close();
alert("resul = "+resul)
}
function zut()
{
	alert("on est dans zut")
titi.close();
}
function motdepasse()
{
if(ScanCookie("motdepasse")==0)
{while(resul!="JLS" && resul!=null){resul=prompt("donnez votre mot de passe","le mettre ici");}
CreationCookie("motdepasse",resul)
}
//alert("document.cookie = "+document.cookie)
}
function motdepasse1()
{
	alert('on rentre dans mot de passe ScanCookie(motdepasse)'+ ScanCookie("motdepasse"))
	if(ScanCookie("motdepasse")==0)
	{
		alert("on continue dans mot de passe")
//		while(resul!="JLS" && resul!=null)
		{
			titi=open("","","height=200,width=300,status=yes")
/*			titi.document.write('<form  name="mdp"><pre>'+
  			'<p><font face="Arial">Entrez votre mot de passe, puis OK</font></p>'+
			'<p><input type="password" name="pw" value="" onBlur="opener.verifier(this.name,this.value)"></p><p>'+
			'<p><input type="text" name="case1" value="" onChange="opener.verifier(this.name,0)"></p></pre><p>'+			
    			'<input type="button" name="submit" value="OK" onCLick="opener.suite()">'+
			'<input type="button" name="submit2" value="Annuler" onclick="opener.zut()"></p></form>')*/
			titi.document.write('<form  name="mdp">'+
  			'<p><font face="Arial">Entrez votre mot de passe, puis OK</font></p>'+
			'<p><input type="password" name="pw" value="" ></p><p>'+	
    			'<input type="button"  value="OK" onCLick="opener.opener.suite()"></form>')
//			'<input type="button"  value="Annuler" onclick="opener.opener.zut()"></p>')
		} 		
/*if(ScanCookie("motdepasse")==0)
{while(resul!="JLS" && resul!=null){resul=prompt("donnez votre mot de passe","le mettre ici");}
CreationCookie("motdepasse",resul)*/
	}
//alert("document.cookie = "+document.cookie)
}
function val(i,k)
{
	motdepasse();
if(resul!=null) {
	if(k==1) document.location.href="introspdg/sld0"+i+".htm"	
	if(k==2) document.location.href="cg92/sld0"+i+".htm"	
	if(k==3) document.location.href="capl/sld0"+i+".htm"
	if(k==4) document.location.href="cg74/sld0"+i+".htm"
	if(k==5) document.location.href="arguspdg/sld0"+i+".htm"			
	if(k==6) document.location.href="aitf/sld0"+i+".htm"		
	}
else document.location.href="ferme.htm"
}
function hum()
{
motdepasse();
if(resul!=null) 
{
	document.location.href="humoriste/bas1.htm"
	}
else document.location.href="ferme.htm";
}
function ScanCookie(variable)
{
	cook=document.cookie;
	variable+="=";
	place=cook.indexOf(variable,0);
	if(place<=-1) return("0");
	else
	{end=cook.indexOf(";",place)
	if(end<=-1)
	return(unescape(cook.substring(place+variable.length,cook.length)));
	else
	return(unescape(cook.substring(place+variable.length,end)));
}
}
function CreationCookie(nom,valeur)
{
	dateExp=new Date(2020,11,11);
	dateExp=dateExp.toGMTString();
//	document.cookie=nom+'='+escape(valeur)+';expires='+dateExp+';;';
	document.cookie=nom+'='+escape(valeur)+';;;';	
}
function bara(i)
{
//	alert("on rentre dans bara");
	toto=open("","",height="600,width=800,status=yes")
	if(i==1) toto.document.location.href="smcl02/introspdgbas.htm" 	
	if(i==2) toto.document.location.href="smcl02/cg92bas.htm" 
	if(i==3) toto.document.location.href="smcl02/caplbas.htm" 	
	if(i==4) toto.document.location.href="smcl02/cg74bas.htm" 
	if(i==5) toto.document.location.href="smcl02/arguspdgbas.htm" 	
	if(i==6) toto.document.location.href="smcl02/aitfbas.htm" 		
	
	}
