function remoteDatas(){this.MAXIMUM_WAITING_TIME=30000;this.MINIMUM_FOR_MSG=250;this.timerForMSG=null;if(typeof XMLHttpRequest!="undefined"){this.http=new XMLHttpRequest()}else{if(window.ActiveXObject){var a=["MSXML2.XmlHttp.7.0","MSXML2.XmlHttp.6.0","MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0","MSXML2.XmlHttp.3.0","MSXML2.XmlHttp","Microsoft.XmlHttp"];for(var b=0;b<a.length;b++){try{this.http=new ActiveXObject(a[b])}catch(c){}}}}}remoteDatas.prototype.requestDatas=function(oReseauTransdev,data,page,method,sync,objToFill,onFinishFunc){if(!this.http){return false}if(!sync){sync=true}if(!onFinishFunc){onFinishFunc=false}var XhrObj=this.http;if(method=="GET"){if(data=="null"){XhrObj.open("GET",page)}else{XhrObj.open("GET",page+"?"+data,sync)}}else{if(method=="POST"){XhrObj.open("POST",page,sync)}}var requestTimer=setTimeout(function(){XhrObj.abort()},this.MAXIMUM_WAITING_TIME);var oThis=this;XhrObj.onreadystatechange=function(){if(oThis.timerForMSG){clearTimeout(oThis.timerForMSG);oThis.timerForMSG=null}if(XhrObj.readyState!=4){return}clearTimeout(requestTimer);if(XhrObj.status!=200){if(oThis.timerForMSG){clearTimeout(oThis.timerForMSG);oThis.timerForMSG=null}return}try{if(XhrObj.responseText.length>0){if(!objToFill){eval(XhrObj.responseText)}else{objToFill.innerHTML=XhrObj.responseText}if(onFinishFunc){onFinishFunc()}}if(oThis.timerForMSG){clearTimeout(oThis.timerForMSG);oThis.timerForMSG=null}}catch(err){alert("Une erreur est survenue : "+err+"\nCliquez sur OK pour continuer")}};if(method=="GET"){XhrObj.send(null)}else{if(method=="POST"){XhrObj.setRequestHeader("Content-Type","application/x-www-form-urlencoded");XhrObj.send(data)}}};function reseauTransdev(){this.mapContainer=null;this.mapArea=null;this.svgDoc=null;this.idPays=[];this.aPays=[];this.pathPictos="./img/pictos/";this.currentZone=this.getZoneFromUrl();this.lang=this.getLangFromUrl();this.aImplantations=[];this.aImplantations[this.currentZone]=[];this.timeOutId=null;this.clic=false;this.checkboxes=null;this.originalHref=null;this.init()}reseauTransdev.prototype.init=function(){if(!moviLib.findObj("map")&&!moviLib.findObj("mainmenu")){return}this.mapContainer=moviLib.findObj("map");var e=moviLib.findObj("mainmenu");if(!moviLib.hasClass(e,"reseaunav")){return}var a=e.getElementsByTagName("li");for(var d=0;d<a.length;d++){this.idPays.push(a[d].id.substring(3));this.aPays.push(a[d].firstChild.href);if(a[d].firstChild.nextSibling&&a[d].firstChild.nextSibling.nodeName=="UL"){a[d].insertBefore(this.createCollapsible(),a[d].firstChild)}}var c=this;if(this.mapContainer.firstChild.getElementsByTagName("MAP").length>0){this.mapArea=this.mapContainer.firstChild.firstChild;while(this.mapArea.nodeName!="MAP"){this.mapArea=this.mapArea.nextSibling}var b=this.mapArea.getElementsByTagName("area");for(var d=0;d<b.length;d++){b[d].onmouseover=function(f){c.overAreaHandler(this)};b[d].onmouseout=function(f){c.removeSurface(this)};if(b[d].getAttribute("id")){b[d].onclick=function(){var f=this;c.sendData("LANGUAGE="+c.lang+"&nosurface="+this.getAttribute("id").substring(2),"./inc/implantations.php","POST",null,moviLib.findObj("vignetteInfos"),function(){c.afterRequest(f)});return false}}}}if(moviLib.findObj("legende")){this.checkboxes=moviLib.findObj("legende").getElementsByTagName("INPUT");this.initCheckboxes()}this.handleDatas();if(moviLib.findObj("citySelect")){moviLib.findObj("citySelect").onchange=function(){c.displayOnly(this.options[this.selectedIndex].value)}}if(moviLib.findObj("pdfLink")){this.originalHref=moviLib.findObj("pdfLink").firstChild.href;this.createPDF()}};reseauTransdev.prototype.displayOnly=function(a){if(moviLib.findObj("vignetteInfos")&&moviLib.findObj("vignetteInfos").hasChildNodes()){moviLib.emptyDiv(moviLib.findObj("vignetteInfos"))}var c=document.getElementsByClassName(this.mapContainer,"point");if(a=="none"){for(var e=0;e<c.length;e++){moviLib.removeClass(c[e],"notme")}this.reInitAreas()}var d=a.split("_");if(d[0]=="c"){for(var e=0;e<c.length;e++){if(c[e].getAttribute("city")&&c[e].getAttribute("city")!=d[1]){moviLib.addClass(c[e],"notme")}if(c[e].getAttribute("city")&&c[e].getAttribute("city")==d[1]){moviLib.removeClass(c[e],"notme")}}this.reInitAreas()}if(d[0]=="t"){for(var e=0;e<c.length;e++){moviLib.addClass(c[e],"notme")}if(this.mapArea){var b=this.mapArea.getElementsByTagName("area");for(var e=0;e<b.length;e++){if(b[e].getAttribute("alt")&&b[e].getAttribute("alt")==d[1]){this.displaySurface(b[e]);moviLib.addClass(b[e],"onit")}else{moviLib.removeClass(b[e],"onit");b[e].onmouseout()}}}}};reseauTransdev.prototype.createPDF=function(){var e=moviLib.findObj("pdfLink");e.firstChild.onclick=function(){window.open(this.href);return false};if(!this.checkboxes){return}var c=this.originalHref;if(moviLib.findObj("bg")&&moviLib.findObj("bg").firstChild&&moviLib.findObj("bg").firstChild.nodeName=="H4"){var k=moviLib.findObj("bg").firstChild.className.split("_");c+="&"+k[0]+"="+k[1];e.firstChild.href=c}var d=0;for(var b=0;b<this.checkboxes.length;b++){if(this.checkboxes[b].checked==true){d++}}if(d==this.checkboxes.length){return}var g=document.getElementsByClassName(this.mapContainer,"point");this.pts=[];for(var b=0;b<g.length;b++){if(g[b].style.visibility!="hidden"){var a=g[b].src.split("/");this.pts.push(parseInt(g[b].style.left,10)+":"+parseInt(g[b].style.top,10)+":"+a[a.length-1]+":"+g[b].id.split("_")[1])}}if(this.pts.length>0){c+="&pts="+JSON.stringify(this.pts)}else{c+="&pts=none"}var f=document.getElementsByClassName(this.mapContainer,"surface");var j="";for(var b=0;b<f.length;b++){if(f[b].style.visibility=="hidden"){j="hidden"}}if(j.length>0){c+="&surfs="+j}e.firstChild.href=c};reseauTransdev.prototype.initCheckboxes=function(){if(!this.checkboxes){return}var b=this;for(var a=0;a<this.checkboxes.length;a++){this.checkboxes[a].onclick=function(){b.checkCheck(this)}}};reseauTransdev.prototype.checkCheck=function(d){if(d.checked){var b=document.getElementsByClassName(this.mapContainer,"point");this.hideReseaux(d,b,"visible");var a=document.getElementsByClassName(this.mapContainer,"surface");this.hideReseaux(d,a,"visible")}else{var b=document.getElementsByClassName(this.mapContainer,"point");this.hideReseaux(d,b,"hidden");var a=document.getElementsByClassName(this.mapContainer,"surface");this.hideReseaux(d,a,"hidden");if(moviLib.findObj("bg")&&moviLib.findObj("bg").firstChild&&moviLib.findObj("bg").firstChild.nodeName=="H4"){var e=d.id.split("_")[1];var c=moviLib.findObj("bg").firstChild.id.split("_")[1];if(e==c){moviLib.emptyDiv(moviLib.findObj("bg").parentNode)}}}this.createPDF()};reseauTransdev.prototype.hideReseaux=function(c,e,a){for(var b=0;b<e.length;b++){var d=c.getAttribute("value").split("_");if(e[b].getAttribute("type")&&moviLib.inArray(d,e[b].getAttribute("type").split("_")[1])){e[b].style.visibility=a}}};reseauTransdev.prototype.overAreaHandler=function(b){var a=this;if(this.timeOutId){clearTimeout(this.timeOutId)}this.timeOutId=setTimeout(function(){a.displaySurface(b)},50)};reseauTransdev.prototype.overPointHandler=function(d,c){var b=this;if(this.timeOutId){clearTimeout(this.timeOutId)}var a=moviLib.getMouseX(d)-moviLib.getPositionLeft(c.parentNode);var f=moviLib.getMouseY(d)-moviLib.getPositionTop(c.parentNode);this.timeOutId=setTimeout(function(){b.displayLabel(c,a,f)},250)};reseauTransdev.prototype.sendData=function(e,d,f,c,b,a){this.provider=new remoteDatas;this.provider.requestDatas(this,e,d,f,c,b,a)};reseauTransdev.prototype.reInitAreas=function(){if(this.mapArea){var a=this.mapArea.getElementsByTagName("area");for(var b=0;b<a.length;b++){if(moviLib.hasClass(a[b],"onit")){moviLib.removeClass(a[b],"onit");a[b].onmouseout()}}}};reseauTransdev.prototype.afterRequest=function(d){moviLib.newWindowsForLink("externe");if(moviLib.findObj("vignetteInfos")){var c=document.getElementsByClassName(moviLib.findObj("vignetteInfos"),"more");if(c.length>0){for(var b=0;b<c.length;b++){c[b].firstChild.style.cursor="pointer";c[b].firstChild.onclick=function(){moviLib.toggleClass(this.parentNode,"more","moreopen")}}}}if(moviLib.findObj("citySelect")&&d.nodeName=="IMG"){if("c_"+d.alt!=moviLib.findObj("citySelect").options[moviLib.findObj("citySelect").selectedIndex].value){moviLib.findObj("citySelect").selectedIndex=0}}if(moviLib.findObj("citySelect")&&d.nodeName=="AREA"){if("t_"+d.alt!=moviLib.findObj("citySelect").options[moviLib.findObj("citySelect").selectedIndex].value){moviLib.findObj("citySelect").selectedIndex=0}}if(!moviLib.hasClass(d,"onit")){this.reInitAreas()}switch(d.nodeName){case"IMG":if(moviLib.hasClass(d,"notme")){moviLib.removeClass(d,"notme")}var a=document.getElementsByClassName(this.mapContainer,"point");for(var b=0;b<a.length;b++){if(a[b]!=d){moviLib.addClass(a[b],"notme")}}break;case"AREA":var a=document.getElementsByClassName(this.mapContainer,"point");for(var b=0;b<a.length;b++){moviLib.addClass(a[b],"notme")}moviLib.addClass(d,"onit");break;default:break}this.createPDF()};reseauTransdev.prototype.handleDatas=function(){this.aImplantations[this.currentZone]=document.getElementsByClassName(this.mapContainer,"point");if(this.aImplantations[this.currentZone].length>0){var b=this;var c=this.aImplantations[this.currentZone].length;for(var a=0;a<c;a++){if(!is_ie){this.aImplantations[this.currentZone][a].onmouseover=function(d){if(!d){var d=window.event}b.overPointHandler(d,this)};this.aImplantations[this.currentZone][a].onmouseout=function(){b.removeLabel(this)}}this.aImplantations[this.currentZone][a].onclick=function(){var d=this;b.sendData("LANGUAGE="+b.lang+"&nopoint="+this.getAttribute("id").substring(2),"./inc/implantations.php","POST",null,moviLib.findObj("vignetteInfos"),function(){b.afterRequest(d)})}}}};reseauTransdev.prototype.getLangFromUrl=function(){var b=unescape(window.location.search.substr(1)).split("&");$_GET=new Array();for(var c=0;c<b.length;c++){$_GET[b[c].substring(0,b[c].indexOf("="))]=b[c].substr(b[c].indexOf("=")+1)}return $_GET.LANGUAGE||"fra"};reseauTransdev.prototype.getZoneFromUrl=function(){var b=unescape(window.location.search.substr(1)).split("&");$_GET=new Array();for(var c=0;c<b.length;c++){$_GET[b[c].substring(0,b[c].indexOf("="))]=b[c].substr(b[c].indexOf("=")+1)}return $_GET.nozone||0};reseauTransdev.prototype.createCollapsible=function(){var a=this;var b=document.createElement("IMG");b.className="collapsed";b.src="./img/collapsed.gif";b.onclick=function(){a.handleCollapsible(this)};return b};reseauTransdev.prototype.handleCollapsible=function(a){if(a.className=="collapsed"){a.className="expanded";a.src=a.src="./img/expanded.gif";if(a.parentNode.lastChild.nodeName=="UL"){a.parentNode.lastChild.style.display="block"}}else{a.className="collapsed";a.src="./img/collapsed.gif";if(a.parentNode.lastChild.nodeName=="UL"){a.parentNode.lastChild.style.display="none"}}};reseauTransdev.prototype.displaySurface=function(e){var d=e.className;var b=document.getElementsByClassName(this.mapContainer,"surface");if(!e.id){if(!moviLib.findObj("surface_over")){var a=document.createElement("IMG");a.setAttribute("id","surface_over");a.setAttribute("usemap",this.mapArea.previousSibling.firstChild.getAttribute("usemap"));moviLib.insertAfter(a,moviLib.findObj("bgmap").firstChild)}else{var a=moviLib.findObj("surface_over")}a.src="./svg/surfaces/"+this.mapArea.getAttribute("name")+"/"+d+".png"}else{for(var c=0;c<b.length;c++){if(b[c].getAttribute("region")&&b[c].getAttribute("region")==d){b[c].src="./svg/surfaces/"+this.mapArea.getAttribute("name")+"/"+d+".png"}}}return};reseauTransdev.prototype.removeSurface=function(d){if(this.timeOutId){clearTimeout(this.timeOutId)}var a=document.getElementsByClassName(this.mapContainer,"surface");if(!d.id){if(moviLib.findObj("surface_over")){moviLib.removeElement(moviLib.findObj("surface_over"))}}else{var c=d.className+"-off";for(var b=0;b<a.length;b++){if(!moviLib.hasClass(d,"onit")&&a[b].getAttribute("region")&&a[b].getAttribute("region")==d.className){a[b].src="./svg/surfaces/"+this.mapArea.getAttribute("name")+"/"+c+".png"}}}return};reseauTransdev.prototype.displayLabel=function(d,c,b){if(!d.alt||d.alt.length<=0){return}var a=moviLib.createDIV(null,"labelpoint","absolute");a.style.left=c+"px";a.style.top=b+22+"px";a.appendChild(document.createTextNode(d.alt));moviLib.insertAfter(a,d)};reseauTransdev.prototype.removeLabel=function(c){if(this.timeOutId){clearTimeout(this.timeOutId)}var b=document.getElementsByClassName(this.mapContainer,"labelpoint");for(var a=0;a<b.length;a++){moviLib.removeElement(b[a])}};domReady(function(){moviLib.newWindowsForLink("externe")});domReady(function(){new reseauTransdev()});
