//tryba.jsfunction Validation() {     myWindow.close()}function ChangeTab(tabToShow){	for(i=1;i<5;i++){		tab = document.getElementById("tab"+i);		if(tabToShow==i){			tab.style.display="";		}		else{			tab.style.display="none";		}		titre = document.getElementById("titleTab"+i);		if(tabToShow==i){			if(i==4){				titre.style.backgroundImage="url('/"+dbpath+"/bg_tab_white_160.jpg')";			}			else{				titre.style.backgroundImage="url('/"+dbpath+"/bg_tab_white_130.jpg')";			}		}		else{			if(i==4){				titre.style.backgroundImage="url('/"+dbpath+"/bg_tab_green_160.jpg')";			}			else{				titre.style.backgroundImage="url('/"+dbpath+"/bg_tab_green_130.jpg')";			}		}	}			}function menuMoused(obj){	obj.style.backgroundColor = '#00589F';	lien = obj.getElementsByTagName('A');	lien[0].style.color = '#FFF';}function menuUnMoused(obj){	obj.style.backgroundColor = 'transparent';	lien = obj.getElementsByTagName('A');	lien[0].style.color = '#000';}function toggleClass(id){	try{		obj = document.getElementById(id);		numero = id.split("_");		numeroParent = numero[1];			if(id.indexOf('Ex')>=0){			controlobj = document.getElementById("ctrlmenuEx_"+numeroParent);		}		else{			controlobj = document.getElementById("ctrlmenu_"+numeroParent);		}		controlobj.style.fontWeight="bold";		linkcontrol = controlobj.getElementsByTagName("A")[0];		linkcontrol.style.fontWeight="bold";		if(id.indexOf('Ex')>=0){			idparent = "cellEx_"+numeroParent;		}		else{			idparent = "cell_"+numeroParent;		}			objparent = document.getElementById(idparent);		//alert(objparent.style.backgroundColor);		if(objparent.style.backgroundColor=="transparent"){			objparent.style.backgroundColor="#D6E3EF";		}		else{			objparent.style.backgroundColor="transparent";		}	}	catch(e){}}function toggleMenuProduit(){	obj = document.getElementById("menuProdCondense");	if(obj.style.display==""){		obj.style.display = "none";	}	else{		obj.style.display = "";	}	obj = document.getElementById("menuProdDeplie");	if(obj.style.display==""){		obj.style.display = "none";	}	else{		obj.style.display = "";	}}function afficheDescURL(code){	if(document.forms[0].code_postal){		document.forms[0].code_postal.value="";	}	if(document.forms[0].code_postal_pad){		document.forms[0].code_postal_pad.value="Code Postal";	}	var toThis = ""+code;		if (toThis.indexOf("0",0) == 0){		toThis = toThis.substring(1,toThis.length);	}	var xmlhttp = null;	var codeConcess="";	var codeCarte="";	var codeBouton="";	var libelleConcess="";		if(window.XMLHttpRequest) // Firefox		xmlhttp = new XMLHttpRequest();	else if(window.ActiveXObject) // Internet Explorer		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");	else { // XMLHttpRequest non support\u00E9 par le navigateur		alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");		return;	}		xmlhttp.open("GET", "/"+dbpath+"/get?openAgent&cp="+toThis, true);		xmlhttp.onreadystatechange = function() {		if(xmlhttp.readyState == 1 | xmlhttp.readyState == 2 | xmlhttp.readyState == 3){			if (document.getElementById){				document.getElementById("espace_conseil").style.display = "none";				document.getElementById("result_rech_concess").style.display = "block";				document.getElementById("textDiv").innerHTML = "Recherche en cours ...";				document.getElementById("mapsearch").innerHTML = "";			}else if (document.all) {				document.all["espace_conseil"].style.display = "none";				document.all["result_rech_concess"].style.display = "block";				document.all["textDiv"].innerHTML = "Recherche en cours ...";				document.all["mapsearch"].innerHTML = "";			}		}				if(xmlhttp.readyState == 4){					var indDeb = xmlhttp.responseText.indexOf("#|#",0);			var indFin = xmlhttp.responseText.lastIndexOf("#|#",xmlhttp.responseText.length);						if(indDeb == -1){				codeConcess = xmlhttp.responseText;				codeCarte =  "";			} else {				codeConcess = xmlhttp.responseText.substring(0,xmlhttp.responseText.indexOf("#|#")) + xmlhttp.responseText.substring(xmlhttp.responseText.lastIndexOf("#|#")+4, xmlhttp.responseText.length);				codeCarte = xmlhttp.responseText.substring(xmlhttp.responseText.indexOf("#|#")+4, xmlhttp.responseText.lastIndexOf("#|#"));			}						// Extraction url site concessionnaire.			var indSiteDeb = codeConcess.indexOf("site",0);			if (indSiteDeb != -1){				var indSiteFin = codeConcess.indexOf("<br",indSiteDeb);								if (indSiteFin == -1){					indSiteFin = codeConcess.length;				}								var urlSite=codeConcess.substring(indSiteDeb+8, indSiteFin);								nomConcess = codeConcess.substring(0, codeConcess.indexOf("|"));				nomConcess = nomConcess.substring(nomConcess.lastIndexOf(">")+2, nomConcess.length);								if (urlSite.indexOf("http:",0) == -1){					urlSite="site : <a href='http://"+ urlSite +"' target='_blank'>http://"+urlSite+"</a>"				}else{					urlSite="site : <a href='"+ urlSite +"' target='_blank'>"+nomConcess+"</a>"				}				codeConcess = codeConcess.substring(0,indSiteDeb)+urlSite+codeConcess.substring(indSiteFin,codeConcess.length);			}						libelleConcess = codeConcess.substring(0, codeConcess.indexOf("|"));			libelleConcess = libelleConcess.substring(libelleConcess.lastIndexOf(">")+2, libelleConcess.length);						if (document.getElementById){				document.getElementById("textDiv").innerHTML = codeConcess.replace(/\|/g,'<br>');				document.getElementById("boutRetour").innerHTML = codeBouton;								if (codeCarte == ""){					document.getElementById("mapsearch").innerHTML = "";				} else {					document.getElementById("bouton_concess").style.display = "block";					document.getElementById("titre_mapsearch").style.display = "block";					GSearch.setOnLoadCallback(LoadMapSearchControl(codeCarte, libelleConcess));				}			} else if (document.all) {								document.all["textDiv"].innerHTML = codeConcess.replace(/\|/g,'<br>');				document.all["boutRetour"].innerHTML = codeBouton;								if (codeCarte == ""){					document.all["mapsearch"].innerHTML = "";				} else {					document.all["bouton_concess"].style.display = "block";					document.all["titre_mapsearch"].style.display = "block";					GSearch.setOnLoadCallback(LoadMapSearchControl(codeCarte, libelleConcess));				}			}		}	}	xmlhttp.send(null); }function afficheDetail(cpostal, ville){	var xmlhttp = null; 	var codeConcess="";	var codeCarte="";	var codeBouton="";	var libelleConcess="";		if(window.XMLHttpRequest) // Firefox 		xmlhttp = new XMLHttpRequest(); 	else if(window.ActiveXObject) // Internet Explorer 		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 	else { // XMLHttpRequest non support\u00E9 par le navigateur 		alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 		return; 	} 		xmlhttp.open("GET", "/"+dbpath+"/get_detail?openagent&cp="+cpostal+"&nom_ville="+ville, true); 		xmlhttp.onreadystatechange = function() {		if(xmlhttp.readyState == 1 | xmlhttp.readyState == 2 | xmlhttp.readyState == 3){			if (document.getElementById){				document.getElementById("textDiv").innerHTML = "Recherche en cours ...";				document.getElementById("mapsearch").innerHTML = "";			}else if (document.all) {				document.all["textDiv"].innerHTML = "Recherche en cours ...";				document.all["mapsearch"].innerHTML = "";			}		}				if(xmlhttp.readyState == 4){			var indDeb = xmlhttp.responseText.indexOf("#|#",0);			var indFin = xmlhttp.responseText.lastIndexOf("#|#",xmlhttp.responseText.length);						if(indDeb == -1){				codeConcess = xmlhttp.responseText;				codeCarte =  "";			} else {				codeConcess = xmlhttp.responseText.substring(0,xmlhttp.responseText.indexOf("#|#")) + xmlhttp.responseText.substring(xmlhttp.responseText.lastIndexOf("#|#")+4, xmlhttp.responseText.length);				codeCarte = xmlhttp.responseText.substring(xmlhttp.responseText.indexOf("#|#")+4, xmlhttp.responseText.lastIndexOf("#|#"));			}						// Extraction url site concessionnaire.			var indSiteDeb = codeConcess.indexOf("site",0);			if (indSiteDeb != -1){				var indSiteFin = codeConcess.indexOf("<br",indSiteDeb);								if (indSiteFin == -1){					indSiteFin = codeConcess.length;				}								var urlSite=codeConcess.substring(indSiteDeb+8, indSiteFin);								if (urlSite.indexOf("http:",0) == -1){					urlSite="site : <a href='http://"+ urlSite +"' target='_blank'>http://"+urlSite+"</a>"				}else{					urlSite="site : <a href='"+ urlSite +"' target='_blank'>"+urlSite+"</a>"				}				codeConcess = codeConcess.substring(0,indSiteDeb)+urlSite+codeConcess.substring(indSiteFin,codeConcess.length);			}						libelleConcess = codeConcess.substring(0, codeConcess.indexOf("|"));			libelleConcess = libelleConcess.substring(libelleConcess.lastIndexOf(">")+2, libelleConcess.length);						/*codeBouton = "<br><input value='Retour' name='submit' type='button' align='middle' onclick='afficheDescURL(";					if (cpostal.length = 4){				codeBouton += "0";			}						codeBouton += cpostal+");'>";			*/						if (document.getElementById){				document.getElementById("textDiv").innerHTML = codeConcess.replace(/\|/g,'<br>');				document.getElementById("boutRetour").innerHTML = codeBouton;								if (codeCarte == ""){					document.getElementById("mapsearch").innerHTML = "";				} else {					document.getElementById("bouton_concess").style.display = "block";					document.getElementById("titre_mapsearch").style.display = "block";					GSearch.setOnLoadCallback(LoadMapSearchControl(codeCarte, libelleConcess));				}						}else if (document.all) {				document.all["textDiv"].innerHTML = codeConcess.replace(/\|/g,'<br>');				document.all["boutRetour"].innerHTML = codeBouton;								if (codeCarte == ""){					document.all["mapsearch"].innerHTML = "";				} else {					document.all["bouton_concess"].style.display = "block";					document.all["titre_mapsearch"].style.display = "block";					GSearch.setOnLoadCallback(LoadMapSearchControl(codeCarte, libelleConcess));				}			}		}	}	xmlhttp.send(null); }function printProduitStandard(){	table1 = document.getElementById("tableContenuProdStandard1");	table1print = document.getElementById("tableContenuProdStandard1_print");	if(table1){		table1.style.display = "none";		table1print.style.display = "block";		document.getElementById("celluleImage_print").innerHTML = document.getElementById("celluleImage").innerHTML;		document.getElementById("celluleContenu_print").innerHTML = document.getElementById("celluleContenu").innerHTML;		document.getElementById("containerTabbedContent").style.display = "none";		document.getElementById("containerTabbedContent_print").style.display = "";		document.getElementById("tab1").style.display = "";		document.getElementById("tab2").style.display = "";		document.getElementById("tab3").style.display = "";		document.getElementById("tab4").style.display = "";		document.getElementById("containerTabbedContent_print").innerHTML = document.getElementById("contenuOnglets").innerHTML;	}}function printProduitPorte(){	allDivs = document.getElementsByTagName("DIV");	for(i=0; i<allDivs.length; i++){		if(allDivs[i].className=="referencement"){			allDivs[i].style.display = "block";		}	}}function verifEnter(e){	if (e.keyCode == "13"){		if(window.document.forms[0].query.value != null){			if(window.document.forms[0].query.value != "" && window.document.forms[0].query.value != "Rechercher"){				rechercher();				return false;			}		}		if (window.document.forms[0].code_postal != null){			if (window.document.forms[0].code_postal.value != ""){				afficheDescURL(window.document.forms[0].code_postal.value);				return false;			}		}		if (window.document.forms[0].code_postal_pad != null){			if (window.document.forms[0].code_postal_pad.value != "" && window.document.forms[0].code_postal_pad.value != "Code Postal"){				window.location.replace(urlRechConcess+'?openform&cp='+window.document.forms[0].code_postal_pad.value);				return false;			}		}	}}function testUrl(){	var url=window.location.href;	if(url.lastIndexOf('cp=') != -1){		cp=url.substring(3+url.lastIndexOf('cp='));		afficheDescURL(cp);	}}function IsCP(cp){	var reg=new RegExp("^[0-9]{5}$","g");	result = reg.test(cp);	return result;}function IsNumTel(tel){	var reg=new RegExp("^[0-9+]*$","g");	result = reg.test(tel);	return result;}function myReplace(str,oldchar,newchar){	var newstr = "";	for(i=0; i<str.length; i++){		if(str.charAt(i)!=oldchar)			newstr = newstr+str.charAt(i);		else			newstr = newstr+newchar;	}	return newstr;}function rechercher() {var query =document.forms[0].query.value;// var dbpath et url ds Header http du masque parentif(query == ""||query=="Rechercher") 	""	else	if (navigator.appName=="Netscape")		window.location.replace("/"+dbpath+"/Recherche?SearchView&query="+query)	else		window.location.href("/"+dbpath+"/Recherche?SearchView&query="+query)}function LoadMapSearchControl(adresse, titreConcess) {	var options = {zoomControl : GSmapSearchControl.ZOOM_CONTROL_ENABLE_ALL, title : titreConcess,            url : "http://www.tryba.com",            idleMapZoom : GSmapSearchControl.ACTIVE_MAP_ZOOM,            activeMapZoom : GSmapSearchControl.ACTIVE_MAP_ZOOM            };      new GSmapSearchControl(            document.getElementById("mapsearch"),            adresse,            options            );}function JSbrowser() {	if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ 	ffversion=new Number(RegExp.$1); 	if (ffversion>=3){ 	TMP = "FF 3.x"; 	document.write('<input type="text" name="JSbrowserV" value="FF 3.x" style=visibility:hidden>'); 	}else if (ffversion>=2){  	TMP = "FF 2.x";  	document.write('<input type="text" name="JSbrowserV" value="FF 2.x" style=visibility:hidden>'); 	}else if (ffversion>=1){ 	TMP = "FF 1.x";  	document.write('<input type="text" name="JSbrowserV" value="FF 1.x" style=visibility:hidden>');  		}	}	else if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ 	ieversion=new Number(RegExp.$1); 	if (ieversion>=8){  	TMP = "IE 8.x";  	document.write('<input type="text" name="JSbrowserV" value="IE 8.x" style=visibility:hidden>');  	alert(TMP); 	}else if (ieversion>=7){  	TMP = "IE 7.x";  	//alert(TMP);  	document.write('<input type="text" name="JSbrowserV" value="IE 7.x" >');  	}else if (ieversion>=6){  	TMP = "IE 6.x";  	document.write('<input type="text" name="JSbrowserV" value="IE 6.x" style=visibility:hidden>');  	}else if (ieversion>=5){  	TMP = "IE 5.x";  	document.write('<input type="text" name="JSbrowserV" value="IE 5.x" style=visibility:hidden>');  		}	}	else{	TMP = "Safari"; 	document.write('<input type="text" name="JSbrowserV" value="Safari" style=visibility:hidden>');	}}function afficheVille(code, affConc){	// Validation du code postal	reCP = new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/);		var toThis = ""+code;		if (!reCP.test(toThis)) {		document.getElementById("QUE_Ville_Aff").innerHTML = ""		if (affConc == null){			document.forms[0].QUE_concession.value = "";			document.forms[0].QUE_CoordConcession.value = "";		}		return true	}		if (toThis.indexOf("0",0) == 0){		toThis = toThis.substring(1,toThis.length);	}	var xmlhttp = null; 	var codeConcess="";	var libelleConcess="";	if(window.XMLHttpRequest) // Firefox 		xmlhttp = new XMLHttpRequest(); 	else if(window.ActiveXObject) // Internet Explorer 		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 	else { // XMLHttpRequest non support\u00E9 par le navigateur 		alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 		return; 	}		xmlhttp.open("GET", "/"+dbpath+"/get_Villes?openAgent&cp="+toThis, true); 	combo = document.getElementById("QUE_Ville_Aff")	option0 = new Option("Nous recherchons votre ville...",0);	combo.options[0] = option0;		xmlhttp.onreadystatechange = function() {				if(xmlhttp.readyState == 4){			var resp= xmlhttp.responseText;						combo = document.getElementById("QUE_Ville_Aff")			if(resp.indexOf(",")>=0){				var list=new Array();				list = resp.split(",");								option0 = new Option("Veuillez s\u00E9lectionner votre ville...",0);				combo.options[0] = option0;								for(i=0;i<list.length;i++){					optiontmp = new Option(list[i],i+1);					combo.options[i+1] = optiontmp;				}			}			else{				option0 = new Option(resp,0);				combo.options[0] = option0;				document.forms[0].QUE_Ville.value = resp;				if (affConc == null){					afficheConcessionnaire(code,resp)				}			}		}	}	xmlhttp.send(null); }function setConcess(){	code = document.forms[0].QUE_CP.value;	ville = document.forms[0].QUE_Ville.value;	afficheConcessionnaire(code,ville)}function transferVille(){	ville = document.forms[0].QUE_Ville_Aff.options[document.forms[0].QUE_Ville_Aff.selectedIndex].text;	if (ville == "Veuilez s\u00E9lectionner votre ville..." || ville == "Nous recherchons votre ville..."){		document.forms[0].QUE_Ville.value = "";	}	else{		document.forms[0].QUE_Ville.value = ville;	}}function afficheConcessionnaire(code,ville){	var toThis = ""+code;	if (toThis.indexOf("0",0) == 0){		toThis = toThis.substring(1,toThis.length);	}	var xmlhttp = null; 	var codeConcess="";	var libelleConcess="";	if(window.XMLHttpRequest) // Firefox 		xmlhttp = new XMLHttpRequest(); 	else if(window.ActiveXObject) // Internet Explorer 		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 	else { // XMLHttpRequest non support\u00E9 par le navigateur 		alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 		return; 	}		xmlhttp.open("GET", "/"+dbpath+"/get_Concess?openAgent&cp="+toThis+"&ville="+ville, true); 		xmlhttp.onreadystatechange = function() {				if(xmlhttp.readyState == 1 || xmlhttp.readyState == 2 || xmlhttp.readyState == 3){			if (document.getElementById){				//tmp = document.getElementById("textDiv");				//tmp.innerHTML = "Recherche en cours ...";			}else if (document.all) {				//tmp = document.all['textDiv'];				//tmp.innerHTML = "Recherche en cours ...";			}		}		if(xmlhttp.readyState == 4){			var resp= xmlhttp.responseText;			nomconcess = resp.substring(0,(resp.indexOf('|')));						conc = document.forms[0].QUE_concession;			conc.value = nomconcess;			var coordonneesArr = resp.split("|");			var coordonnees = coordonneesArr.join("\n");			coordonnees = myReplace(coordonnees,"#","");			document.forms[0].QUE_CoordConcession.value = coordonnees;			recupMAIL(conc.value);		}	}	xmlhttp.send(null); }//    pour le challenge commercial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_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_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];}}