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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//-->
function PSR_imprimer () { 
    var PSR_f1 = null; 
    var PSR_content=document.getElementById('PSR_print').parentNode.innerHTML; 
    var PSR_title=document.getElementsByTagName('title')[0].innerText; 
	var url=window.location.href;
    /*var domaine=url.substring(44,url.indexOf("/",44));// permet de prendre le nom de la marque dans l'url de la page courante
	var domaine2=url.substring(25,url.indexOf("/",25));// permet de prendre le nom de la bu dans l'url de la page courante
	var up = url.substring(25,url.indexOf(".php",25));*/
	var tab = url.split('/');
	if(tab.length > 2)
		var css = 'style_marque_'+tab[tab.length-2]+'.css';
	else var css = 'style_auto.css';
    if (PSR_f1) {if(!PSR_f1.closed) PSR_f1.close();} 
    PSR_f1 = window.open ('',"PSR_f1", "height=700,width=540,menubar=yes,scrollbars=yes,resizable=yes,,left=10,top=10"); ; 
    PSR_f1.document.open();
    PSR_f1.document.write("<html><head><title>" + PSR_title + "</title><link href=\"../../../css/"+css+"\" rel=\"stylesheet\" type=\"text/css\"></head><body bgcolor='#ffffff' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' onLoad='javascript:print()'><!--<img src=\"images/logo_print.gif\" >--><table width=\"654\" cellpadding=\"10\" cellspacing=\"0\"><tr><td><table>"+PSR_content+"</table></td></tr></table></body></html>"); 
    PSR_f1.document.close(); 
    //PSR_f1.document.getElementById('PSR_print').style.visibility='hidden'; 
    PSR_f1.focus(); 
}

function MM_jumpMenu(pays,marq){ //v3.0
  self.location.href="index.php?Pays="+pays+"&Marque="+marq;
}

/*
var NbElement_Rub2=<?=$res_rub2?>;


function closeOthers(keepit) {
	
	for(var t=1; t<=NbElement_Rub2; t++) {
		
		if(t!=parseInt(keepit)) {

			toggle_collapse('cell_'+t, 'close');
			
		} else {

			toggle_collapse('cell_'+t, 'open');
		}
	}
}

function closeAll() {

	for(var t=1; t<=NbElement_Rub2; t++) {
		
		toggle_collapse('cell_'+t, 'close');
		
	}
}

*/
function isTel(number) {
var verif = /^(01|02|03|04|05|06)[ \.\-]?[0-9]{2}[ \.\-]?[0-9]{2}[ \.\-]?[0-9]{2}[ \.\-]?[0-9]{2}$/g;;

return ( verif.test(number) );
}

function verif(){
		with(document.cv){
						
			if (Nom.value == "") {
				alert(''+saisir_nom.value+'');
				Nom.focus();
				return false;
			}
			
			if (Prenom.value == "") {
				alert(''+saisir_prenom.value+'');
				Prenom.focus();
				return false;
			}
			
			if(Adresse.value == "") {
				alert(''+saisir_adresse.value+'');
				Adresse.focus();
				return false;
			}
			
			if(Ville.value == "") {
				alert(''+saisir_ville.value+'');
				Ville.focus();
				return false;
			}
			
			if(Tel.value == "") {
				alert(''+saisir_tel.value+'');
				Tel.focus();
				return false;
			}
			
			
				
			submit();
		}
	}
	
	
function launch_res() {
	document.recherche.submit();
}


