
/**************************************/
/*  FONCTION VERIFICATION FORMUKLAIRE
/*************************************/
/*verif formulaire infos persos*/
function VerifInfos(chaine,chaine1,contact,id,id2,id3,chaine2,chaine3,chaine4,chaine5,chaine6,chaine7,chaine8)
{
	if (chaine7.value=="" ||chaine8.value=="" )
	{
				alert(alert5);
				return false;
	}

	if (chaine.value!="" ||chaine1.value!="")
	{
		if (chaine.value!=chaine1.value)
		{
	   		alert(alert1);
	   		chaine1.style.borderColor='#FFC77E';
	   		chaine1.focus();
	   		return false;
 		}

 		if(chaine.value.length<6){
 		 	alert(alert2);
	   		chaine.style.borderColor='#FFC77E';
	  	 	chaine.focus();
	   		return false;
 		}
 	}

	//verif email
	var mail=/^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/g;
	email=contact.value;
	if (email!=""){
	var resultat = email.match(mail);
       if(resultat!=null && resultat.length==1)
       {
       }
       else
       {
       	   	alert(alert3);
       	   	contact.style.borderColor='#FFC77E';
			contact.focus();
       		return false;
       }
	}
	else
	{
		alert(alert4);
		contact.style.borderColor='#FFC77E';
		contact.focus();
		return false;
	}

	//envoi par courrier
	if (document.getElementById(id).checked==true){
		//pro
		if (document.getElementById(id2).checked==true){
			//organisme
			if (chaine2.value=="" ){
				alert(alert10);
				return false;
			}
			if (chaine3.value=="" ||chaine4.value=="" ||chaine5.value==""||chaine6.value=="")
			{
				alert(alert5);
				return false;
			}
		}
		//perso
		if (document.getElementById(id3).checked==true){

			if (chaine3.value=="" ||chaine4.value=="" ||chaine5.value=="" ||chaine6.value=="")
			{
				alert(alert5);
				return false;
			}
		}
	}

	if (document.form_infos.organisme.value=='' && document.form_infos.appeldoffres.checked == true){
	alert(alert_organime_appeldoffres);
	return false;
	}


}

/*verif formulaire enregistrement*/
/*verif formulaire newsletter*/
function VerifInscr(chaine,chaine1,contact,contact1,chaine2,chaine3)
{
	if (chaine2.value=="" ||chaine3.value=="")
	{
		alert(alert5);
	   	return false;
	}

	if (chaine.value=="" ||chaine1.value=="")
	{
	   alert(alert6);
	   chaine1.style.borderColor='#FFC77E';
	   chaine1.focus();
	   return false;
 	}else{
	 	if (chaine.value!=chaine1.value)
		{
	   		alert(alert7);
	   		chaine1.style.borderColor='#FFC77E';
	   		chaine1.focus();
	   		return false;
 		}

 		if(chaine.value.length<6){
 		 	alert(alert8);
	   		chaine.style.borderColor='#FFC77E';
	  	 	chaine.focus();
	   		return false;
 		}
	 }


//verif email
var mail=/^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/g;
email=contact.value;
	if (contact.value=="" || contact1.value=="")
	{
	   alert(alert13);
	   contact.style.borderColor='#FFC77E';
	   contact.focus();
	   return false;
 	}else{
	 	if (contact.value!=contact1.value)
		{
	   		alert(alert12);
	   		contact1.style.borderColor='#FFC77E';
	   		contact1.focus();
	   		return false;
 		}else{
 			if (email!="" )
			{
				var resultat = email.match(mail);
		       if(resultat!=null && resultat.length==1)
		       {
		       }
		       else
		       {
		       	   	alert(alert3);
		       	   	contact.style.borderColor='#FFC77E';
					contact.focus();
		       		return false;
		       }
			}
 		}
	}

}

