function gosearch(ef)
{
var s=""+ef.value;
if(s!="") {w=open("http://www.google.com/custom?q="+s,"","");return false;}
alert("Critère de recherche manquant !");
ef.focus();
return false;
}

function verif1(l,p)
{
var s;
s=l.value+"";
if(s==""){alert("Veuillez saisir votre pseudo JECAO");l.focus();return false;}
s=s.replace(/[^0-9,a-z,A-Z,-]/g, "_");
l.value=s.toLowerCase()+"";
s=p.value+"";
if(s==""){alert("Veuillez saisir le mot de passe");p.focus();return false;}
s=s.replace(/[^0-9,a-z,A-Z,-]/g, "_");
p.value=s.toLowerCase()+"";
return true;
}

function ouv(s)
{
win=open(s,"","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=300,height=200");
}

var fIE=false;
var fclr=0;
var bclr=0;

function charger()
{var img;
img=new Image();img.src="../img/accueil_on.gif";
img=new Image();img.src="../img/neuf_on.gif";
img=new Image();img.src="../img/conseils_on.gif";
img=new Image();img.src="../img/helpw_on.gif";
img=new Image();img.src="../img/tele_on.gif";
img=new Image();img.src="../img/forums_on.gif";
img=new Image();img.src="../img/contact_on.gif";
img=new Image();img.src="../img/arrow_on.gif";
}


function inFld(o)
{
if (fIE)
	{
	fclr=o.style.color;
	bclr=o.style.backgroundColor;
	o.style.color=0xF0F0F0;
	o.style.backgroundColor=0x010777;
	}
}

function outFld(o)
{
if (fIE)
	{
	o.style.color=fclr;
	o.style.backgroundColor=bclr;
	}
}


function nivSel()
{
if (fIE) document.DLG.EF_NV.value = document.DLG.LB_NV.value;
}


function nivSel2(o)
{
if (!fIE)
	{
	sz=o.options[o.selectedIndex].value;
	document.DLG.EF_NV.value=sz;
	}
}



function verif(o)
{
var sz;
var sz1;
var sz2;
//
sz1=o.PSEUDO.value;
sz2=o.PASSE.value;
if (sz1.length == 0)
	{
	alert("Saisie obligatoire du pseudo !");
	o.PSEUDO.focus();
	return 0;
	}
if (sz2.length == 0)
	{
	alert("Saisie obligatoire du mot de passe !");
	o.PASSE.focus();
	return 0;
	}
sz = sz1.replace(/[^0-9,a-z,A-Z,-]/g, "_");
o.PSEUDO.value = sz;
sz = sz2.replace(/[^0-9,a-z,A-Z,-]/g, "_");
o.PASSE.value = sz;
return 1;
}


function verif2(o)
{
var sz;
var sz1;
var sz2;
var sz3;
var sz4;
//
sz1=o.EF_ID.value;
sz2=o.EF_CS.value;
sz3=o.EF_PB.value;
sz4=o.EF_NV.value;
if (sz1.length == 0)
	{
	alert("Saisie obligatoire du pseudo !");
	o.EF_ID.focus();
	return 0;
	}
if (sz2.length == 0)
	{
	alert("Saisie obligatoire du mot de passe !");
	o.EF_CS.focus();
	return 0;
	}
if (sz3.length == 0)
	{
	alert("Saisie obligatoire du pense-bête !");
	o.EF_PB.focus();
	return 0;
	}
if (sz4.length == 0)
	{
	alert("Saisie obligatoire du niveau initial !");
	o.EF_NV.focus();
	return 0;
	}
sz = sz1.replace(/[^0-9,a-z,A-Z,-]/g, "_");
o.EF_ID.value = sz;
sz = sz2.replace(/[^0-9,a-z,A-Z,-]/g, "_");
o.EF_CS.value = sz;
sz = sz3.replace(/[^0-9,a-z,A-Z,-]/g, "_");
o.EF_PB.value = sz;
sz = sz4.replace(/[^0-9]/g, "0");
o.EF_NV.value = sz;
//
i=eval(o.EF_NV.value);
if (i < 1000 || i > 3000)
	{
	alert("Le niveau doit être compris entre 1000 et 3000 !");
	o.EF_NV.focus();
	return 0;
	}
return 1;
}

function ouvr(s)
{
w=open("html/" + s + ".html","","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=400,height=200");
}

function regl()
{
w=open("html/reglmt.html","","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,top=40,width=400,height=500");
}

function retour()
{
window.location="http://steph.nguyen.free.fr/ludochess/index.htm";
}


function valid1()
{
var s;
if (verif(document.DLG)==1)
	{
	sz = "login.php3?ps_m=";
	s = document.DLG.PSEUDO.value;
	s = s.toLowerCase();
	sz = sz + s + "&mp_m=" + document.DLG.PASSE.value;
	window.location = sz;
	}
}

function valid2()
{
var s;
if (verif2(document.DLG)==1)
	{
	s = document.DLG.EF_ID.value;
	if (confirm("Confirmez-vous la saisie?\n\nPseudo=" + s + "\nMot de passe=" + document.DLG.EF_CS.value + "\nPense-bête=" + document.DLG.EF_PB.value + "\nNiveau=" + document.DLG.EF_NV.value))
		{
		sz = "create.php3?ps_m=";
		s = s.toLowerCase();
		sz = sz + s + "&mp_m=" + document.DLG.EF_CS.value;
		sz = sz + "&pb_m=" + document.DLG.EF_PB.value;
		sz = sz + "&nv_m=" + document.DLG.EF_NV.value;
		window.location = sz;
		}
	}
}

function fmtStr(s)
{
sz=s+"";
sz = sz.replace(/[$,',"]/g, "`");
//alert(sz);
return sz;
}

if (navigator.appName.indexOf("Microsoft") != -1)
	fIE=true;
else
	fIE=false;

//charger();
