<!--
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 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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

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];}
}
//-->



/* FONCTION DE DÉFINITION DES CALQUES */
function NameDiv(id){
	if(document.all){ doc = document.all[id]; }
	if(document.getElementById){ doc = document.getElementById(id); }
	if(document.layers){ doc = document[id]; }
	//alert(doc);
	return doc;
}

/* FONCTION D'AFFICHAGE/MASQUAGE DES ELEMENTS */
// id : id de l'élement
// prop : propriété du display (none, block, inline)
function SetObjDisplay(id, prop){
	NameDiv(id);
	if(document.getElementById || document.all){ doc.style.display=prop; }
	if(document.layers){ doc.display=prop; }

}

/* FONCTION D'AFFICHAGE/MASQUAGE DES DIV */
// id : id du DIV
// prop : propriété de visiblity (hidden, visible)
function SetObjVisibility(id, prop){
	NameDiv(id);
	//alert(prop);
	if(document.getElementById || document.all){ doc.style.visiblity=prop; }
	if(document.layers){ doc.visiblity=prop; }
}

/* FONCTION D'AFFECTATION DE CLASSE AUX ELEMENTS */
// id : id de l'élement
// cssName : nom de la classe
function SetObjCss(id, cssName){
	NameDiv(id);
	doc.className=cssName;
}


var rubtimer;

function ClearRubs(id){
rubtimer=window.setTimeout("HideRubs('"+id+"')",500);

}

var chercher=0;
function ShowRubs(id){
	new SetObjDisplay(id, "block");
	//alert("le nombre est "+actualId);
	if (chercher != 0){
		new SetObjDisplay("regions", "none");
		new SetObjDisplay("departements", "none");
		}
	window.clearTimeout(rubtimer);
}

function HideRubs(id){
	new SetObjDisplay(id, "none");

	if (chercher != 0 && id=="Product_nav"){
		new SetObjDisplay("regions", "inline");
		new SetObjDisplay("departements", "inline");
	}
}

function ShowRubs2(id){
	new SetObjDisplay(id, "block");
	//alert("le nombre est "+actualId);
	window.clearTimeout(rubtimer);
}

function WriteSWF(path, file, width, height, wmode, bgcolor, id){
var EmbedSWF = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" id=\""+id+"\" width=\""+width+"\" height=\""+height+"\"><param name=\"movie\" value=\""+path+file+"\" /><param name=\"quality\" value=\"high\" /><param name=\"menu\" value=\"false\" /><param name=\"wmode\" value=\""+wmode+"\" /><param name=\"bgcolor\" value=\""+bgcolor+"\" /><param name=\"allowScriptAccess\" value=\"sameDomain\" /><embed src=\""+path+file+"\" bgcolor=\""+bgcolor+"\" wmode=\""+wmode+"\" menu=\"false\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" id=\""+id+"\" name=\""+id+"\" allowScriptAccess=\"sameDomain\" width=\""+width+"\" height=\""+height+"\"></embed></object>";

document.write(EmbedSWF);
}

function HelpStep2(){

}

function HideRech_Geo(){
	qs = location.search.toQueryParams();
	if(qs.Findprod_lvl1 != undefined){
		new SetObjDisplay("rech_geo", "none");
	}
}


/* VALIDATION DU FORMULAIRE D'ABONNEMENT A LA NEWSLETTER */
function validForm()
{
	var errors = alerttitle+'\n';
	var areErrors = true;


	if(document.aidechoixstep2.name.value == '')
	{
		errors += "\n- "+labelname+".";
		areErrors = false;
	}
	if(document.aidechoixstep2.firstname.value == '')
	{
		errors += "\n- "+labelfirstname+".";
		areErrors = false;
	}
	if(document.aidechoixstep2.country.value == '')
	{
		errors += "\n- "+labelcountry+".";
		areErrors = false;
	}
	if(document.aidechoixstep2.email.value == '')
	{
		errors += "\n- "+labelemail+".";
		areErrors = false;
	}else if(!checkMail(document.aidechoixstep2.email.value))
	{
		errors += "\n- "+labelwarningemail+".";
		areErrors = false;
	}

	if(document.aidechoixstep2.conditions.checked == false)
	{
		errors += "\n- "+labelwarninglegals+".";
		areErrors = false;
	}
	//
	if(!areErrors){
		alert(errors);
		return false;
	}else
	{
		return true;
	}
}


//VERIF MAIL
function checkMail(str) {
	var verif = /^[a-zA-Z0-9\-\_]{1,}[a-zA-Z0-9\.\-\_]*[a-zA-Z0-9\-\_]{1,}@[a-zA-Z0-9]{1,}[a-zA-Z0-9\.\-\_]*[a-zA-Z0-9]{1,}[.][a-zA-Z]{2,4}$/;
	if(verif.test(str)) return true;
	else return false;
}

function centerDivDetail(id){
	var item = $("f"+id);
	var positionned = Element.cumulativeScrollOffset(item);
	$('find-detail').setStyle({
		left:"201px",
		top:(positionned[1]+200)+"px"
	});
	setTimeout("centerDivDetail("+id+")",250);
}

function closeDivDetail(){
	$("find-detail").setStyle({display:"none"});
}
function googleShowLink()
{
	document.urlForm.map_google.value=googlePrepaLink();
	SetObjDisplay('Envoyer', 'none');
	SetObjDisplay('Lien', 'block');
}


function googlePrepaLink()
{
	var strUrl=window.location;

	var oMapType=map.getCurrentMapType();
	var strView='';
	switch(oMapType.AQ)
	{
		case 'Plan':strView='NORMAL';break;
		case 'Sat.':strView='SATELLITE';break;
		case 'Mixte':strView='HYBRID';break;
	}
	var aTmp=String(strUrl).split('?');
	strUrl=aTmp[0];
	aTmp=String(strUrl).split('?');
	if(aTmp.length==1){strUrl+='?';}
	else{strUrl+='&';}
	strUrl+='gmapadd='+escape(document.Formulaire.from.value);
	strUrl+='&gmapzoom='+map.getZoom();
	strUrl+='&gmapcent='+escape(map.getCenter());
	strUrl+='&gmapview='+strView;
	strUrl+='#ancre';
	return strUrl;
}

function googleAutoGo()
{
	if(document.Formulaire.from.value!="")
	{
		FoundIti(document.Formulaire.from.value,document.Formulaire.to.value);
	}
	/*else
	{
		googleAutoPlace()
	}*/

}

function googleAutoPlace()
{
	if(defZoom!=''){map.setZoom(parseInt(defZoom));}
	if(defCenter.length==2)
	{
		var latlng=new GLatLng(defCenter[0],defCenter[1]);
		map.setCenter(latlng);
	}
	setTimeout("googleAutoView()",256);

}
function googleAutoView(){if(defView!=""){ActButton(defView);}}


function googleSendShow()
{
	var oForm=$('form-envoi');
	oForm.maila.value="";
	oForm.mailde.value="";
	oForm.message.value="\n\n"+googlePrepaLink();
	SetObjDisplay('Lien', 'none');
	SetObjDisplay('Envoyer', 'block');
}

