/* FONCTIONS POUR L'INFOBULLE */
var couleur_layer="F8CB70";
var ie4=(document.all)?1:0;
var ns4=(document.layers)?1:0;
var vnav4=(ie4|ns4)?1:0;
if (!vnav4) { event = null; }
function infobulleAffich(obj, coord) 
	{
		var val=obj["offset"+coord] ;
		if (coord=="Top")
			{
				val+=obj.offsetHeight;
			}
		while ((obj=obj.offsetParent )!=null) 
			{
				val+=obj["offset"+coord];
				if ((obj.border)&&(obj.border!=0))
					{
						val++;
					}
			}
		return val;
	}
function infobulleOff () 
	{
		if (ie4)
			{
				document.all.infobulle.style.visibility="hidden";
			}
		if (ns4)
			{
				document.infobulle.visibility="hidden";
			}
	}
function infobulleOn (event,monTexte,xpos,ypos) 
	{
		if (!vnav4) { return; }
		var infobulle_lien, infobulle_layer;
		if (ie4) 
			{
				infobulle_lien=event.srcElement;
				infobulle_layer=document.all.infobulle;
			}
		if (ns4) 
			{
				infobulle_lien=event.target;
				infobulle_layer=document.infobulle;
			}
		if (!infobulle_lien.onmouseout)
			{
				infobulle_lien.onmouseout=infobulleOff;
			}
		var infobulle_texte='<div class="infobulleapp">'+monTexte+'</div>';
		if (ie4) 
			{
				infobulle_layer.innerHTML=infobulle_texte;
				//infobulle_layer.style.top=infobulleAffich(infobulle_lien,"Top")+2;
				//infobulle_layer.style.left=infobulleAffich(infobulle_lien,"Left");
				infobulle_layer.style.top=ypos;
				infobulle_layer.style.left=xpos;
				infobulle_layer.style.visibility="visible";
			}
		if (ns4) 
			{
				infobulle_layer.document.write(infobulle_texte);
				infobulle_layer.document.close();
				infobulle_layer.document.bgColor="#"+couleur_layer;
				//infobulle_layer.top=infobulle_lien.y+20;
				//infobulle_layer.left=infobulle_lien.x;
				infobulle_layer.top=ypos;
				infobulle_layer.left=xpos;
				infobulle_layer.visibility="show";
			}
	}
/* popup */
function popupCentree(url,nom,largeur,hauteur,opt) 
	{
		var top=(screen.height-hauteur)/2;
		var left=(screen.width-largeur)/2;
		var MyWin=window.open(url,nom,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+opt);
		MyWin.focus(); 
	}
/* redirection */	
function alertRedirect(fichier)
	{
		if(confirm('Si vous changez de partie, vos modifications ne seront pas enregistrées.\r  Souhaitez-vous continuer ?'))
				{
				location.href = fichier;
				}
	}
