
function Navigateur(){
   if (navigator.appName.indexOf("Netscape") > -1) {return "Netscape";}
   if (navigator.appName.indexOf("Explorer") > -1) {return "Explorer";}
   return "Unknown";
}
 var a
 a= new Array();
 a[0]=new Image;
 a[0].src="img/lassureur-scooter-callback-ok.gif";
 a[1]=new Image;
 a[1].src="img/lassureur-scooter-callback-ok-on.gif";

function roll(img,nb) {
   eval("img.src=a["+nb+"].src");
}
//--------
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 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;
}

//== Ouverture d'uneA popup pour une image, et redimmension automatique de la fenêtre en fonction de la taille de l'image
function afficheMaxi(chemin,titre)
	{
	i1 = new Image;
	i1.src = chemin;
	html = '<HTML><HEAD><TITLE>'+titre+'</TITLE></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><CENTER><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+14,document.imageTest.height+32)"></CENTER></BODY></HTML>';
	popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1');
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close()
	};

//---------- 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";
	}
}