// ======================= RENAULT ==================================
/*
<!-- // Hide from old browsers 

// Maryanna Nesina
// mar@mail.bio.pu.ru
// http://www.bio.pu.ru/~mar
// http://www.webprogramming.boom.ru
// This script allows to show and hide layes for a set of main brousers
// And can be used to construct pull-down menus

// All the Layers get names from menu0 to menu_vith_nomber_m
// If we want to hide all the layers 
// we call showmenu() function without parametrs
// i.e. using onMouseOver evant

function DOMGetElement(xx) 
{
  // This function returns document's elemtnt acording it's name
  // Using Document Object Model
 if (document.getElementById) return document.getElementById(xx); 
 return nul;
}

function showmenu(name) 
{
// This is the main function that hide all the layers but the only one, 
// which name was delivered to the function as a parametr

var ii;  // cicle variable
var m=<?=$nb?>; // variable that shows maximum nomber in layers' names 
var qq;  // here we store the name of a layer that we must show
var nen; // here we store the names of all layers (in a cicle)

NeMenu =  new Array(m+1); // an array to store the objects -  all the layers that should be hidden
nename = new Array(m+1);  // an array to store the names of all the layers  that should be hidden

// cicle to store the names of all the layers that should be hidden an array
for (ii=0; ii<=m; ii++) {
  nen="menu" + ii;
  nename[ii]=nen;
   if (name) { // this
    if (nen==name) qq=ii; // flag on - if it's a name of a layer hat should be shown
   }
}

// than we should show one layer and hide all the others (in a cicle)
// we do it for all the main types of brousers 

  if (document.getElementById) { 
  // Type 1: IE5,6; NN6; Mozilla
  // if our brouser supports DOM and we can get an object according to it's name
    if (name) { // if there was a parametr
     var Menu = DOMGetElement(name); // get an object 
     Menu.style.visibility='visible'; // and show it, changing the style
    }
    for (ii=0; ii<=m; ii++) { // for all the layers
     if (ii!=qq) { // but one that should be shown
      NeMenu[ii] = DOMGetElement(nename[ii]); // get an object that we do NOT show
      NeMenu[ii].style.visibility='hidden';  // and hide it, changing the style
     }
    }
    return true; // exit function
  } // that's all for the first type of brousers

 if(document.all) { 
  // Type 2: For document.all stands IE4-6 and Opera5, but IE5,6 were gone as the 1-st type 
   if (name) document.all[name].style.visibility= 'visible'; //if there was a parametr, show that layer using style
  for (ii=0; ii<=m; ii++) { 
   // hide all the layers but one that should be shown  - using style
   if (ii!=qq) document.all[nename[ii]].style.visibility= 'hidden'; 
  }
    return true; // exit function
 } // that's all for the second type of brousers

 if (document.layers) { 
   //Type 2: NN4
   if (name) document.layers[name].visibility='show'; // if there was a parametr, show that layer using layer
    for (ii=0; ii<=m; ii++) {
    // hide all the layers but one that should be shown  - using layer
     if (ii!=qq) document.layers[nename[ii]].visibility='hide';
    }
    return true; // exit function
  } // that's all for the second type of brousers (NN4)
} 
//-->

// ==================================== FIN RENAULT ==============================================

*/
/*
function closeOthers(keepit,keepit2) {	
	
	//for(var t=1; t<=NbElement_Rub2; t++) {
	<?			
	$i=0;
	while($i<count($TableauIdRub1)) {
	
		$IdRub1=$TableauIdRub1[$i];
		
		if ($TableauLieuRub1[$IdRub1]=='G') { 
	
			if (count($TableauIdRub2[$IdRub1])>0) { 
				$a=0;
				while($a<count($TableauIdRub2[$IdRub1])) {
				
					$IdRub2=$TableauIdRub2[$IdRub1][$a];
		?>
			
						if(<?=$IdRub1?>!=parseInt(keepit)) {

							toggle_collapse('cell_R1_<?=$IdRub1?>_<?=$IdRub2?>', 'close');
							toggle_collapse('cell_R2_<?=$IdRub1?>_<?=$IdRub2?>', 'close');
													
						} else {

							toggle_collapse('cell_R1_<?=$IdRub1?>_<?=$IdRub2?>', 'open');
													
							if(<?=$IdRub2?>!=parseInt(keepit2)) {
							
								toggle_collapse('cell_R2_<?=$IdRub1?>_<?=$IdRub2?>', 'close');
							
							}else{
							
								toggle_collapse('cell_R2_<?=$IdRub1?>_<?=$IdRub2?>', 'open');
							
							}
							
						}
			
			
			<?
					$a++;
					}
				}
			}
		$i++;
		}
		?>
	//}
}*/