/* validation formulaires*/
function validForm(monForm,typvalid)
	{
		if (typvalid=="recommand")
			{
				//destinataires
				if ((monForm.dest1.value=="")&&(monForm.dest2.value=="")&&(monForm.dest3.value=="")&&(monForm.dest4.value==""))
					{
						alert("Vous devez entrer l'e-mail d'au moins un \"DESTINATAIRE\".");
						monForm.dest1.focus();
						return false;
					}
				if (monForm.dest1.value!="")
					{
						var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒþŒŽšœžŸÀÁÂÃÆÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßáâåëìíîïñóôøúýþÿ0123456789-@-_.";
						var checkStr = monForm.dest1.value;
						var allValid = true;
						for (i = 0;  i < checkStr.length;  i++)
							{
								ch = checkStr.charAt(i);
								for (j = 0;  j < checkOK.length;  j++)
									if (ch == checkOK.charAt(j))
											break;
								if (j == checkOK.length)
									{
										allValid = false;
										break;
									}
							}
						if (!allValid)
							{
								alert("Entrez seulement des caractères, chiffres et \".@_-\" dans les champ \"DESTINATAIRES\".");
								monForm.dest1.focus();
								return false;
							}
						adresse = monForm.dest1.value;
						var place = adresse.indexOf("@",1);
						var point = adresse.indexOf(".",place+1);
						if (!((place > -1)&&(adresse.length >2)&&(point > 1)))
							{
								alert('\"DESTINATAIRE \" non valide.\r exemple : nom@domaine.com');
								monForm.dest1.focus();
								return false;
							}
					}
				if (monForm.dest2.value!="")
					{
						var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒþŒŽšœžŸÀÁÂÃÆÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßáâåëìíîïñóôøúýþÿ0123456789-@-_.";
						var checkStr = monForm.dest2.value;
						var allValid = true;
						for (i = 0;  i < checkStr.length;  i++)
							{
								ch = checkStr.charAt(i);
								for (j = 0;  j < checkOK.length;  j++)
									if (ch == checkOK.charAt(j))
											break;
								if (j == checkOK.length)
									{
										allValid = false;
										break;
									}
							}
						if (!allValid)
							{
								alert("Entrez seulement des caractères, chiffres et \".@_-\" dans les champ \"DESTINATAIRES\".");
								monForm.dest2.focus();
								return false;
							}
						adresse = monForm.dest2.value;
						var place = adresse.indexOf("@",1);
						var point = adresse.indexOf(".",place+1);
						if (!((place > -1)&&(adresse.length >2)&&(point > 1)))
							{
								alert('\"DESTINATAIRE \" non valide.\r exemple : nom@domaine.com');
								monForm.dest2.focus();
								return false;
							}
					}
				if (monForm.dest3.value!="")
					{
						var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒþŒŽšœžŸÀÁÂÃÆÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßáâåëìíîïñóôøúýþÿ0123456789-@-_.";
						var checkStr = monForm.dest3.value;
						var allValid = true;
						for (i = 0;  i < checkStr.length;  i++)
							{
								ch = checkStr.charAt(i);
								for (j = 0;  j < checkOK.length;  j++)
									if (ch == checkOK.charAt(j))
											break;
								if (j == checkOK.length)
									{
										allValid = false;
										break;
									}
							}
						if (!allValid)
							{
								alert("Entrez seulement des caractères, chiffres et \".@_-\" dans les champ \"DESTINATAIRES\".");
								monForm.dest3.focus();
								return false;
							}
						adresse = monForm.dest3.value;
						var place = adresse.indexOf("@",1);
						var point = adresse.indexOf(".",place+1);
						if (!((place > -1)&&(adresse.length >2)&&(point > 1)))
							{
								alert('\"DESTINATAIRE \" non valide.\r exemple : nom@domaine.com');
								monForm.dest3.focus();
								return false;
							}
					}
				if (monForm.dest4.value!="")
					{
						var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒþŒŽšœžŸÀÁÂÃÆÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßáâåëìíîïñóôøúýþÿ0123456789-@-_.";
						var checkStr = monForm.dest4.value;
						var allValid = true;
						for (i = 0;  i < checkStr.length;  i++)
							{
								ch = checkStr.charAt(i);
								for (j = 0;  j < checkOK.length;  j++)
									if (ch == checkOK.charAt(j))
											break;
								if (j == checkOK.length)
									{
										allValid = false;
										break;
									}
							}
						if (!allValid)
							{
								alert("Entrez seulement des caractères, chiffres et \".@_-\" dans les champ \"DESTINATAIRES\".");
								monForm.dest4.focus();
								return false;
							}
						adresse = monForm.dest4.value;
						var place = adresse.indexOf("@",1);
						var point = adresse.indexOf(".",place+1);
						if (!((place > -1)&&(adresse.length >2)&&(point > 1)))
							{
								alert('\"DESTINATAIRE \" non valide.\r exemple : nom@domaine.com');
								monForm.dest4.focus();
								return false;
							}
					}
				//message
				if (monForm.msg.value=="")
					{
						alert("Vous devez écrire un \"MESSAGE\".");
						monForm.msg.focus();
						return false;
					}
			}
		/* ******************************** COMMUN ******************************** */
		//prénom
		if (monForm.prenom.value=="")
			{
				alert("Vous devez indiquer votre \"PRENOM\".");
				monForm.prenom.focus();
				return false;
			}
		//nom
		if (monForm.nom.value=="")
			{
				alert("Vous devez indiquer votre \"NOM\".");
				monForm.nom.focus();
				return false;
			}
		//email
		if (monForm.email.value=="")
			{
				alert("Vous devez préciser votre \"E-MAIL\".");
				monForm.email.focus();
				return false;
			}
		if (monForm.email.value!="")
			{
				var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒþŒŽšœžŸÀÁÂÃÆÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßáâåëìíîïñóôøúýþÿ0123456789-@-_.";
				var checkStr = monForm.email.value;
				var allValid = true;
				for (i = 0;  i < checkStr.length;  i++)
					{
						ch = checkStr.charAt(i);
						for (j = 0;  j < checkOK.length;  j++)
							if (ch == checkOK.charAt(j))
									break;
						if (j == checkOK.length)
							{
								allValid = false;
								break;
							}
					}
				if (!allValid)
					{
						alert("Entrez seulement des caractères, chiffres et \".@_-\" dans le champ \"E-MAIL\".");
						monForm.email.focus();
						return false;
					}
				adresse = monForm.email.value;
				var place = adresse.indexOf("@",1);
				var point = adresse.indexOf(".",place+1);
				if (!((place > -1)&&(adresse.length >2)&&(point > 1)))
					{
						alert('\"E-MAIL \" non valide.\r exemple : nom@domaine.com');
						monForm.email.focus();
						return false;
					}
			}
		/* ************************************************************************ */
		if (typvalid=="contact")
			{
				//objet
				if (monForm.obj.value=="")
					{
						alert("Vous devez écrire un \"OBJET\".");
						monForm.obj.focus();
						return false;
					}
				//message
				if (monForm.msg.value=="")
					{
						alert("Vous devez écrire un \"MESSAGE\".");
						monForm.msg.focus();
						return false;
					}
			}
		
		if (typvalid=="faq")
			{
				//question
				if (monForm.question.value=="")
					{
						alert("Vous devez écrire une \"QUESTION\".");
						monForm.question.focus();
						return false;
					}
			}
	return true;
	}