<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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

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

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

// begin absolutely positioned scrollable area object scripts 
// Extension developed by David G. Miles 
// Original Scrollable Area code developed by Thomas Brattli 
function verifyCompatibleBrowser(){ 
    this.ver=navigator.appVersion 
    this.dom=document.getElementById?1:0 
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; 
    this.ie4=(document.all && !this.dom)?1:0; 
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
 
    this.ns4=(document.layers && !this.dom)?1:0; 
    this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5) 
    return this 
} 
bw=new verifyCompatibleBrowser() 
 
 
var speed=50 
 
var loop, timer 
 
function ConstructObject(obj,nest){ 
    nest=(!nest) ? '':'document.'+nest+'.' 
    this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0; 
    this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0; 
    this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight 
    this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight 
    this.up=MoveAreaUp;this.down=MoveAreaDown; 
    this.MoveArea=MoveArea; this.x; this.y; 
    this.obj = obj + "Object" 
    eval(this.obj + "=this") 
    return this 
} 
function MoveArea(x,y){ 
    this.x=x;this.y=y 
    this.css.left=this.x 
    this.css.top=this.y 
} 
 
function MoveAreaDown(move, id){ 
	if(this.y>-this.scrollHeight+objContainer[id].clipHeight){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".down("+move+","+id+")",speed) 
	} 
} 
function MoveAreaUp(move, id){ 
	if(this.y<0){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".up("+move+","+id+")",speed) 
	} 
} 
 
function PerformScroll(speed, id){ 
	if(initialised){ 
		loop=true; 
		if(speed>0) objScroller[id].down(speed, id) 
		else objScroller[id].up(speed, id) 
	} 
} 
 
function CeaseScroll(){ 
    loop=false 
    if(timer) clearTimeout(timer) 
} 
var initialised = new Array();
var objScroller = new Array(); 
var objContainer = new Array(); 
function InitialiseScrollableArea(container, content, id){ 
    objContainer[id]=new ConstructObject(container) 
    objScroller[id]=new ConstructObject(content,container) 
    objScroller[id].MoveArea(0,0) 
    objContainer[id].css.visibility='visible' 
    initialised[id]=true; 
} 
// end absolutely positioned scrollable area object scripts 

function validEmail(objMail)
{
	inda = objMail.indexOf("@",1);
	indp = objMail.indexOf(".",inda+1);
	if ((inda < 0) || (objMail.length < 3) || (indp<2) || (indp==objMail.length-1))
		return false;
	if (objMail.indexOf("@",inda+1) != -1)
		return false;
	return true;
}

function centerPopup(windowWidth, windowHeight)
	{
	if (parseInt(navigator.appVersion) >= 4) window.moveTo((screen.width/2)-(windowWidth/2+10),(screen.height/2)-(windowHeight/2+20));
	return;
	}

function redimPopup(width, height)
	{
	if (window.screen)
		{
    	window.resizeTo(width+10, height+36);
		history.back();
		}
	}
	
function format_texte_accent(txt)
	{
	var src = 'ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ';
	var dest = 'aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn';
	var txt_ok = '';
	var ok;
	
	for (var i=0 ; i<txt.length+1 ; i++)
		{
		ok = -1;
		for (var j=0 ; j<src.length+1 ; j++)
			if (txt.charAt(i)==src.charAt(j))
				ok = j;
		if (ok == -1)
			txt_ok += txt.charAt(i);
		else
			txt_ok += dest.charAt(ok);
		}
		
	return txt_ok.toUpperCase();
	}
	
function verifRecherche()
	{
	var frm = document.frmRecherche;
	var ok = false;
	
	frm.recherche_ville.value = format_texte_accent(frm.recherche_ville.value);
	//if ((frm.recherche_ville.value != '') || (frm.recherche_cp.value != ''))
		//{
		ok = true;
		//frm.action = 'recherche-centre.php';
		//}
		
	return ok;
	}

function init_lst(val)
	{
	var frm = document.frm;
	
	obj = MM_findObj('jour_'+val);
	obj.selectedIndex = 0;
	obj = MM_findObj('mois_'+val);
	obj.selectedIndex = 0;
	obj = MM_findObj('an_'+val);
	obj.selectedIndex = 0;
	}