/*verif desabonnement newsletter*/
function VerifNewsletter_del(chaine,contact)
{
/*
	if (chaine.value=="" )
	{
	   alert(alert9);
	   chaine.style.borderColor='#FFC77E';
	   chaine.focus();
	   return false;
 	}*/


//verif email
var mail=/^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/g;
email=contact.value;
	if (email!=""){
	var resultat = email.match(mail);
       if(resultat!=null && resultat.length==1)
       {
       }
       else
       {
       	   	alert(alert3);
       	   	contact.style.borderColor='#FFC77E';
			contact.focus();
       		return false;
       }
	}
	else
	{
		alert(alert4);
		contact.style.borderColor='#FFC77E';
		contact.focus();
		return false;
	}
}


/*verif formulaire envoi demande partenaire*/
function Verifpartenaire(chaine,chaine1,contact)
{

	if (chaine.value=="" ||chaine1.value=="")
	{
	   alert(alert5);
	   return false;
 	}

//verif email
var mail=/^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/g;
email=contact.value;
	if (email!=""){
	var resultat = email.match(mail);
       if(resultat!=null && resultat.length==1)
       {
       }
       else
       {
       	   	alert(alert3);
       	   	contact.style.borderColor='#FFC77E';
			contact.focus();
       		return false;
       }
	}
	else
	{
		alert(alert4);
		contact.style.borderColor='#FFC77E';
		contact.focus();
		return false;
	}
}


/*verif formulaire envoi demande contact*/
function Verifcontact(chaine,chaine1,contact,dest)
{
	if(dest.value=='000'){
	   alert(alert11);
	   dest.style.borderColor='#FFC77E';
	   dest.focus();
	   return false;
	}

	if (chaine.value=="" ||chaine1.value=="")
	{
	   alert(alert5);
	   return false;
 	}

//verif email
var mail=/^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/g;
email=contact.value;
	if (email!=""){
	var resultat = email.match(mail);
       if(resultat!=null && resultat.length==1)
       {
       }
       else
       {
       	   	alert(alert3);
       	   	contact.style.borderColor='#FFC77E';
			contact.focus();
       		return false;
       }
	}
	else
	{
		alert(alert4);
		contact.style.borderColor='#FFC77E';
		contact.focus();
		return false;
	}
}

/*verif formulaire envoi demande partenaire*/
function Veriflocation(chaine,chaine1,contact)
{

	if (chaine.value=="" ||chaine1.value=="")
	{
	   alert(alert5);
	   return false;
 	}

//verif email
var mail=/^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/g;
email=contact.value;
	if (email!=""){
	var resultat = email.match(mail);
       if(resultat!=null && resultat.length==1)
       {
       }
       else
       {
       	   	alert(alert3);
       	   	contact.style.borderColor='#FFC77E';
			contact.focus();
       		return false;
       }
	}
	else
	{
		alert(alert4);
		contact.style.borderColor='#FFC77E';
		contact.focus();
		return false;
	}
}

/*verif email*/
function VerifEmail(contact)
{
//verif email
var mail=/^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/g;
email=contact.value;
	if (email!=""){
	var resultat = email.match(mail);
       if(resultat!=null && resultat.length==1)
       {
       }
       else
       {
       	   	alert(alert3);
       	   	contact.style.borderColor='#FFC77E';
			contact.focus();
       		return false;
       }
	}
	else
	{
		alert(alert4);
		contact.style.borderColor='#FFC77E';
		contact.focus();
		return false;
	}
}

/**************************************/
/*  FONCTION GENERALES
/*************************************/

function popup (nomfichier,obj1,obj2,id_princ,type) {
	window.open(nomfichier+'?o1='+obj1+'&o2='+obj2+'&id='+id_princ+'&type='+type,'fenetre','width=500, height=500, scrollbars=no');

}

function pop (nomfichier) {
	window.open(nomfichier,'fenetre','width=500, height=500,resizable=yes, scrollbars=yes');
}

/*photos des fiches*/
function AfficheBlockImage(id,img,chemin,nom)
{
	document.getElementById(id).style.display='block';

			document.getElementById(img).src=chemin;
			document.getElementById(img).alt=nom;
			document.getElementById(img).title=nom;
}


