function MM_openBrWindow(theURL,winName,features)
	{window.open(theURL,winName,features);}

function popupplanzoom(){window.open('planzoom.php','plan_acces','left=50,top=50,width=570,height=425,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=no')}
function PopupImage(img,w,h) {
	titre="Photo";
	dimension = "width="+w+",height="+h;
	w=open('','image','dimension,left=0,top=0,toolbar=no,scrollbars=no,resizable=yes');	
	w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
	w.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width+12,document.images[0].height+30); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
	w.document.write("<BODY onLoad='checksize();self.focus();' onBlur='window.close();' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' border=0>");
	w.document.write("");
	w.document.write("</BODY></HTML>");
	w.document.close();
}
var tabmet=new Array("Installateur Sanitaire et thermique","Maçon, Tailleur de pierres","Couvreur, Ardoisier Zingueur","Charpentier, Constructeur Bois","Plâtrier staffeur, décorateur","Menuisier fabricant, agenceur","Ebéniste d’art","Peintre, vitrier, décorateur","Serrurier, métallier","Technicien charpentier, constructeur bois","Technicien menuisier, agenceur");
var tabnum=new Array("1","2","3","4","5","6","7","8","9","10","11");
function DecocheC(Fnom,Knom,statut)
	{
	var choix=eval("document.forms."+Fnom+"."+Knom)
	for (i=0;i<choix.length;i++) {choix[i].checked=statut;}
	}
function DoubleU(Fnom,Knom)
	{
	var choix=eval("document.forms."+Fnom+"."+Knom)
	for (i=0;i<choix.length;i++)
		{
		if(choix[3].checked==false){choix[9].checked=false;}if(choix[3].checked==true){choix[9].checked=true;}
		if(choix[5].checked==false){choix[10].checked=false;}if(choix[5].checked==true){choix[10].checked=true;}
		}
	}
function DoubleV(Fnom,Knom)
	{
	var choix=eval("document.forms."+Fnom+"."+Knom)
	for (i=0;i<choix.length;i++)
		{
		if(choix[9].checked==false){choix[3].checked=false;}if(choix[9].checked==true){choix[3].checked=true;}
		if(choix[10].checked==false){choix[5].checked=false;}if(choix[10].checked==true){choix[5].checked=true;}
		}
	}
function verif()
	{
	var strTexte="!! ERREUR DE SAISIE !!\n\n";
	var good="1";var utile=0;var diff=0;var oblige=0;
	var mailsaisi=document.formu.Rmail.value;var arobas=mailsaisi.indexOf("@");var point=mailsaisi.indexOf(".");
	var choix=eval("document.forms['formu'].elements['choix']");var nb_choix=0;
	for (i=0;i<choix.length;i++) {if(choix[i].checked==true){nb_choix++;}}
	if(document.formu.classer.value == "" && nb_choix > 0) {utile=1;diff=1;}
	if(nb_choix == 1)
		{
		for (i=0;i<choix.length;i++)
			{
			if(choix[i].checked==true && tabmet[i]==choix[i].value)
				{document.formu.classer.value = tabnum[i];}
			}
		}
	if(nb_choix > 1)
		{
		var chaine=document.formu.classer.value;var reg=new RegExp("[ ,;]+", "g");
		var tabclasser=chaine.split(reg);var temp = new Array();var temp2 = new Array();
		if(tabclasser.length != nb_choix) {diff = 1;}
		else
			{
			for (i=0;i<choix.length;i++)
				{
				if(choix[i].checked==true && tabmet[i]==choix[i].value)
					{
					var tempo=0;var trouve=0;
					for(j=0;j<tabclasser.length;j++)
						{if(tabnum[i]==tabclasser[j]){trouve=1;tempo=tempo+1}else{trouve=0;tempo=tempo+0}}
					temp[i]=tempo;
					}
				}
			}
		for(q=0;q<temp.length;q++){if(temp[q]==0){diff=1;}}
		utile=1;
		}
	else {utile=0;}
	if (document.formu.bacpro.checked==true || document.formu.tourdefrance.checked==true) {document.formu.classer.value="";}
	if (document.formu.Cnom.value=="") {oblige=1;good="0";}
	if (document.formu.Cprenom.value=="") {oblige=1;good="0";}
	if (document.formu.Cnaissance.value=="") {oblige=1;good="0";}
	if (document.formu.Clieu.value=="") {oblige=1;good="0";}
	if (document.formu.Cdep.value=="") {oblige=1;good="0";}
	if (document.formu.Cclasse.value=="") {oblige=1;good="0";}
	if (document.formu.Clv1.value=="") {oblige=1;good="0";}
	if (document.formu.Rnom.value=="") {oblige=1;good="0";}
	if (document.formu.Rprenom.value=="") {oblige=1;good="0";}
	//if (document.formu.Rmail.value=="") {oblige=1;good="0";}
	if (document.formu.Radresse.value=="") {oblige=1;good="0";}
	if (document.formu.Rcp.value=="") {oblige=1;good="0";}
	if (document.formu.Rville.value=="") {oblige=1;good="0";}
	if (document.formu.RtelD.value=="") {oblige=1;good="0";}
	if(oblige == 1) {strTexte+="Les champs précédés d\'une étoile sont obligatoires.\n";}
	if (document.formu.Rmail.value!="" && (arobas==-1||point==-1))
		{strTexte+="L\'adresse email n\'est pas valide.\n";document.formu.Rmail.focus();good="0";}	
	if (document.formu.bacpro.checked==false && document.formu.tourdefrance.checked==false && nb_choix==0)
		{strTexte+="Merci de choisir un métier.\n";good="0";}
	if(nb_choix > 1 && document.formu.classer.value == "")
		{strTexte+="Vous avez choisi plusieurs métiers\nL\'ordre de préférence est obligatoire.\n";good="0";}
	if (utile==1 && diff==1)
		{strTexte+="Merci de vérifier les métiers cochés et l\'ordre de préférence.\n";good="0";}
	if (good=="0") {alert(strTexte);return false;}
	else {document.formu.submit();}
	}