function verifContact()
	{
	var frm = document.frm;
	
	obj = MM_findObj('nom');
	if (obj.value == '')
		{
		obj.focus();
		alert('La saisie du champ "NOM" est obligatoire');
		return false;
		}

	obj = MM_findObj('prenom');
	if (obj.value == '')
		{
		obj.focus();
		alert('La saisie du champ "PRENOM" est obligatoire');
		return false;
		}

	obj = MM_findObj('email');
	if (!validEmail(obj.value))
		{
		obj.focus();
		alert('La saisie du champ "E-MAIL" est obligatoire et de format valide');
		return false;
		}

	obj = MM_findObj('adresse');
	if (obj.value == '')
		{
		obj.focus();
		alert('La saisie du champ "ADRESSE" est obligatoire');
		return false;
		}

	obj = MM_findObj('cp');
	if (obj.value == '')
		{
		obj.focus();
		alert('La saisie du champ "CODE POSTAL" est obligatoire');
		return false;
		}

	obj = MM_findObj('ville');
	if (obj.value == '')
		{
		obj.focus();
		alert('La saisie du champ "VILLE" est obligatoire');
		return false;
		}

	//frm.action = 'contact_valid.php';
	return true;
	}

function verifRelance()
	{
	var frm = document.frm;
	
	obj = MM_findObj('nom');
	if (obj.value == '')
		{
		obj.focus();
		alert('La saisie du champ "NOM" est obligatoire');
		return false;
		}

	obj = MM_findObj('prenom');
	if (obj.value == '')
		{
		obj.focus();
		alert('La saisie du champ "PRENOM" est obligatoire');
		return false;
		}

	obj = MM_findObj('email');
	if (!validEmail(obj.value))
		{
		obj.focus();
		alert('La saisie du champ "E-MAIL" est obligatoire et de format valide');
		return false;
		}

	obj = MM_findObj('adresse');
	if (obj.value == '')
		{
		obj.focus();
		alert('La saisie du champ "ADRESSE" est obligatoire');
		return false;
		}

	obj = MM_findObj('cp');
	if (obj.value == '')
		{
		obj.focus();
		alert('La saisie du champ "CODE POSTAL" est obligatoire');
		return false;
		}

	obj = MM_findObj('ville');
	if (obj.value == '')
		{
		obj.focus();
		alert('La saisie du champ "VILLE" est obligatoire');
		return false;
		}

	objA = MM_findObj('jour_mec');
	objB = MM_findObj('mois_mec');
	objC = MM_findObj('an_mec');
	objE = MM_findObj('jour_controle');
	objF = MM_findObj('mois_controle');
	objG = MM_findObj('an_controle');
	objH = MM_findObj('marque');
	objI = MM_findObj('immatriculation');
	if ((objH.value == '') || (objI.value == ''))
		{
		alert('La saisie des champs "MARQUE" et "IMMATRICULATION" de votre véhicule sont obligatoires');
		return false;
		}
	if (((objA.value == '') || (objB.value == '') || (objC.value == '')) && ((objE.value == '') || (objF.value == '') || (objG.value == '')))
		{
		alert('La saisie du champ "DATE DE 1ERE MISE EN CIRCULATION" ou du champ "DATE DE VALIDITE DE VOTRE PROCHAIN CONTROLE TECHNIQUE" est obligatoire');
		return false;
		}
	
	//frm.action = 'contact_valid.php';
	return true;
	}