function lancerflash (url,largeur,hauteur,id,id2,nom,img,chemin,type)
{
	if(type=='swf'){
	document.getElementById(id).style.display='block';
	document.getElementById(img).src=chemin;
	document.getElementById(img).alt='';
	document.getElementById(img).title='';

	var codeflash = '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
	+ 'WIDTH="' + largeur +' " HEIGHT="' + hauteur + '"'
	+ 'CODEBASE="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">'
    + '<PARAM NAME="MOVIE" VALUE="' + url + '">'
	+ '<PARAM NAME="QUALITY" VALUE="high">'
	+ '<PARAM NAME="MENU" VALUE="sameDomain">'
	+ '<EMBED SRC="' + url + '"'
    + 'WIDTH="' + largeur +' " HEIGHT="' + hauteur + '"'
	+ 'QUALITY="high"'
	+ 'NAME="' + nom +' "'
	+ 'MENU="sameDomain"'
	+ 'TYPE="application/x-shockwave-flash"'
	+ 'PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">'
    + '</EMBED>'
	+ '</OBJECT>';

   document.getElementById(id2).innerHTML=codeflash;   // écrire l'animation flash
   }else{
   document.getElementById(id2).innerHTML='';   // écrire l'animation flash
   }

}

function lancerflashvideo (url,largeur,hauteur,id,id2,img,chemin,type)
{
	if(type=='swf'){
	document.getElementById(id).style.display='block';
	document.getElementById(img).src=chemin;
	document.getElementById(img).alt='';
	document.getElementById(img).title='';

	var codeflash = '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
	+ 'WIDTH="' + largeur +' " HEIGHT="' + hauteur + '"'
	+ ' id="tv" align="middle"'
	+ 'CODEBASE="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"  >'
    + '<PARAM NAME="MOVIE" VALUE="' + url + '">'
	+ '<PARAM NAME="QUALITY" VALUE="high">'
	+ '<PARAM NAME="allowScriptAccess" VALUE="sameDomain">'
	+ '<EMBED SRC="' + url + '"'
    + 'WIDTH="' + largeur +' " HEIGHT="' + hauteur + '"'
	+ 'QUALITY="high"'
	+ 'NAME="citv"'
	+ 'allowScriptAccess="sameDomain"'
	+ 'TYPE="application/x-shockwave-flash"'
	+ 'PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">'
    + '</EMBED>'
	+ '</OBJECT>';

   document.getElementById(id2).innerHTML=codeflash;   // écrire l'animation flash
   }else{
   document.getElementById(id2).innerHTML='';   // écrire l'animation flash
   }

}


/*affice block*/
function AfficheBlock(id)
{
	if (document.getElementById(id).style.display=='block'){
	document.getElementById(id).style.display='none';
	}else{
	document.getElementById(id).style.display='block';
	}
}

function AfficheBlock_Alert(id)
{
	if (document.getElementById(id).style.display=='block'){
	document.getElementById(id).style.display='none';
	}else{
	document.getElementById('mod_top').src='pics/gen/corner_module-top-notif.gif';
	document.getElementById('mod_bottom').src='pics/gen/corner_module-bottom-notif.gif';
	document.getElementById('titreidentification').src='pics/gen/register_fr-notif.gif';
	document.getElementById('titrepass').style.color='#FFFFFF';
	document.getElementById('titrelogin').style.color='#FFFFFF';
	document.getElementById('lienpasinscrit').style.color='#FFFFFF';
	document.getElementById('cellulesep').style.background='#FFFFFF';
	document.getElementById('lienmdp').style.color='#FFFFFF';
	document.getElementById('mod_central').style.background='#D71E7E';

	document.getElementById(id).style.display='block';
	}
}

/*affice block2*/
function AfficheBlock2(id)
{
	document.getElementById(id).style.display='block';
}

/*affice block d'un check box*/
function AfficheBlockBox(id,id2)
{
	if (document.getElementById(id).checked==true){
	document.getElementById(id2).style.display='block';
	}else{
	document.getElementById(id2).style.display='none';
	}
}

/*affice block d'un radio button*/
function AfficheBlockRadio(id,id2)
{
	if (document.getElementById(id).checked==true){
	document.getElementById(id2).style.display='block';
	}else{
	document.getElementById(id2).style.display='none';
	}
}
