<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}


function bordure(){
	if (screen.width < 1024){
		return false;
	}else{
		return true;
	}
}

function imprimer() {
    window.print();
}

function Trim(chaine) {
    var res = chaine;
    res = res.replace(/^\s+/, "");
    res = res.replace(/\s+$/, "");
    return res;
}

function TestChampText(champ, nom, langue) {
	nom = "'" + nom + "'";

    if (champ.value == "") {
        if (langue == "fr") alert("Le champ " + nom + " est vide.");
        else alert("Field " + nom + " is empty.");
        try {
            champ.focus();
            champ.select();
        } catch (e) {}
        return false;
    }

    return true;
}

function TestChampEmail(champ, langue) {
	if (Trim(champ.value) == "") {
		if (langue == "fr") alert("Le champ de l'adresse email doit être rempli.");
		else alert("The field of address email must be filled.");
		try {
            champ.focus();
            champ.select();
		} catch (e) {}
        return false;

	} else {
		var regEmail = /^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/;
		var OK = false;
		if(champ.value.toUpperCase().match(regEmail)){
			OK = true;
		}
		if (!OK) {
			if (langue == "fr") alert("V\351rifiez l\'adresse email,\nelle ne semble pas valide.");
			else alert("Check address email,\nit does not seem valid.");
			try {
			    champ.focus();
			    champ.select();
			} catch (e) {}
			return false;
		}
	/* ---- Vieille methode
		var OK = false;
		if(window.RegExp) {
			var tempStr = "a";
			var tempReg = new RegExp(tempStr);
			if(tempReg.test(tempStr)) OK = 1;
		}
		if (!OK) {
			OK = (champ.value.indexOf(".") > 2) && (champ.value.indexOf("@") > 0);
			if (!OK) {
				if (langue == "fr") alert("Vérifiez l\'adresse email,\nelle ne semble pas valide.");
				else alert("Check address email,\nit does not seem valid.");
				try {
				    champ.focus();
				    champ.select();
				} catch (e) {}
				return false;
			}
		}
	
		var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
		var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$");
		OK = !r1.test(champ.value) && r2.test(champ.value);
		if (!OK) {
			if (langue == "fr") alert("Vérifiez l\'adresse email,\nelle ne semble pas valide.");
				else alert("Check address email,\nit does not seem valid.");
				try {
				    champ.focus();
				    champ.select();
				} catch (e) {}
				return false;
		}
	------- */
	}
	
	return true;
}

function TestComboBox(champ, nom, langue) {
	nom = "'" + nom + "'";
	
	if(champ.value==0 || Trim(champ.value)=="") {
		if (langue == "fr") alert("Le champ " + nom + " n'est pas renseigné.");
        else alert("Field " + nom + " is not filled.");
        try {
            champ.focus();
        } catch (e) {}
        return false;
	}
	return true;
}

function TestComboBoxMultiple(champ, nom, langue) {
	nom = "'" + nom + "'";
	
	if(champ.length<=0) {
		if (langue == "fr") alert("Le champ " + nom + " n'est pas renseigné.");
        else alert("Field " + nom + " is not filled.");
        try {
            champ.focus();
        } catch (e) {}
        return false;
	}
	return true;
}

function TestCheckBox(champ, nom, nb, langue) {
	var i, tmp;
	
	nom = "'" + nom + "'";
	tmp = false;
	for(i=0;i<nb;i++) {
		if(champ[i].checked) tmp = true;
	}
	if(!(tmp)) {
		if (langue == "fr") alert("Le champ " + nom + " n'est pas renseigné.");
        else alert("Field " + nom + " is not filled.");
        return false;
	}
	return true;
}

function Pass(combo1,combo2) {
	if (combo1.options.selectedIndex>=0) {
		do {
			o = new Option(combo1.options[combo1.options.selectedIndex].text,combo1.options[combo1.options.selectedIndex].value);
			combo2.options[combo2.options.length]=o;
			combo1.options[combo1.options.selectedIndex]=null;
		} while(combo1.options.selectedIndex>=0);

		if(combo2.length >= 2)
			Trier(combo2);
	}
}

function Trier(combo) {
	n = combo.length;
	
	do {
		permut = false;
		i=0;		
		for(i=0;i<n-1;i=i+1) {
			t1 = combo.options[i].text;
			t2 = combo.options[i+1].text;
			if(t1.toLowerCase() > t2.toLowerCase()) {			
				tmptext = combo.options[i].text;
				tmpvalue = combo.options[i].value;
				combo.options[i].text = combo.options[i+1].text;
				combo.options[i].value = combo.options[i+1].value;
				combo.options[i+1].text = tmptext;
				combo.options[i+1].value = tmpvalue;
				permut = true;
			}
		}
	} while(permut);
}

function rollonOnglet(onglet) {
	if(actuelOng!=onglet)
		document.getElementById("onglet"+onglet).className = "on";
}

function rolloffOnglet(onglet){
	if(actuelOng!=onglet)
		document.getElementById("onglet"+onglet).className = "off";
}