function verifpart()
	{
	var strTexte="!! ERREUR DE SAISIE !!\n\n";
	var good="1";var oblige=0;
	var mailsaisi=document.formupart.Pmail.value;var arobas=mailsaisi.indexOf("@");var point=mailsaisi.indexOf(".");
	if (document.formupart.Pnom.value=="") {oblige=1;good="0";}
	if (document.formupart.Pprenom.value=="") {oblige=1;good="0";}
	if (document.formupart.Page.value=="") {oblige=1;good="0";}
	if (document.formupart.Psit.value=="") {oblige=1;good="0";}
	if (document.formupart.Padresse.value=="") {oblige=1;good="0";}
	if (document.formupart.Pcp.value=="") {oblige=1;good="0";}
	if (document.formupart.Pville.value=="") {oblige=1;good="0";}
	if (document.formupart.PtelD.value=="") {oblige=1;good="0";}
	if(oblige == 1) {strTexte+="Les champs précédés d\'une étoile sont obligatoires.\n";}
	if (document.formupart.Pmail.value!="" && (arobas==-1||point==-1))
		{strTexte+="L\'adresse email n\'est pas valide.\n";document.formupart.Pmail.focus();good="0";}
	if (good=="0") {alert(strTexte);return false;}
	else {document.formupart.submit();}
	}
function verifentre()
	{
	var strTexte="!! ERREUR DE SAISIE !!\n\n";
	var good="1";var oblige=0;
	var mailsaisi=document.formuentre.Email.value;var arobas=mailsaisi.indexOf("@");var point=mailsaisi.indexOf(".");
	if (document.formuentre.Eraison.value=="") {oblige=1;good="0";}
	if (document.formuentre.Eactivite.value=="") {oblige=1;good="0";}
	if (document.formuentre.Econtact.value=="") {oblige=1;good="0";}
	if (document.formuentre.Eadresse.value=="") {oblige=1;good="0";}
	if (document.formuentre.Ecp.value=="") {oblige=1;good="0";}
	if (document.formuentre.Eville.value=="") {oblige=1;good="0";}
	if (document.formuentre.Etel.value=="") {oblige=1;good="0";}
	if(oblige == 1) {strTexte+="Les champs précédés d\'une étoile sont obligatoires.\n";}
	if (document.formuentre.Email.value!="" && (arobas==-1||point==-1))
		{strTexte+="L\'adresse email n\'est pas valide.\n";document.formuentre.Email.focus();good="0";}
	if (good=="0") {alert(strTexte);return false;}
	else {document.formuentre.submit();}
	}