function verifContactCadeaux()
	{
	var frm = document.frm;
	
	obj = MM_findObj('nom');
	if (obj.value == '')
		{
		obj.focus();
		alert('La saisie du champ "NOM" est obligatoire');
		return false;
		}

	obj = MM_findObj('prenom');
	if (obj.value == '')
		{
		obj.focus();
		alert('La saisie du champ "PRENOM" est obligatoire');
		return false;
		}

	obj = MM_findObj('email');
	if (!validEmail(obj.value))
		{
		obj.focus();
		alert('La saisie du champ "E-MAIL" est obligatoire et de format valide');
		return false;
		}

	obj = MM_findObj('adresse');
	if (obj.value == '')
		{
		obj.focus();
		alert('La saisie du champ "ADRESSE" est obligatoire');
		return false;
		}

	obj = MM_findObj('cp');
	if (obj.value == '')
		{
		obj.focus();
		alert('La saisie du champ "CODE POSTAL" est obligatoire');
		return false;
		}

	obj = MM_findObj('ville');
	if (obj.value == '')
		{
		obj.focus();
		alert('La saisie du champ "VILLE" est obligatoire');
		return false;
		}

	objA = MM_findObj('societe');
	objB = MM_findObj('ce');
	if ((objB.checked) && (objA.value == ''))
		{
		objA.focus();
		alert('La saisie du champ "SOCIETE" est obligatoire');
		return false;
		}

	objA = MM_findObj('jour');
	objB = MM_findObj('mois');
	objC = MM_findObj('an');
	if ((objA.value == '') || (objB.value == '') || (objC.value == ''))
		{
		alert('La saisie du champ "DATE DE 1ERE MISE EN CIRCULATION" est obligatoire');
		return false;
		}
	
	return true;
	}

function verifCadeaux()
	{
	var frm = document.frm;
	
	obj = MM_findObj('nom');
	if (obj.value == '')
		{
		obj.focus();
		alert('La saisie du champ "NOM" est obligatoire');
		return false;
		}

	obj = MM_findObj('prenom');
	if (obj.value == '')
		{
		obj.focus();
		alert('La saisie du champ "PRENOM" est obligatoire');
		return false;
		}

	obj = MM_findObj('marque');
	if (obj.value == '')
		{
		obj.focus();
		alert('La saisie du champ "MARQUE" est obligatoire et de format valide');
		return false;
		}

	obj = MM_findObj('immatriculation');
	if (obj.value == '')
		{
		obj.focus();
		alert('La saisie du champ "IMMATRICULATION" est obligatoire');
		return false;
		}

	self.print();
	return true;
	}

function micro_site(centre, id)
	{
	//window.open('_micro_sites/'+centre+'/?s='+id, 'microsite', 'width=760, height=420, scrollbars=no');
	window.open('_micro_sites/?s='+id, 'microsite', 'width=760, height=420, scrollbars=no');
	}
	
function init_menu()
	{
	MM_preloadImages('images/menu_1_on.gif','images/menu_2_on.gif','images/menu_3_on.gif','images/menu_4_on.gif','images/menu_5_on.gif','images/menu_6_on.gif','images/ssmenu_1_1_on.gif','images/ssmenu_1_2_on.gif','images/ssmenu_1_3_on.gif','images/planacces_on.gif');
	}

function ssmenu(id, etat)
	{
	MM_showHideLayers('cSsmenu'+id, '', etat);
	objImg = MM_findObj('menu'+id);
	/*if (etat == 'show')
		objImg.src = 'images/menu_'+id+'_on.gif';
	if (etat == 'hide')
		objImg.src = 'images/menu_'+id+'_off.gif';*/
	}
	
function menu_go(menu, ssmenu, site)
	{
	var url = 'adresse';
	
	if (menu == 1)
		{
		if (ssmenu == 1)
			url = 'societe-qui';
		else if (ssmenu == 2)
			url = 'societe-accueillir';
		else if (ssmenu == 3)
			url = 'adresse';
		}
	else if (menu == 2)
		{
		if (ssmenu == 1)
			url = 'nosservices-legislation';
		else if (ssmenu == 2)
			url = 'nosservices-preparer';
		else if (ssmenu == 3)
			url = 'nosservices-formule';
		else if (ssmenu == 4)
			url = 'entreprises';
		}
	else if (menu == 3)
		url = 'calcul';
	else if (menu == 4)
		url = 'relance';
	else if (menu == 5)
		url = 'cadeaux';
		
	document.location.href = '?p='+url+'&s='+site;
	}
	
function aff_plan(site, width, height)
	{
	window.open('plan.php?s='+site, 'plan', 'width='+(width+25)+',height='+(height+80)+',scrollbars=yes');
	}
	
