var preimg=null;
var jsok=true;
var affich=null;
	
function check_vide(champ){
	mess="";
	if (document.all(champ).value==""){
		//alert("champ : "+document.all(champ).value);
		mess = ("Le champ ["+champ+"] n'a pas été rempli !\n");
			}
	return mess;
}

function verifMail(a){
{
	mess="";
	Madresse=document.all(a).value;
	var Mplace=Madresse.indexOf("@",1);
	var Mpoint=Madresse.indexOf(".",Mplace+1);
	if ((Mplace>-1)&&(Madresse.length>2)&&(Mpoint>1))
		{
		
		}
	else
		{
		mess="L'email saisi est incorrect !";
		}
	}
return mess;
}


function preload(imgs)
{
		preimg=new Array(imgs.length);
		for (var i=0; i<preimg.length; i++)
		{
			preimg[i]=new Image();
			preimg[i].src=imgs[i];
		}
}

function divaccon(nom)
{
 	if (!jsok) return;
	if (affich!=null)imgoff(affich);
	if (affich!=null)hidediv('div'+affich);
	imgon(nom);
	showdiv('div'+nom);
	affich=nom;
}

function divaccoff(nom)
{
 	if (!jsok) return;
	imgoff(nom);
	hidediv('div'+nom);
}

function chgimg(nom, src)
{
 	if (!jsok) return;
 	if (document.all) document.all(nom).src=src;
	else document.images[nom].src=src;
}

function chgimgdiv(nomdiv, nom, src)
{
 	if (!jsok) return;
 	if (document.all) document.all(nom).src=src;
	else document.layers[nomdiv].document.images[nom].src=src;
}

function showdiv(id)
{
 	if (!jsok) return;
	if (document.all) document.all(id).style.visibility='inherit';
	else document.layers[id].visibility='visible';
}
function hidediv(id)
{
 	if (!jsok) return;
	if (document.all) document.all(id).style.visibility='hidden';
	else document.layers[id].visibility='hidden';
}
// Replace s1 par s2 dans src
function replaceText(src, s1, s2)
{
	var d=src.indexOf(s1);
	var newsrc="";
	// s1 absent, on retourne la src telle quelle
	if (d<0)
		return src;
	for (var i=0; i<d; i++)
	{
		newsrc+=src.charAt(i);
	}
	newsrc+=s2;
	for (i=d+s1.length; i<src.length; i++)
	{
		newsrc+=src.charAt(i);
	}
	return newsrc;
}

function imgon(nom)
{
	var imgsrc="";
	if (document.all) imgsrc=document.all(nom).src;
	else imgsrc=document.images[nom].src;
	chgimg(nom, replaceText(imgsrc, "off.", "on."));
}

function imgoff(nom)
{
	var imgsrc="";
	if (document.all) imgsrc=document.all(nom).src;
	else imgsrc=document.images[nom].src;
	chgimg(nom, replaceText(imgsrc, "on.", "off."));
}

function backon(text)
{
	divretour.innerHTML="<font color=#B8E839>"+text+"</font>";
}

function backoff()
{
	divretour.innerHTML="";	
}

function imgdivon(nomdiv, nom)
{
	var imgsrc="";
	if (document.all) imgsrc=document.all(nom).src;
	else imgsrc=document.layers[nomdiv].document.images[nom].src;
	chgimgdiv(nomdiv, nom, replaceText(imgsrc, "off.", "on."));
}

function imgdivoff(nomdiv, nom)
{
	var imgsrc="";
	if (document.all) imgsrc=document.all(nom).src;
	else imgsrc=document.layers[nomdiv].document.images[nom].src;
	chgimgdiv(nomdiv, nom, replaceText(imgsrc, "on.", "off."));
}

var wininfo=null;
function myopenwin(url, w, h)
{
	wininfo=window.open(url, "zoom", "width="+w+",height="+h+",resizable=1");
	wininfo.focus();
}

