
function ValideTel(nChamp) 
{
  var INTEGERS = "0123456789"; 
  var valnChamp = nChamp.value;
  if(nChamp.value.length > 0)
   {
      if ((nChamp.value.length != 10) || (!AllCharsOfAreIn(valnChamp, INTEGERS)))
	  {	  
		  alert("\nSaisie invalide!\n- Le format de votre numéro de téléphone n’est pas valide.\n Merci d’entrer un numéro de 10 chiffres, sans espace.");
		  nChamp.focus();
		  nChamp.select();
		  return(false); 
   	  } 
	 }
	 else
		{
		  alert("\nVeuillez saisir un numéro de téléphone...");
		  nChamp.focus();
		  return(false); 
		}
 	return(true); 
}

function Send_Click() {
if (ValideTel(document.FP.EdTel)) 
	{
	if (document.FP.EdTel.value!="" ) {
		document.FP.posted.value="1" ; 
		fenetreCent('../infos/web_callback.asp?EdTel='+document.FP.EdTel.value,'callback',468,287,'menubar=no,scrollbars=no,statusbar=no')
		}
		else {
		 alert("Veuillez saisir un numéro de téléphone.");
    	 document.FP.EdTel.focus();
		 document.FP.posted.value="0" ; 
		 return(false); 
	  }
	}
	else
		document.FP.posted.value="0" ; 
}

function Send_ClickInTarif() {
		fenetreCent('../infos/web_model_introuv.asp','callback',468,287,'menubar=no,scrollbars=no,statusbar=no')
}


function AllCharsOfAreIn(String1, String2) {
	for(i = 0 ; i < String1.length ; i++) {
		if(String2.indexOf(String1.charAt(i)) == -1) {
			return false;
		}
	}
	return true;
}
//----
//var actif = setTimeout("fenetreCent('revelation-sante.htm','fencent',785,642,'menubar=no,scrollbars=no,statusbar=no')",100);
function fenetreCent(url,nom,largeur,hauteur,options) {
var haut=(screen.height-hauteur)/2;
var Gauche=(screen.width-largeur)/2;
	fencent=window.open(url,nom,"top="+haut+",left="+Gauche+",width="+largeur+",height="+hauteur+","+options);
}
//---------------
function OpenHelpOn(what, url) {
	Width = 952;
	if(what=='auto') {
		Height = 672;
	} else if(what=='callback') {
		Width = 484;
		Height = 287;
	} else if(what=='contact') {
		Width = 480;
		Height = 290;
	}
	var Parameters="";
	if(navigator.appName=='Netscape') {
		Parameters="menubar=no,resizable=no,screenX=0,screenY=0";
		Parameters = Parameters+",innerHeight="+Height+",innerWidth="+Width;
	} else {
		Parameters="menubar=no,resizable=no,left=0,top=0,scrollbars=yes";
		Parameters = Parameters+",height="+Height+",width="+Width;
	}
	var dummy = window.open(url,"",Parameters);
	return;
}

//---------- Fonction ChangeImages
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

//---------------------------------------- fonction des boutons Roll Over --------------------------
function MM_showHide(z) { //v3.0
  //t=eval("document.all.t"+z);
  t=document.getElementById('t'+z);
  {t.style.display="none";}
  }

function MM_swapMenu(n){
	t=document.getElementById('t'+n);
	if (t.style.display=="none"){t.style.display="block";}
	else{t.style.display="none";}
}

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;
}

function pat() {
	setTimeout("MM_showHide(2)",8800);
}

//-------- Get URL de Recette ou de PROD
function geturlFromfile(){
var xhr_object = null; 
	 
	if(window.XMLHttpRequest) // Firefox 
	   xhr_object = new XMLHttpRequest(); 
	else if(window.ActiveXObject) // Internet Explorer 
	   xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
	else { // XMLHttpRequest non supporté par le navigateur 
	   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
	   return; 
	} 
	 
	xhr_object.openA("GET", "/urlespaceperso.htm", true); 	 
	xhr_object.onreadystatechange = function() { 
	if(xhr_object.readyState == 4) 
	   //document.location=xhr_object.responseText;
	   window.open(xhr_object.responseText)
	}
	 
	xhr_object.send(null); 
}

function DisplayItem(n1,n2,x) {
	var d;
	for (i=n1; i<=n2; i++)
	{
		d = eval("document.getElementById('t'+i)");
		if (i == x)
		{
			if (d.style.display=="block")
				d.style.display="none";
			else
				d.style.display="block";
		}
		else
			d.style.display="none";
	}
}
