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_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_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 setPointer(theRow, thePointerColor){
    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        var theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        var theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    for (var c = 0; c < rowCellsCnt; c++) {
        theCells[c].style.backgroundColor = thePointerColor;
    }

    return true;
} // end of the 'setPointer()' function

function Affiche(num_calque){
	var c=0;
	while(document.getElementById('description['+c+']')){
		if(c==num_calque) document.getElementById('description['+c+']').style.visibility="visible";
		else document.getElementById('description['+c+']').style.visibility="hidden";
		c++;
	}
}


function verifMail(a){
	if(a){
		testm = false ;
		for (var j=1 ; j<(a.length) ; j++){
			if (a.charAt(j)=='@'){
				if (j<(a.length-4)){
					for (var k=j ; k<(a.length-2) ; k++){
						if (a.charAt(k)=='.') testm = true;
					}
				}
			}
		}
	}
	else testm=false;
return testm ;
}

function imprimer(){
	if(window.print) window.print();
	else alert("We are very sorry, but your browser does not support this function. Most browsers allow you to print this page by using the menu \"File\" > \"Print\"");
}

function confirm_imprim(){
	if(confirm("Print this lay-out ? Ps. Please check your parameters if you are printing in a 'portrait' format ")){
		imprimer();
	}
}

function controle_recommand(obj){
	if(!obj.nom_emetteur.value){
		alert("Please enter your name and firstname. This will tel your friend who recommended this site to him/her.");
		obj.nom_emetteur.focus();
		return false;
	}
	else if(!verifMail(obj.mail_emetteur.value)){
		alert("Please enter a correct e-mail address. This will tell your friend who recommended this site to him/her. We remind you that no e-mail address will be kept on record or passed on to any third person.");
		obj.mail_emetteur.focus();
		return false;
	}
	else if(!verifMail(obj.mail_destinataire.value)){
		alert("Please enter a correct e-mail address. We remind you that no e-mail address will be kept on record or passed on to any third person.");
		obj.mail_destinataire.focus();
		return false;
	}
	else if(confirm("Recommend this to a friend ?")) return true;
	else return false;
}


function controle_doc(obj){
	if(obj.langue.selectedIndex==0){
		alert("Please choose the catalogue language");
		obj.langue.focus();
		return false;
	}
	else if(!obj.Nom.value){
		alert("Please enter your surname.");
		obj.Nom.focus();
		return false;
	}
	else if(!obj.Prenom.value){
		alert("Please enter your first name.");
		obj.Prenom.focus();
		return false;
	}
	else if(!obj.Adresse.value){
		alert("Please enter your address.");
		obj.Adresse.focus();
		return false;
	}
	else if(obj.Adresse.value.length > 255){
		alert("The field 'Adress' should not countain more than 255 characters.");
		obj.Adresse.focus();
		return false;
	}
	else if(!obj.Code_Postal.value){
		alert("Please enter your postal/zip code.");
		obj.Code_Postal.focus();
		return false;
	}
	else if(!obj.Ville.value){
		alert("Please enter your city.");
		obj.Ville.focus();
		return false;
	}
	else if(obj.pays.selectedIndex==0){
		alert("Please enter your region/county.");
		obj.pays.focus();
		return false;
	}
	else if(obj.county.length>1  && obj.county.selectedIndex==0){
		alert("Please enter your region/county.");
		obj.county.focus();
		return false;
	}
	else if((obj.E_Mail.value)&&(!verifMail(obj.E_Mail.value))){
		alert("The field 'E-mail' is not correct.");
		obj.E_Mail.focus();
		return false;
	}
	else if(obj.Possesseur.selectedIndex==0){
		alert("Do you own a motorhome ?");
		obj.Possesseur.focus();
		return false;
	}
	else if((obj.Annee.value)&&(isNaN(obj.Annee.value)||obj.Annee.value.length!=4)){
		alert("The field 'Model year' must contain a number.");
		obj.Annee.focus();
		return false;
	}
	else if((obj.Nombre_Personne.value)&&(isNaN(obj.Nombre_Personne.value))){
		alert("The field 'Number of persons in the household' must contain a number.");
		obj.Nombre_Personne.focus();
		return false;
	}
	else if(obj.Message.value.length > 255){
		alert("The field 'Comments' should not contain more than 255 characters.");
		obj.Message.focus();
		return false;
	}
	else if(confirm("Send ?")) return true;
	else return false;
}


