
function ValideTel(nChamp) 
{
  if (nChamp.value.length > 0) 
   {
      if(nChamp.value.length != 9) 
	  {	  
		  alert("\nEntrada inválida!\n- El número de teléfono no es válido.");
		  nChamp.focus();
		  nChamp.select();
		  return(false); 
   	  } 
	 } else
		{
		  alert("\nPor favor, introduzca un número de teléfono...");
		  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("Por favor, introduzca un número de teléfono.");
    	 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 Send_Click_Ciclomotor() { //--- pour les pages de devis GSP
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("Por favor, introduzca un número de teléfono.");
    	 document.FP.EdTel.focus();
		 document.FP.posted.value="0" ; 
		 return(false); 
	  }
	}
	else
		document.FP.posted.value="0" ; 
}
//----
//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);
	//t=eval("document.all.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); 
}