function showCommunique(actif) {
	//alert('deb');
	for(var key in tabDiv) {
		document.getElementById("div"+key).className = "hide";
	}
	actuelDiv = actif;
	document.getElementById("div"+actuelDiv).className = "";
	document.getElementById("onglet"+actuelOng).className = "off";
	actuelOng = tabDiv[actuelDiv];
	document.getElementById("onglet"+actuelOng).className = "act";
}

function showNextCommunique() {
	if(actuelDiv<nbDiv){
		document.getElementById("div"+actuelDiv).className = "hide";
		document.getElementById("onglet"+actuelOng).className = "off";
		++actuelDiv;
		actuelOng = tabDiv[actuelDiv];
		document.getElementById("div"+actuelDiv).className = "";
		document.getElementById("onglet"+actuelOng).className = "act";
	}
}

function showPreviousCommunique(){
	if(actuelDiv>1){
		document.getElementById("div"+actuelDiv).className = "hide";
		document.getElementById("onglet"+actuelOng).className = "off";
		--actuelDiv;
		actuelOng = tabDiv[actuelDiv];
		document.getElementById("div"+actuelDiv).className = "";
		document.getElementById("onglet²"+actuelOng).className = "act";
	}
}

/* Affichage contacts = agences comerciales */
function hideall(except) {
	if (document.getElementById(except)) {
		for(key in tabDiv) {
			document.getElementById(tabDiv[key]).style.display='none';
			document.getElementById(except).style.display='block';
		}
	if (document.getElementById('agences')){
		document.agences.villes.value= except;
		}
	}
}

function recupform () {
	idform = document.forms["agences"].elements["villes"].value;
	hideall(idform);
}

function ImgPopup(imageName,imageWidth,imageHeight,alt,bgcolor,hugger,hugMargin) { // by E Michael Brandt of ValleyWebDesigns.com - Please leave these comments intact.
// version 3.0.2  

	if (bgcolor=="") {
		bgcolor="000000";
	}
	var adj=10
	var w = screen.width;
	var h = screen.height;
	var byFactor=1;

	if(w<740){var lift=0.90;}
	if(w>=740 & w<835){var lift=0.91;}
	if(w>=835){var lift=0.93;}
	
	if (imageWidth>w){
		byFactor = w / imageWidth;
		imageWidth = w;
		imageHeight = imageHeight * byFactor;
	}
	if (imageHeight>h-adj){
		byFactor = h / imageHeight;
		imageWidth = (imageWidth * byFactor);
		imageHeight = h; 
	}
	   
	var scrWidth = w-adj;
	var scrHeight = (h*lift)-adj;

	if (imageHeight>scrHeight){
		imageHeight=imageHeight*lift;
		imageWidth=imageWidth*lift;
	}

	var posLeft=0;
	var posTop=0;

	if (hugger == "hug image"){
		if (hugMargin == ""){hugMargin = 0;}
		
		var scrHeightTemp = imageHeight - 0 + 2*hugMargin;
		if (scrHeightTemp < scrHeight) {scrHeight = scrHeightTemp;}
		
		var scrWidthTemp = imageWidth - 0 + 2*hugMargin;
		if (scrWidthTemp < scrWidth) {scrWidth = scrWidthTemp;}
		
		if (scrHeight<100){scrHeight=100;}
		if (scrWidth<100){scrWidth=100;}
		
		posTop =  ((h-(scrHeight/lift)-adj)/2);
		posLeft = ((w-(scrWidth)-adj)/2);
 	}

	if (imageHeight > (h*lift)-adj || imageWidth > w-adj){
		imageHeight=imageHeight-adj;
		imageWidth=imageWidth-adj;
	}
	
	posTop		= parseInt(posTop);
	posLeft		= parseInt(posLeft);		
	scrWidth	= parseInt(scrWidth); 
	scrHeight	= parseInt(scrHeight);
	
	var agt=navigator.userAgent.toLowerCase();
	if (agt.indexOf("opera") != -1){
		var args= new Array();
		args[0]='parent';
		args[1]=imageName;
		var i ; document.MM_returnValue = false;
		for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
	} else {
		theWindow = '/vwd_justso.php?alt=' + alt + '&imageHeight=' + imageHeight + '&imageWidth=' + imageWidth + '&imageName=' + imageName + '&scrHeight=' + scrHeight + '&bgcolor=' + bgcolor;
		newWindow = window.open(theWindow,"newWindow", "width="+scrWidth+",height="+scrHeight+",left="+posLeft+",top="+posTop);
		newWindow.document.open();
		newWindow.document.write('<html><title>'+alt+'</title><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor=#'+bgcolor+' onBlur="self.close()" onClick="self.close()">');  
		newWindow.document.write('<table width='+imageWidth+' border="0" cellspacing="0" cellpadding="0" align="center" height='+scrHeight+' ><tr><td>');
		newWindow.document.write('<img src='+imageName+' width='+imageWidth+' height='+imageHeight+' alt="'+alt+'" title="'+alt+'" >'); 
		newWindow.document.write('</td></tr></table></body></html>');
		newWindow.document.close();
		newWindow.focus();
	}
}




//-->