function aff_plan_2(site, width, height)
	{
	window.open('_micro_sites/plan.php?s='+site, 'plan', 'width='+(width+25)+',height='+(height+80)+',scrollbars=yes');
	}
	
function contact_microsite(site, centre, email_contact)
	{
	window.open('contact.php?s='+site+'&e='+email_contact+'&c='+centre, 'contact', 'width=470, height=420, scrollbars=yes');
	}
	
function contact()
	{
	window.open('_micro_sites/contact.php?s=0&e=&c=neutre', 'contact', 'width=470, height=420, scrollbars=yes');
	}
	
function microsite_cadeaux(centre, site)
	{
	window.open('cadeaux_inscription.php?s='+site+'&c='+centre, 'cadeaux', 'width=490, height=420, scrollbars=yes');
	}
	
function aff_img(img, width, height)
	{
	window.open('zoom_img.php?i='+img, 'image', 'width='+width+',height='+height+',scrollbars=no');
	}
	
function calcule_controle(j_c, m_c, a_c, j, m, a, c)
	{
	var a_mec = parseInt(a.options[a.selectedIndex].value);
	var m_mec = parseInt(m.options[m.selectedIndex].value)-1;
	var j_mec = parseInt(j.options[j.selectedIndex].value);
	m_c -= 1;
	
	var dateMEC = new Date(a_mec, m_mec, j_mec);
	var dateJOUR = new Date(a_c, m_c, j_c);
	var un_jour = 1000 * 60 * 60 * 24;
	var t_jour = dateMEC.getTime();
	
	if (c == 0)
		{
		// Contrôle jamais effectué
		if (j.selectedIndex == 0)
			{
			alert('Vous devez sélectionnez le jour de 1ère mise en circulation');
			return;
			}
		if (m.selectedIndex == 0)
			{
			alert('Vous devez sélectionnez le mois de 1ère mise en circulation');
			return;
			}
		if (a.selectedIndex == 0)
			{
			alert('Vous devez sélectionnez l\'année de 1ère mise en circulation');
			return;
			}
		t_jour += (((365 * 4)) * un_jour);
		}
		
	if (c == 1)
		{
		// Contrôle déjà effectué
		if (j.selectedIndex == 0)
			{
			alert('Vous devez sélectionnez le jour du dernier contrôle effectué');
			return;
			}
		if (m.selectedIndex == 0)
			{
			alert('Vous devez sélectionnez le mois du dernier contrôle effectué');
			return;
			}
		if (a.selectedIndex == 0)
			{
			alert('Vous devez sélectionnez l\'année du dernier contrôle effectué');
			return;
			}
		t_jour += (((365 * 2)-1) * un_jour);
		}
		
	var dateCONTROLE = new Date();
	dateCONTROLE.setTime(t_jour);
	if (dateCONTROLE.getTime() <= dateJOUR.getTime())
		msg = 'ATTENTION : Vous auriez dû passer votre contrôle technique obligatoire avant le ' + dateCONTROLE.getDate() + "/" + (dateCONTROLE.getMonth()+1) + "/" + dateCONTROLE.getFullYear();
	else
		msg = 'Vous devez passer votre prochain contrôle technique obligatoire avant le ' + dateCONTROLE.getDate() + "/" + (dateCONTROLE.getMonth()+1) + "/" + dateCONTROLE.getFullYear();		
	alert(msg);	
	}
	
function previsu_img(rep, lst, img)
	{
	var objLst = MM_findObj(lst);
	var objImg = MM_findObj(img);
	var src = '../images/espaceur.gif';
	
	if (objLst.selectedIndex > 0)
		src = rep + objLst.options[objLst.selectedIndex].value;
		
	objImg.src = src;
	}
	
function popup_detail(page, id)
	   {
		window.open(page+'.php?id='+id,'popup','width=453, height=312, scrollbars=no');
	   }
	   
function infos_legales()
	   {
		window.open('infos_legales.php','infoslegales','width=490, height=420, scrollbars=yes');
	   }
//-->