




function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length)
   {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

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

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}




/*  Vérification de formulaire      */
function check_form_com(){
	docForm = document.formulaire;
	if (docForm.nom.value==''){
		alert("Le champ 'Nom' est obligatoire.");
		docForm.nom.focus();
		return;
	}
	if (docForm.prenom.value==''){
		alert("Le champ 'Prénom' est obligatoire.");
		docForm.prenom.focus();
		return;
	}
	if (docForm.societe.value==''){
		alert("Le champ 'Société' est obligatoire.");
		docForm.societe.focus();
		return;
	}
	if (docForm.adresse.value==''){
		alert("Le champ 'Adresse' est obligatoire.");
		docForm.adresse.focus();
		return;
	}
	if (docForm.cp.value==''){
		alert("Le champ 'Code Postal' est obligatoire.");
		docForm.cp.focus();
		return;
	}
	if (docForm.ville.value==''){
		alert("Le champ 'Ville' est obligatoire.");
		docForm.ville.focus();
		return;
	}
	if (docForm.telephone.value==''){
		alert("Le champ 'Téléphone' est obligatoire.");
		docForm.telephone.focus();
		return;
	}
	if (docForm.email.value==''){
		alert("Le champ 'E-mail' est obligatoire.");
		docForm.email.focus();
		return;
	}
	if (docForm.email.value!=""){
		var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
		var check=/@[\w\-]+\./;
		var checkend=/\.[a-zA-Z]{2,3}$/;
		var bEmailCheck = true ;
		if(((docForm.email.value.search(exclude) != -1)||(docForm.email.value.search(check)) == -1)||(docForm.email.value.search(checkend) == -1)){
			alert("L'adresse email est incorrecte !");
			docForm.email.focus();
			return;
		       }
	}
	if (docForm.fonction.value==''){
		alert("Le champ 'Fonction' est obligatoire.");
		docForm.fonction.focus();
		return;
	}
	if (docForm.secteur.value==''){
		alert("Le champ 'Secteur d'activité' est obligatoire.");
		docForm.secteur.focus();
		return;
	}
	
	if (docForm.int1.type == "checkbox" && docForm.int1.checked==false){
	 if (docForm.int2.type == "checkbox" && docForm.int2.checked==false){
	 if (docForm.int3.type == "checkbox" && docForm.int3.checked==false){
	 if (docForm.int4.type == "checkbox" && docForm.int4.checked==false){
	 if (docForm.int5.type == "checkbox" && docForm.int5.checked==false){
	 if (docForm.int5.type == "checkbox" && docForm.int6.checked==false){
	 if (docForm.int5.type == "checkbox" && docForm.int7.checked==false){
	 if (docForm.int5.type == "checkbox" && docForm.int8.checked==false){
	 if (docForm.int5.type == "checkbox" && docForm.int9.checked==false){
	  if (docForm.int5.type == "checkbox" && docForm.int10.checked==false){
	   if (docForm.int5.type == "checkbox" && docForm.int11.checked==false){
	 if (docForm.intA.type == "checkbox" && docForm.intA.checked==false){
	 if (docForm.interet.value == ''){
	       alert("Merci de renseigner vos 'Thèmes d'intérêt.")
	        return;
       } 
       }
       }
       }
       }
       }
       } 
        }
         }
          }
           }
            }
             }
	

	docForm.action='email-contact.php';
	docForm.submit(true);
}

function alert_submit_complete() {
	alert("\n\n\n\Votre demande de documentation a bien été prise en compte.\n\n\n");
}

function onbodyloaded() {

	if(submit_complete) alert_submit_complete()

}

var submit_complete = false;
window.onload = onbodyloaded;


/*  Fin Vérification de formulaire      */




/*     Image Aléatoire */

function rand_number(n)
{
	var x;
	x=Math.round(Math.random()*100);
	x%=n;
	return x;
}
function banner()
{
	var img = new Array();
	
	img[0]='<img src="../image/top1.jpg" border=0 width="492" height="92" >';
	img[1]='<img src="../image/top2.jpg" border=0 width="492" height="92" >';
	img[2]='<img src="../image/top3.jpg" border=0 width="492" height="92" >';
	img[3]='<img src="../image/top4.jpg" border=0 width="492" height="92" >';
	
	var n=rand_number(4);    // Egal au nombre d'images
	document.write(img[n]);
}

/*    Fin  Image Aléatoire */

/* Open Windows   */
function openpopWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}


function OuvreInfo(n) {
	var w=525;
	var h=450;
	var p = 'scrollbars=yes,width=' + w + ',height=' + h + ',left=' + (screen.width-w)/2 + ',top=' + (screen.height-h)/2;
	f=window.open(n,'fiche',p);
}


