function interfaceCarte(){this.defaults={actions:["fullwindow"],wrapper:"page",panel:"menugauche",footer:"pied",topLeftLine:[1,1,1,1,1,1,1,1,1,1],topLeftCol:[1,1,1,1,1,1,1,1,1,1],bottomRightCol:[210,180,200,320,165,84,17,9,5,3],bottomRightLine:[210,180,180,284,155,76,15,8,4,2],xo:[16788,41600,43120,-77772,-226600,-180050,-48750,-48600,-48600,-744000],yo:[2369757,2214000,2682400,3146292,3280150,3251700,2699250,2699400,2700000,3432000],x_def:656000,y_def:2217000,topContainer:0,leftContainer:0,top:jQuery("#onglet").offset().top+jQuery("#onglet").height(),left:355,width:null,height:null,tileWidth:500,tileHeight:500,resolution:{A:"1",B:"3",C:"6",D:"12",E:"25",F:"50",G:"150",H:"300",I:"600",J:"2000"},echelleDisplay:{A:"100 m",B:"300 m",C:"600 m",D:"1.2 km",E:"2,5 km",F:"5 km",G:"15 km",H:"30 km",I:"60 km",J:"200 km"},firstNiv:"A",lastNiv:"J",nbNiv:10,bordure:0,stopPointPath:"./images/arrets/",tileRefPath:"http://tiles0.itransports.fr/",tileNbUrls:4,tileLinesPath:"_transport/",tileModes:{B:{zIndex:"6",name:"Bus"},W:{zIndex:"7",name:"Tramway"},M:{zIndex:"8",name:"Metro"}},tileLineColSep:"_",tileSuffix:".png",tileNumFieldLen:3,tileNumFill:"0",lstChk:["R","M","W","B","C"],classeNom:{B:"arretbus",C:"arretcar",M:"arretmetro",W:"arrettram",R:"arretrer",T:"arrettrain",P:"arretpole",F:"arretfuni"},lim_niv_zone:"C",lim_level_for_checkbox:"E",lim_level_for_copy:"G",aPNG24:["destination.png","mappieton.png","mapauto.png","origine.png","corresp2.png"],levelMax:{B:"E",M:"F",W:"F"},levelMin:{T:"G",R:"C",C:"C"},vectorLineWidth:{A:"8",B:"6",C:"4",D:"3",E:"3",F:"3",G:"3",H:"3",I:"3",J:"3"},vectorBorderWidth:{A:"10",B:"8",C:"6",D:"5",E:"5",F:"5",G:"5",H:"5",I:"5",J:"5"},vectorLineColor:{B:"#2ae700",C:"#02ded6",W:"#fff",M:"#FF0000",R:"#9619d6",F:"#dcaf27",T:"#9619d6",MAP:"#ed7f06",MAPD:"#ed7f06"},vectorBorderColor:{B:"#000",C:"#000",W:"#e51ae3",M:"#000",R:"#000",F:"#000",T:"#000",MAP:"#ed7f06",MAPD:"#ed7f06"},isochronesColor:{isocpt1:"#F29400",isocpt2:"#E52D87",isocpt3:"#93117E",isocpt4:"#F7E71C",isocpt5:"#F8A834",isocpt6:"#E7511E",isocpt7:"#E53689",isocpt8:"#8D147E",isocpt9:"#000000",isocpt10:"#000000"},zoomEvent:"dblclick",resizeEvent:"resize",zoomSelect:"normal",modesFilter:true,modeSwitcher:true};this.iphone={leftContainer:"100%",top:54,left:0,width:320,height:362,tileLinesPath:null,stopPointPath:"./images/arrets/",zoomEvent:"gesturestart",resizeEvent:"orientationchange",zoomSelect:"none",modesFilter:false,modeSwitcher:false,scale:1,panel:null,actions:["backbutton"],callback:function(){oCart.oInterface.oHTML.hide().bind("touchmove",function(a){a.preventDefault()})}};this.params=arguments.length==1&&typeof arguments[0]=="object"?arguments[0]:{};this.params.device=typeof this.params.device=="undefined"?"defaults":this.params.device;this.oConfig=jQuery.extend({},this.defaults,this[this.params.device]);this.params.x=typeof this.params.x=="undefined"?this.oConfig.x_def:this.params.x;this.params.y=typeof this.params.y=="undefined"?this.oConfig.y_def:this.params.y;this.params.level=typeof this.params.level=="undefined"?this.oConfig.lastNiv:this.params.level;this.params.width=typeof this.params.width=="undefined"?this.oConfig.width:this.params.width;this.params.height=typeof this.params.height=="undefined"?this.oConfig.height:this.params.height;this.params.top=typeof this.params.top=="undefined"?this.oConfig.top:this.params.top;this.params.left=typeof this.params.left=="undefined"?this.oConfig.left:this.params.left;this.params.panel=typeof this.params.panel=="undefined"?this.oConfig.panel:this.params.panel;this.params.callback=typeof this.params.callback=="undefined"?this.oConfig.callback:this.params.callback;this.affLigne=[];this.aP=[];this.aL=[];this.polygons=null;this.lstgare=[];this.modeIn=this.modeSel=this.oConfig.lstChk;this.doCheck=false;this.timeOutId=null;this.oHTML=null;this.id="contCarte";this.cart=null;this.provider=null;this.footer=null;this.loadingMsg=null;this.infospanel=null;this.winSize=null;this.pageSize=null;this.lang=moviLib.getLanguageFromUrl();this.firstNivAscii=this.oConfig.firstNiv.charCodeAt(0);this.ajaxManager=jQuery.manageAjax.create("mapDatas",{queue:true,abortOld:false});this.init(this.params.x,this.params.y,this.params.level)}interfaceCarte.prototype={init:function(a,e,d){if(this.params.panel){document.documentElement.style.overflow="hidden"}this.create();this.oHTML.show();this.winWH();this.setPanelHeight();if(!this.cart){this.cart=new Carte(this,a,e,d)}else{this.cart.centerAt(a,e,d);this.cart.reSize()}if(jQuery("#infosPanel").length>0){this.infospanel=new infosPanel(this,jQuery("#infosPanel"))}var c=this,b=window.oCart=this.cart;document.dragstart=function(){return false};window.onerror=function(){c.endLoading};jQuery(document).keydown(function(f){c.keyHandler(f)});jQuery(document).mouseup(function(f){b.mup});if(this.params.callback&&typeof this.params.callback==="function"){this.params.callback()}},create:function(){this.oHTML=jQuery("<div></div>").attr("id",this.id).css({left:this.oConfig.leftContainer,top:this.oConfig.topContainer,"background-color":"#FCFEDC"});jQuery("#"+this.oConfig.wrapper).append(this.oHTML)},winWH:function(){if(window.event&&window.event.type=="orientationchange"){switch(window.orientation){case 0:case 180:this.params.width=320;this.params.height=362;break;case -90:case 90:this.params.width=480;this.params.height=214;break}window.scrollTo(0,0)}else{var d=jQuery(window).width(),b=jQuery(window).height(),a=d,c=b;if(!this.winSize){this.winSize=new dimW(d,b)}else{this.winSize.width=d;this.winSize.height=b}if(!this.pageSize){this.pageSize=new dimW(a,c)}else{this.pageSize.width=a;this.pageSize.height=c}}},fullScreen:function(){if(parseInt(this.cart.oMask.css("left"))===0&&parseInt(this.cart.oMask.css("top"))===0){this.cart.oMask.css({left:this.params.left,top:this.params.top})}else{this.cart.oMask.css({left:0,top:0})}this.winSize=new dimW(0,0);this.cart.reSize()},sendData:function(d,c,h,b,g){var a=this,f,e;if(!b){f="json";e=function(i){if(is_ie){if(a.cart.oHTML.children().length){if(jQuery(".ligne shape",a.cart.oHTML).first().length>0){jQuery(".ligne shape",a.cart.oHTML).each(function(k){jQuery(this).remove()})}if(jQuery(".isochrone shape",a.cart.oHTML).first().length>0){jQuery(".isochrone shape",a.cart.oHTML).each(function(k){jQuery(this).remove()})}}}if(i.coords){a.cart.zooming=true;a.cart.centerAt(i.coords[0],i.coords[1],i.coords[2]);if(i.spot){a.cart.spot={id:i.spot[0],E:i.spot[1],N:i.spot[2],img_info:i.spot[4]};a.cart.setInformationLayer()}}if(i.dimfor){a.cart.zooming=true;a.cart.centerAt(i.dimfor[0],i.dimfor[1],i.dimfor[2]);var j="centerLigne="+i.dimfor[3]+"&level="+i.dimfor[2]+"&L="+a.cart.dimVisCarte.width+"&H="+a.cart.dimVisCarte.height+"&xtl="+a.cart.xtl_img+"&ytl="+a.cart.ytl_img;a.sendData(j,"./gen_include/inmap.php","POST")}if(i.modein){a.modeIn=i.modein}if(i.directions){a.aL=[];a.aL[a.cart.niveau]=i.directions}if(i.polygons){a.polygons=i.polygons}if(i.stages){a.aP=[];a.aP[a.cart.niveau]=i.stages;if(!a.cart.itineraire){a.cart.itineraire=new Itineraire(a.cart)}a.cart.itineraire.cacheid=i.cacheid||null;a.cart.setInformationLayer("ITINERAIRE");a.cart.handleLines()}if(i.stoppoint){a.aP=[];a.aP[a.cart.niveau]=i.stoppoint;a.cart.setInformationLayer("POINTDARRET")}if(i.lines){a.aL=[];a.aL[a.cart.niveau]=i.lines;a.cart.handleLines()}if(i.botaniccacheid&&i.coords){if(i.spot){a.cart.spot={id:i.spot[0],E:i.spot[1],N:i.spot[2],img_info:i.spot[4]}}a.pdfhreflink="x_center="+i.coords[0]+"&y_center="+i.coords[1]+"&level=C&isocacheid="+i.botaniccacheid+"&pointname="+i.pointname;a.cart.createPDF(jQuery("#pdfLink a:first"),{href:"./iso/pdf/botanic_"+jQuery.enleveAccent(i.pointname.toLowerCase())+".pdf"});a.cart.setInformationLayer()}if(a.polygons){a.cart.drawPolygon(a.polygons)}if(g&&typeof g==="function"){g()}}}else{f="html";e=function(i){b.html(i);if(g&&typeof g==="function"){g()}}}this.ajaxManager.abort();this.ajaxManager.add({type:h,url:c,data:d,dataType:f,abort:function(){a.endLoading()},beforeSend:function(){a.startLoading("chargement")},complete:function(){a.endLoading()},success:e,error:function(j,k,i){a.endLoading()},timeout:0})},movedAndReload:function(a){this.cart.oldNiv=this.cart.niveau;if(Math.abs(this.cart.parcours.x)<(this.cart.dimVisCarte.width/5)&&Math.abs(this.cart.parcours.y)<(this.cart.dimVisCarte.height/5)&&(Math.abs(this.cart.parcours.y)>0||Math.abs(this.cart.parcours.x)>0)){this.cart.updateDatas({centerPoint:this.cart.centerPoint,noReload:true})}else{this.cart.updateDatas({centerPoint:this.cart.centerPoint})}},keyHandler:function(a){if(a.keyCode){code=a.keyCode}else{if(a.which){code=a.which}}if(code==27){if(parseInt(this.cart.oMask.css("left"))===0&&parseInt(this.cart.oMask.css("top"))===0){this.fullScreen()}return}if(moviLib.checkKeyOnInput(a)){return}if(code==106){if(parseInt(this.cart.oMask.css("left"))!==0&&parseInt(this.cart.oMask.css("top"))!==0){this.fullScreen()}return}if(code==107){this.cart.appliZoom("plus");return}if(code==109){this.cart.appliZoom("moins");return}if((code<37&&code>40)){return}if(code==37||code==100){this.cart.moveCarte(250,0)}else{if(code==38||code==104){this.cart.moveCarte(0,250)}else{if(code==39||code==102){this.cart.moveCarte(-250,0)}else{if(code==40||code==98){this.cart.moveCarte(0,-250)}else{if(code==103){this.cart.moveCarte(250,250)}else{if(code==105){this.cart.moveCarte(-250,250)}else{if(code==99){this.cart.moveCarte(-250,-250)}else{if(code==97){this.cart.moveCarte(250,-250)}}}}}}}}return false},startLoading:function(g,b){if(this.loadingMsg&&jQuery("#"+g).length>0){this.loadingMsg.show();return}this.loadingMsg=jQuery('<div id="'+g+'" class="'+this.lang+'"></div>');var e=jQuery('<img src="./images/ld.gif" width="16" height="16" alt=""/>'),c,f,d,a;this.loadingMsg.append(e);this.oHTML.append(this.loadingMsg);c=parseInt(this.loadingMsg.css("width"),10),f=parseInt(this.loadingMsg.css("height"),10);e.css({"padding-top":Math.round(f/2)-8,"padding-left":5});d=this.cart.dimVisCarte.width==0?this.oConfig.width:this.cart.dimVisCarte.width;a=this.cart.dimVisCarte.height==0?this.oConfig.height:this.cart.dimVisCarte.height;this.loadingMsg.css({left:parseInt(this.cart.oMask.css("left"))+Math.floor(parseInt(d)/2)-Math.floor(c/2),top:parseInt(this.cart.oMask.css("top"))+Math.floor(parseInt(a)/2)-Math.floor(f/2)})},endLoading:function(){if(this.loadingMsg&&jQuery("#chargement").length>0){this.loadingMsg.hide()}},setPanelHeight:function(){if(jQuery("#"+this.params.panel).length==0){return}var a=jQuery("#"+this.params.panel);a.addClass("scrollbar").height(this.winSize.height-a.offset().top-70);this.handlePanel();return},defaultPanel:function(){if(jQuery("#"+this.params.panel).length==0){return}var a=jQuery("#"+this.params.panel).height("");if(is_ie){jQuery("#itidetails").width("340");jQuery("#ul_itidetails").width("340");a.width("340")}a.removeClass("scrollbar")},handlePanel:function(){if(jQuery("#multimode").length==0){return}var a=this;jQuery("#multimode h2").each(function(b){jQuery(this).css("cursor","pointer").click(function(){a.hideShowInformations(this)})})},hideShowInformations:function(b){if(!b.nextSibling){return}var a=b.nextSibling;while(a&&a.nodeName!="H2"){if(a.nodeName=="P"||a.nodeName=="UL"){if(a.style.display=="block"){a.style.display="none"}else{a.style.display="block"}}a=a.nextSibling}return},genChkBoxes:function(c,a,f){if(this.oConfig.modesFilter===false){return}var b=this,e=jQuery("<div></div>").css({position:"absolute",top:parseInt(this.cart.oMask.css("top"))+14,left:this.winSize.width-200,"z-index":1000}).width("150").appendTo(this.oHTML);this.chkboxes=new chkBoxes(a,e,f,locales[this.lang]["titreCheckBoxes"]);this.chkboxes.createDerouleur(function(){b.chkBoxesHandler(this);return false});jQuery.map(c,function(g,d){var h;if(d==0){h="trans first"}else{h="trans"}b.chkboxes.addElement("checkbox","checkSet"+d,jQuery.enleveAccent("check_"+locales.fr.lstMode[g]),locales[b.lang].lstMode[g],function(){b.checkCheck(jQuery(this))},g,h)});this.chkboxes.setDimensions(parseInt(this.chkboxes.oHTML.width()),parseInt(this.chkboxes.oHTML.height()))},initChkBoxes:function(a){var b=this;if(!this.chkboxes||!this.chkboxes.oHTML){return}jQuery(":checkbox",this.oHTML).each(function(c){b.chkboxes.uncheck(jQuery(this));b.chkboxes.disable(jQuery(this))});jQuery.map(this.modeIn,function(c){if(jQuery(jQuery.enleveAccent("#check_"+locales.fr.lstMode[c])).length==0){return}b.chkboxes.enable(jQuery(jQuery.enleveAccent("#check_"+locales.fr.lstMode[c])))});jQuery.map(a,function(c){if(jQuery(jQuery.enleveAccent("#check_"+locales.fr.lstMode[c])).length==0){return}b.chkboxes.check(jQuery(jQuery.enleveAccent("#check_"+locales.fr.lstMode[c])))})},chkBoxesHandler:function(b){var a=this.chkboxes.dimensions.height;if(jQuery(b).hasClass("todown")){this.chkboxes.oHTML.animate({height:a},500)}else{this.chkboxes.oHTML.css("overflow","hidden");this.chkboxes.oHTML.animate({height:jQuery(b).height()},500)}jQuery(b).toggleClass("toup").toggleClass("todown");return true},checkCheck:function(b){this.doCheck=true;var c=b.data("mode"),a=this;if(b.attr("checked")){this.modeSel.push(c);this.aP=[];this.aL=[];this.cart.updateDatas();if(jQuery.inArray(c,jQuery.keys(this.oConfig.tileModes))!=-1){jQuery("img.lineTiles",this.cart.oHTML).filter("."+this.oConfig.tileModes[jQuery.enleveAccent(c)].name).show()}}else{if(!b.attr("checked")){jQuery("div:data(type=Desserte) img:data(mode=/^"+c+"/):first-child").hide();jQuery("div.ligne:data(mode="+c+")").hide().each(function(){var d=jQuery.inArray(jQuery(this).attr("id"),a.affLigne);if(d!=-1){a.affLigne.splice(d,1)}});if(jQuery.inArray(c,jQuery.keys(this.oConfig.tileModes))!=-1){jQuery("img.lineTiles",this.cart.oHTML).filter("."+this.oConfig.tileModes[jQuery.enleveAccent(c)].name).hide()}if(jQuery.inArray(c,this.modeSel)!=-1){this.modeSel.splice(jQuery.inArray(c,this.modeSel),1)}}}},createActions:function(b){if(this.actions){this.actions.remove()}this.actions=jQuery('<div id="actionsmap"></div>');var a=this;jQuery.each(this.oConfig.actions,function(c,d){if(typeof a[d]==="function"){a[d](b)}});this.actions.css({left:b.oMask.offset().left,top:b.oMask.offset().top+32})},backbutton:function(b){var d="./images/backbutton.png",a=locales[this.lang]["backbutton"],c=locales[this.lang]["backbuttonTitle"];this.actions.append(jQuery('<a id="backbutton" class="action" href="javascript:void(0)" title="'+c+'"><img widht="22" height="22" src="'+d+'" alt="'+a+'"/></a>').click(function(g){g.preventDefault();var f=0,h;e();h=setInterval(function(){e(function(){setTimeout(function(){oCart.oInterface.oHTML.hide()},250)})},0);function e(i){f+=20;if(f>=100){f=100;clearInterval(h);oCart.oInterface.oHTML.css("left",f+"%");if(i&&typeof i==="function"){i()}return}oCart.oInterface.oHTML.css("left",f+"%")}}));this.oHTML.append(this.actions)},fullwindow:function(c){var a=this,e,b,d;if(parseInt(c.oMask.css("left"))===0&&parseInt(c.oMask.css("top"))===0){e="./images/nofullwindow.png";b=locales[this.lang]["nofullWindow"];d=locales[this.lang]["nofullWindowTitle"]}else{e="./images/fullwindow.png";b=locales[this.lang]["fullWindow"];d=locales[this.lang]["fullWindowTitle"]}this.actions.append(jQuery('<a id="fullwindow" class="action" href="javascript:void(0)" title="'+d+'"><img width="22" height="22" src="'+e+'" alt="'+b+'"/></a>').click(function(f){f.preventDefault();a.fullScreen(this)}));this.oHTML.append(this.actions)},createFooter:function(c){var e,f,a,b;if(this.footer){this.footer.remove()}this.footer=jQuery('<div id="footermap"></div>');this.oHTML.append(this.footer);this.footer.append(jQuery('<span class="scale">'+this.oConfig.echelleDisplay[c.niveau]+"</span>"));e=jQuery('<div style="position:absolute;display:inline;right:40px;"></div>');f=jQuery('<a class="newwindow" href="'+moviLib.baseURL+'images/legende.png">Légende</a>');f.click(function(){moviLib.nouvelleFenetre(this.href,this.target,"console",400,350);return false});e.append(f);a=new Date;b=jQuery('<span class="copyright">©Moviken '+a.getFullYear()+"</span>");if(c.niveau.charCodeAt(0)<this.oConfig.lim_level_for_copy.charCodeAt(0)){b.append("| ©TeleAtlas "+a.getFullYear())}e.append(b);this.footer.append(e);this.footer.width(c.oMask.width());this.footer.css({left:c.oMask.offset().left,top:c.oMask.offset().top+c.oMask.height()-this.footer[0].offsetHeight})},inverseColorBackground:function(c){var b=c.css("color"),a=c.css("background-color");c.css("backgroundColor",b);c.css("color",a)}};function chkBoxes(f,a,e,d,c,b){this.id=f;this.oHTML=null;this.oConteneur=a;this.formId=e;this.form=null;this.titre=d;this.onOver=c||null;this.onOut=b||null;this.dimensions=null;this.init()}chkBoxes.prototype={init:function(){this.create()},create:function(){var a=this;this.oHTML=jQuery('<div id="'+this.id+'"></div>');if(this.onOver&&this.onOut){this.oHTML.hover(function(){a.onOver()},function(){a.onOut()})}this.form=jQuery('<form id="'+this.formId+'"></form>');this.oHTML.append(this.form);if(this.titre){this.form.append(jQuery("<h3>"+this.titre+"</h3>"))}this.oConteneur.append(this.oHTML)},addElement:function(d,a,h,g,b,f,c){jQuery('<p><input id="'+h+'" type="'+d+'" name="'+a+'" value="'+g+'"/><label for="'+h+'">'+g+"</label></br></p>").appendTo(this.form);var e=jQuery("#"+h);e.click(b);if(c){e.parent().addClass(c)}if(f){e.data("mode",f)}},setDimensions:function(b,a){this.dimensions=new dimW(b,a)},setPositionRelativeTo:function(c){var a=parseInt(c.offsetTop),b=parseInt(c.offsetLeft);this.oHTML.style.top=a+5+"px";this.oHTML.style.left=b+5+"px"},setPositionUnder:function(c){var a=parseInt(c.offsetTop)+parseInt(c.offsetHeight),b=parseInt(c.offsetLeft);this.oHTML.style.top=a+5+"px";this.oHTML.style.left=b+"px"},createDerouleur:function(b){var a=jQuery('<a id="deroul" class="toup" href="javascript:void(0)"></a>');a.click(b);this.form.prepend(a)},disable:function(a){a[0].disabled=true},enable:function(a){a[0].disabled=false},check:function(a){a[0].checked=true},uncheck:function(a){a[0].checked=false}};function infosPanel(a,b){this.oHTML=b;this.oInterface=a;this.elems=null;this.title=null;this.init()}infosPanel.prototype={init:function(){if(this.oHTML.children().length==0){return}this.setStopsToMap()},setStopsToMap:function(){var oThis=this;this.title=jQuery("h2",this.oHTML).text();this.elems=jQuery(".liinfo",this.oHTML).each(function(element){oThis.oInterface.cart.n[jQuery(this).attr("id").substring(5)]=new Punaise(oThis.oInterface.cart,jQuery(this).attr("E"),jQuery(this).attr("N"),jQuery(this).attr("id").substring(5));var motif=jQuery(this).attr("motif")||false,lignes=eval(jQuery(this).attr("lignes"));oThis.oInterface.cart.n[jQuery(this).attr("id").substring(5)].createPun({type:"arret",img_info:jQuery(this).attr("imgattrs"),ligne:lignes,terminus:motif})});jQuery(".liinfo",this.oHTML).live("click",function(event){if(((!jQuery.browser.msie||(jQuery.browser.msie&&parseInt(jQuery.browser.version,10)>=8))&&event.button==0)||(jQuery.browser.msie&&event.button==1)){var obj=jQuery("#"+jQuery(this).attr("id").substring(5));if(obj.hasClass("onit")){return}else{jQuery(".liinfo",this.oHTML).each(function(){jQuery(this).removeClass("onit")});jQuery(this).addClass("onit");obj.mouseover()}}});jQuery("span.nexthor",this.oHTML).click(function(){oThis.prochainsDeparts(this)});return},storeInfos:function(){var oThis=this;this.oInterface.aP=[];this.oInterface.aP[this.oInterface.cart.niveau]=[];this.elems.each(function(i){oThis.oInterface.aP[oThis.oInterface.cart.niveau][i]=[];oThis.oInterface.aP[oThis.oInterface.cart.niveau][i].push(jQuery(this).attr("id").substring(5));oThis.oInterface.aP[oThis.oInterface.cart.niveau][i].push(jQuery(this).attr("E"));oThis.oInterface.aP[oThis.oInterface.cart.niveau][i].push(jQuery(this).attr("N"));oThis.oInterface.aP[oThis.oInterface.cart.niveau][i].push(this.firstChild.nodeValue);var lignes=eval(jQuery(this).attr("lignes"));oThis.oInterface.aP[oThis.oInterface.cart.niveau][i].push(lignes);oThis.oInterface.aP[oThis.oInterface.cart.niveau][i].push("00");oThis.oInterface.aP[oThis.oInterface.cart.niveau][i].push(jQuery(this).attr("motif"));oThis.oInterface.aP[oThis.oInterface.cart.niveau][i].push("0");oThis.oInterface.aP[oThis.oInterface.cart.niveau][i].push(jQuery(this).attr("imgattrs"))})},prochainsDeparts:function(c){var b=jQuery(c).parent().parent().parent()[0].firstChild.nodeValue,a=jQuery(c).parent().attr("ligne"),d="nomstation="+b+"&ligne="+a+"&lang="+this.oInterface.lang;this.oInterface.sendData(d,"./gen_include/nexthor.php","POST",jQuery(c))},updateStopsFromMap:function(){var c=this.oInterface.aP[this.oInterface.cart.niveau].length,g="",e,b,d,a,h,f;if(typeof this.title!="undefined"){g+="<h2>"+this.title+"</h2>"}g+="<ul>";for(e=0;e<c;e++){g+='<li id="lipun'+this.oInterface.aP[this.oInterface.cart.niveau][e][0]+'" class="liinfo"';g+='e="'+this.oInterface.aP[this.oInterface.cart.niveau][e][1]+'" n="'+this.oInterface.aP[this.oInterface.cart.niveau][e][2]+'" ';g+='lignes="'+this.oInterface.aP[this.oInterface.cart.niveau][e][4]+'" ';g+='motif="'+this.oInterface.aP[this.oInterface.cart.niveau][e][6]+'" ';g+='imgattrs="'+this.oInterface.aP[this.oInterface.cart.niveau][e][8]+'"';g+=">"+this.oInterface.aP[this.oInterface.cart.niveau][e][3];if(jQuery("#divinfo"+this.oInterface.aP[this.oInterface.cart.niveau][e][0]).length>0){b=jQuery("#divinfo"+this.oInterface.aP[this.oInterface.cart.niveau][e][0]);g+=b.html()}else{f=this.oInterface.aP[this.oInterface.cart.niveau][e][4][0].length;g+="<ul>";for(d=0;d<f;d++){if(this.oInterface.aP[this.oInterface.cart.niveau][e][4][1][d]=="T"){a=this.oInterface.aP[this.oInterface.cart.niveau][e][4][0][d];h=this.oInterface.aP[this.oInterface.cart.niveau][e][4][0][d]}else{b=this.oInterface.aP[this.oInterface.cart.niveau][e][4][0][d].split(":");a=b[0];h=b[1]}g+='<li mode="'+this.oInterface.aP[this.oInterface.cart.niveau][e][4][1][d]+'" ligne="'+a+'">';g+=h+"</li>"}g+="</ul>"}}g+="</ul>";this.oHTML.html(g)}};function point(a,b){this.E=a;this.N=b}point.prototype={distm:function(c){var b=this.E-c.E,a=this.N-c.N;return Math.sqrt(b*b+a*a)}};function deplacement(a,b){this.x=a;this.y=b}function oLigne(d,b,a){this.code=d;this.label=b;this.type_ligne=a}function dimW(a,b){this.width=a;this.height=b}function bounds(d,c,b,a){this.xmin=d;this.xmax=b;this.ymin=c;this.ymax=a}function dimensionsCarte(d,c,b,a){this.left=typeof d=="undefined"?"undefined":d;this.top=typeof c=="undefined"?"undefined":c;this.width=typeof b=="undefined"?"undefined":b;this.height=typeof a=="undefined"?"undefined":a;this.right=(typeof d=="undefined"&&typeof b=="undefined")?"undefined":d+b;this.bottom=(typeof c=="undefined"&&typeof a=="undefined")?"undefined":c+a}function Carte(b,a,c,d){this.oInterface=b;this.E=a||this.oInterface.oConfig.x_def;this.N=c||this.oInterface.oConfig.y_def;this.niveau=d||this.oInterface.oConfig.lastNiv;this.x_topleft=34000;this.y_topleft=2684000;this.xtl_img=null;this.ytl_img=null;this.old_x_topLeft;this.old_y_topLeft;this.oConteneur=this.oInterface.oHTML;this.iterTiles=null;this.nbTiles=null;this.height=null;this.width=null;this.h_lim=null;this.w_lim=null;this.leftDiv=0;this.topDiv=0;this.dimVisCarte=null;this.dimTable=null;this.curLeftOffset=0;this.curTopOffset=0;this.paddingLeft=null;this.paddingTop=null;this.deplace=null;this.parcours=null;this.antX=null;this.antY=null;this.offsetX=null;this.offsetY=null;this.centerCoord=null;this.centerCoord_px=null;this.oldNiv=null;this.decN=null;this.decE=null;this.io=null;this.jo=null;this.lstimg=[];this.maintile=null;this.dragapproved=false;this.mouseup=false;this.mvswt=false;this.stops=null;this.segs=null;this.timeoutDrag=null;this.timeoutPL=null;this.wheelTimeout=null;this.oHTML=null;this.oMask=null;this.noreload=false;this.zooming=false;this.resizing=false;this.contour=null;this.zoomSelect=null;this.contextMenu=null;this.modeCarte=null;this.centerPoint=null;this.n=[];this.createCarte(this.E,this.N,this.niveau)}Carte.prototype={createCarte:function(b,c,d){this.createMask("t_tableau");this.createContour(this.oConteneur);this.createZoomSelect(this.oConteneur);if(!this.oInterface.params.width&&!this.oInterface.params.height){this.oMask.width(this.oInterface.pageSize.width-parseInt(this.oMask.offset().left));this.oMask.height(this.oInterface.pageSize.height-parseInt(this.oMask.offset().top));this.zoomSelect.css("left",parseInt(this.oMask.width())+parseInt(this.oMask.offset().left)-40)}else{this.oMask.width(this.oInterface.params.width);this.oMask.height(this.oInterface.params.height);this.zoomSelect.css("left",parseInt(this.oMask.width())+parseInt(this.oMask.offset().left)-40)}this.dimVisCarte=new dimensionsCarte(this.oMask.offset().left,this.oMask.offset().top,this.oMask.width()-(this.oInterface.oConfig.bordure*2),this.oMask.height()-(this.oInterface.oConfig.bordure*2));this.upDateContour();this.createLnkPDF();this.oInterface.createActions(this);this.oInterface.createFooter(this);this.oHTML=jQuery('<div id="carte"></div>');this.oHTML.css({left:this.leftDiv,top:this.topDiv});this.oHTML.ondragstart=function(){return false};var a=this;jQuery("a[xcenter][ycenter][level]").live("click",function(e){e.preventDefault();oCart.removeEle();oCart.centerAt(jQuery(this).attr("xcenter"),jQuery(this).attr("ycenter"),jQuery(this).attr("level"));oCart.reloadInterface();oCart.oInterface.sendData("E_center="+jQuery(this).attr("xcenter")+"&N_center="+jQuery(this).attr("ycenter")+"&level="+jQuery(this).attr("level")+"&L="+oCart.dimVisCarte.width+"&H="+oCart.dimVisCarte.height,"./gen_include/inmap.php","POST")});jQuery("div.coin").live("click",function(e){a.clickContour(this)});jQuery("#itiOverview li[x][y]").css("cursor","pointer").bind("click",function(f){f.stopPropagation();a.handleDetails(f,this)});jQuery("#ul_itidetails .detail").bind({click:function(e){jQuery("#ul_itidetails li").removeClass("onit");jQuery(this).addClass("onit");oCart.itineraire.handleDetails(e,this)},mouseover:function(e){jQuery(this).removeClass("detail");jQuery(this).addClass("over")},mouseout:function(e){jQuery(this).removeClass("over");jQuery(this).addClass("detail")}});this.oHTML.bind({mouseover:function(e,f){var g=typeof f=="undefined"?jQuery(e.target):jQuery(f);if(g.hasClass("dispinfo")&&(typeof a.n[g.attr("id")]!="undefined"||g.hasClass("fake"))){if(g.hasClass("fake")){g=jQuery(g.parent().prev().children(":first"))}switch(a.n[g.attr("id")].type){case"centre":e.preventDefault();break;case"FIXE":e.preventDefault();break;default:a.n[g.attr("id")].openStationHandler();break}}},mouseout:function(e){var f=jQuery(e.target);if(f.hasClass("dispinfo")&&f.not("#p_center")&&(typeof a.n[f.attr("id")]!="undefined"||f.hasClass("fake"))){if(f.hasClass("fake")){f=jQuery(f.parent().prev().children(":first"))}a.n[f.attr("id")].outOfPun(e)}},click:function(e){if(a.contextMenu){a.contextMenu.remove();a.contextMenu=null}var g=jQuery(e.target),f;if(g.hasClass("infoimg")){f=g.closest("div[id^=divpun]").attr("id").substring(6);a.n[f].retrieveInfosHandler(g.parent().get(0),g.parent().data("ligne"),g.parent().data("mode"),a.n[f].E,a.n[f].N)}}});jQuery("#infosListe").live("click",function(f){var g=jQuery(f.target),e;if(g.is("li")&&g.parent().is("#infosListe")){e=g.children("ul");if((e.is("ul"))&&(e.is(":visible"))){e.slideUp("normal").parent().removeClass("state-active").addClass("state-default");return false}if((e.is("ul"))&&(!e.is(":visible"))){jQuery("#infosListe li ul:visible").slideUp("normal").parent().removeClass("state-active").addClass("state-default");e.slideDown("normal").parent().removeClass("state-default").addClass("state-active");return false}}});jQuery("#infosPanel").live("click",function(g){var f=jQuery(g.target).closest("li.liinfo"),e,h;if(f.length){e=jQuery(f).children("ul"),h=jQuery("#"+jQuery(f).attr("id").substring(5));if((e.is("ul"))&&(e.is(":visible"))){e.slideUp("normal").parent().removeClass("onit");return false}if((e.is("ul"))&&(!e.is(":visible"))){jQuery("#infosPanel li.liinfo").find("ul:visible").slideUp("normal").end().removeClass("onit");e.slideDown("normal").parent().addClass("onit");h.mouseover();return false}}});if(this.oInterface.params.device=="defaults"){this.oHTML.draggable({addClasses:false,cancel:"ul#infosListe",start:function(e,f){jQuery(this).addClass("grab");a.mdw(e.originalEvent)},drag:function(e,f){a.mmv(e.originalEvent)},stop:function(e,f){a.mup(e.originalEvent)}})}this.oHTML.rightClick(function(e){a.menuContextuel(e)});this.oHTML.bind(this.oInterface.oConfig.zoomEvent,function(e){a.zoomin(e)});jQuery(window).bind(this.oInterface.oConfig.resizeEvent,function(){jQuery.doTimeout(a.oInterface.oConfig.resizeEvent,250,function(){a.reSize()})});this.oMask.append(this.oHTML);this.centerAt(b,c,d)},reSize:function(){this.resizing=true;if(this.oInterface.winSize.height!=jQuery(window).height()||this.oInterface.winSize.width!=jQuery(window).width()){this.oInterface.winWH();if(!this.oInterface.params.width&&!this.oInterface.params.height){if((this.oInterface.pageSize.width-parseInt(this.oMask.offset().left))<450){this.oMask.width(450)}else{this.oMask.width(this.oInterface.pageSize.width-parseInt(this.oMask.offset().left))}if((this.oInterface.pageSize.height-parseInt(this.oMask.offset().top))<350){this.oMask.height(350)}else{this.oMask.height(this.oInterface.pageSize.height-parseInt(this.oMask.offset().top))}}else{this.oMask.width(this.oInterface.params.width);this.oMask.height(this.oInterface.params.height)}}this.dimVisCarte=new dimensionsCarte(this.oMask.offset().left,this.oMask.offset().top,this.oMask.width()-(this.oInterface.oConfig.bordure*2),this.oMask.height()-(this.oInterface.oConfig.bordure*2));if(this.itineraire&&this.itineraire.details){this.oInterface.defaultPanel();this.itineraire.setHeight()}else{if(this.oInterface.params.panel){this.oInterface.setPanelHeight()}}this.removeEle();this.centerAt(this.centerPoint.E,this.centerPoint.N,this.niveau);this.updateDatas();this.reloadInterface()},reloadInterface:function(){this.varsCarte();this.zoomSelect.css({left:parseInt(this.oMask.width())+parseInt(this.oMask.offset().left)-40,top:parseInt(this.oMask.offset().top)+14});if(this.oInterface.chkboxes){this.oInterface.chkboxes.oHTML.parent().css({top:parseInt(this.oMask.offset().top)+14,left:parseInt(this.oMask.width())+parseInt(this.oMask.offset().left)-200})}this.upDateContour();this.oInterface.createActions(this);this.oInterface.createFooter(this);this.centerPoint.posPunAtCenter()},createMask:function(a){this.oMask=jQuery('<div id="t_tableau"></div>');this.oMask.css({top:this.oInterface.params.top,left:this.oInterface.params.left,"background-color":"#FCFEDC"});this.oConteneur.append(this.oMask)},lstTiles:function(a){if(!this.niveau||this.niveau==0){this.niveau=this.oInterface.oConfig.lastNiv}this.updatePosition();this.creeImg();if(!this.deplace){this.deplace=new deplacement(0,0)}else{this.deplace.x=0;this.deplace.y=0}if(!this.parcours){this.parcours=new deplacement(0,0)}else{this.parcours.x=0;this.parcours.y=0}},getSrcTile:function(c,b,a){return a+this.maintile.level+this.oInterface.oConfig.tileLineColSep+jQuery.str_pad(String(c),this.oInterface.oConfig.tileNumFieldLen,this.oInterface.oConfig.tileNumFill,"STR_PAD_LEFT")+this.oInterface.oConfig.tileLineColSep+jQuery.str_pad(String(b),this.oInterface.oConfig.tileNumFieldLen,this.oInterface.oConfig.tileNumFill,"STR_PAD_LEFT")+this.maintile.extension},creeImg:function(){var a,d,c,b,e;while(this.lstimg.length>this.iterTiles){a=this.lstimg.pop();for(d=0;d<a.length;d++){this.oHTML[0].removeChild(a[d])}}for(d=this.lstimg.length;d<this.iterTiles;d++){this.lstimg.push([])}for(d=0;d<this.lstimg.length;d++){while(this.lstimg[d].length>this.iterTiles){b=this.lstimg[d].pop();this.oHTML[0].removeChild(b)}for(c=this.lstimg[d].length;c<this.iterTiles;c++){e=jQuery('<img id="'+d+"_"+c+'" width="'+this.oInterface.oConfig.tileWidth+'" height="'+this.oInterface.oConfig.tileHeight+'" />');e.mousedown(function(f){f.preventDefault()});if(this.niveau==this.oInterface.oConfig.lastNiv){}else{e.addClass("drag")}this.lstimg[d].push(e);this.oHTML.append(e);this.configImage(e,d,c)}}},configImage:function(c,s,r){var d=(this.curLeftOffset+r)*this.oInterface.oConfig.tileWidth,g=(this.curTopOffset+s)*this.oInterface.oConfig.tileHeight,h=-this.paddingLeft+d,u=-this.paddingTop+g,m=this.maintile.ligne+this.io+s,v=this.maintile.colonne+this.jo+r,n=this.maintile.pathImg,e,b,l,o,f,k,q,a;o=/(https?:\/\/tiles)\d(.itransports.fr\/[\w/_\.-]*\/)/;if(o.test(n)){q=s-(Math.floor(s/this.oInterface.oConfig.tileNbUrls)*this.oInterface.oConfig.tileNbUrls);a=o.exec(n);n=a[1]+q+a[2]}c.css({position:"absolute",left:h,top:u});if(this.maintile.tab){k=this.maintile.zone.split("_");if(m<this.oInterface.oConfig.topLeftLine[this.maintile.ind]){k[2]=parseInt(k[2],10)-1;if(k[2]>=0){k[2]=jQuery.str_pad(String(k[2]),2,"0","STR_PAD_LEFT")}else{k[2]="-"+jQuery.str_pad(String(Math.abs(k[2])),2,"0","STR_PAD_LEFT")}m+=this.oInterface.oConfig.bottomRightLine[this.maintile.ind]}if(m>this.oInterface.oConfig.bottomRightLine[this.maintile.ind]){k[2]=parseInt(k[2],10)+1;if(k[2]>=0){k[2]=jQuery.str_pad(String(k[2]),2,"0","STR_PAD_LEFT")}else{k[2]="-"+jQuery.str_pad(String(Math.abs(k[2])),2,"0","STR_PAD_LEFT")}m-=this.oInterface.oConfig.bottomRightLine[this.maintile.ind]}if(v<this.oInterface.oConfig.topLeftCol[this.maintile.ind]){k[3]=parseInt(k[3],10)-1;if(k[3]>=0){k[3]=jQuery.str_pad(String(k[3]),2,"0","STR_PAD_LEFT")}else{k[3]="-"+jQuery.str_pad(String(Math.abs(k[3])),2,"0","STR_PAD_LEFT")}v+=this.oInterface.oConfig.bottomRightCol[this.maintile.ind]}if(v>this.oInterface.oConfig.bottomRightCol[this.maintile.ind]){k[3]=parseInt(k[3],10)+1;if(k[3]>=0){k[3]=jQuery.str_pad(String(k[3]),2,"0","STR_PAD_LEFT")}else{k[3]="-"+jQuery.str_pad(String(Math.abs(k[3])),2,"0","STR_PAD_LEFT")}v-=this.oInterface.oConfig.bottomRightCol[this.maintile.ind]}n=n.replace(this.maintile.zone,k.join("_"));if((this.io+s)==0&&(this.jo+r)==0){this.maintile.ligne=m;this.maintile.colonne=v;this.maintile.pathImg=n}}if(c.data("curL")!=m||c.data("curC")!=v){c.data("curL",m);c.data("curC",v)}if(s==0&&r==0){this.topLeft=new point(m,v)}this.coordTopLeftCarte();if(s==0&&r==0){this.xtl_img=this.x_topleft-(h*this.oInterface.oConfig.resolution[this.niveau]);this.ytl_img=this.y_topleft+(u*this.oInterface.oConfig.resolution[this.niveau])}e=this.getSrcTile(m,v,n);if(c[0].src!=e){c[0].src="";c[0].src=e}if(this.niveau.charCodeAt(0)<=this.oInterface.oConfig.lim_level_for_checkbox.charCodeAt(0)){for(mode in this.oInterface.oConfig.tileModes){f=/\/(_[a-z])\//i;if(jQuery.inArray(mode,this.oInterface.modeIn)!=-1){b=jQuery("#"+c.attr("id")+"_lines"+this.oInterface.oConfig.tileModes[mode].name);if(b.length>0){l=this.oInterface.oConfig.tileLinesPath+"_"+this.oInterface.oConfig.tileModes[mode].name.toLowerCase()+"/";b[0].src=e.replace(f,"/"+l+"$1/")}else{b=c.clone(true);b.attr("id",c.attr("id")+"_lines"+this.oInterface.oConfig.tileModes[mode].name);b.addClass("lineTiles");b.addClass(this.oInterface.oConfig.tileModes[mode].name);b.css("z-index",this.oInterface.oConfig.tileModes[mode].zIndex);l=this.oInterface.oConfig.tileLinesPath+"_"+this.oInterface.oConfig.tileModes[mode].name.toLowerCase()+"/";b.attr("src",e.replace(f,"/"+l+"$1/"));b.error(function(){jQuery(this).hide()});this.oHTML.append(b)}b.css({left:c.css("left"),top:c.css("top")});if(jQuery.inArray(mode,this.oInterface.modeSel)==-1){b.hide()}if(mode=="B"){b.fadeTo(0,0.5)}else{b.fadeTo(0,0.8)}}}}},toRight:function(){var b,a;this.curLeftOffset++;this.maintile.colonne++;this.topLeft.N++;for(b=0;b<this.lstimg.length;b++){a=this.lstimg[b].shift();this.lstimg[b].push(a);this.configImage(a,b,this.lstimg[0].length-1)}},toLeft:function(){var b,a;this.curLeftOffset--;this.maintile.colonne--;this.topLeft.N--;for(b=0;b<this.lstimg.length;b++){a=this.lstimg[b].pop();this.lstimg[b].unshift(a);this.configImage(a,b,0)}},toUp:function(){var b,a=this.lstimg.pop();this.curTopOffset--;this.maintile.ligne--;this.topLeft.E--;if(a){this.lstimg.unshift(a);for(b=0;b<a.length;b++){this.configImage(a[b],0,b)}}},toDown:function(){this.curTopOffset++;this.maintile.ligne++;this.topLeft.E++;var a=this.lstimg.shift(),b,c;this.lstimg.push(a);c=this.lstimg.length-1;for(b=0;b<a.length;b++){this.configImage(a[b],c,b)}},preLoad:function(){var b,a,c;for(b=-1;b<this.lstimg.length+1;b++){for(a=-1;a<this.iterTiles+1;a++){if(b>=0&&b<this.iterTiles&&a>=0&&a<this.iterTiles){continue}c=new Image();c.src=this.getSrcTile(b,a,this.maintile.pathImg)}}},coordTopLeftCarte:function(){var a,d,c,b;this.old_x_topLeft=this.x_topleft;this.old_y_topLeft=this.y_topleft;if(!this.maintile.tab){this.x_topleft=this.oInterface.oConfig.xo[this.maintile.ind]+(this.oInterface.oConfig.resolution[this.maintile.level]*this.maintile.width*(this.topLeft.N-1));this.y_topleft=this.oInterface.oConfig.yo[this.maintile.ind]-(this.oInterface.oConfig.resolution[this.maintile.level]*this.maintile.height*(this.topLeft.E-1))}else{if(this.maintile.colonne<this.topLeft.N){a=(this.oInterface.oConfig.resolution[this.niveau]*this.maintile.width*this.oInterface.oConfig.bottomRightCol[this.maintile.ind]);c=this.maintile.xoZone-a}else{c=this.maintile.xoZone}if(this.maintile.ligne<this.topLeft.E){d=this.oInterface.oConfig.resolution[this.niveau]*this.maintile.height*this.oInterface.oConfig.bottomRightLine[this.maintile.ind];b=parseInt(this.maintile.yoZone+d)}else{b=this.maintile.yoZone}this.x_topleft=c+(this.oInterface.oConfig.resolution[this.maintile.level]*this.maintile.width*(this.topLeft.N-1));this.y_topleft=b-(this.oInterface.oConfig.resolution[this.maintile.level]*this.maintile.height*(this.topLeft.E-1))}},reInitImg:function(){jQuery("img.lineTiles").each(function(c){jQuery(this).remove()});var b,a;if(this.lstimg){for(b=0;b<this.lstimg.length;b++){if(this.lstimg[b]){for(a=0;a<this.lstimg[b].length;a++){this.lstimg[b][a].remove()}}}}this.lstimg=[];this.leftDiv=this.topDiv=0;this.paddingLeft=Math.floor((this.dimTable.width-this.dimVisCarte.width)/2);this.paddingTop=Math.floor((this.dimTable.height-this.dimVisCarte.height)/2);this.curLeftOffset=this.curTopOffset=0},updatePosition:function(){if(this.iterTiles%2!=0){this.io=-Math.floor(this.iterTiles/2);this.jo=-Math.floor(this.iterTiles/2);this.decN=(this.maintile.height/2)-this.maintile.N_px;this.decE=(this.maintile.width/2)-this.maintile.E_px;return}if(this.maintile.E_px<this.w_lim){if(this.maintile.N_px<this.h_lim){this.io=-Math.floor(this.iterTiles/2);this.jo=-Math.floor(this.iterTiles/2);this.decN=-this.maintile.N_px;this.decE=-this.maintile.E_px}else{this.io=-Math.floor(this.iterTiles/2)+1;this.jo=-Math.floor(this.iterTiles/2);this.decE=-this.maintile.E_px;this.decN=this.maintile.height-this.maintile.N_px}}else{if(this.maintile.N_px<this.h_lim){this.io=-Math.floor(this.iterTiles/2);this.jo=-Math.floor(this.iterTiles/2)+1;this.decE=this.maintile.width-this.maintile.E_px;this.decN=-this.maintile.N_px}else{this.io=-Math.floor(this.iterTiles/2)+1;this.jo=-Math.floor(this.iterTiles/2)+1;this.decN=this.maintile.height-this.maintile.N_px;this.decE=this.maintile.width-this.maintile.E_px}}},setPos:function(){this.oHTML.css({left:this.leftDiv,top:this.topDiv});if(this.old_x_topLeft!=this.x_topleft||this.old_y_topLeft!=this.y_topleft){var c=this.oInterface.oConfig.resolution[this.niveau],b=Math.floor((this.old_x_topLeft-this.x_topleft)/c),a=Math.floor((this.y_topleft-this.old_y_topLeft)/c);jQuery("img.dispinfo").each(function(d){jQuery(this).css({left:jQuery(this).css("left")+b,top:jQuery(this).css("top")+a})});jQuery("img.ligne").each(function(d){jQuery(this).css({left:jQuery(this).css("left")+b,top:jQuery(this).css("top")+a})})}},nextNiv:function(a){if(a==this.oInterface.oConfig.lastNiv){return a}var b=a.charCodeAt(0);return String.fromCharCode(b+1)},prevNiv:function(a){if(a==this.oInterface.oConfig.firstNiv){return a}var b=a.charCodeAt(0);return String.fromCharCode(b-1)},posSlide:function(){jQuery("#zoomSelect li").removeClass("onit");jQuery("#zoomSelect li#niv"+this.niveau).addClass("onit")},varsCarte:function(){if(this.dimVisCarte.width>=this.dimVisCarte.height){this.iterTiles=Math.ceil(this.dimVisCarte.width/this.oInterface.oConfig.tileWidth)+1}else{this.iterTiles=Math.ceil(this.dimVisCarte.height/this.oInterface.oConfig.tileHeight)+1}this.nbTiles=this.iterTiles*this.iterTiles;if(!this.dimTable){this.dimTable=new dimensionsCarte(null,null,this.oInterface.oConfig.tileWidth*this.iterTiles,this.oInterface.oConfig.tileHeight*this.iterTiles)}else{this.dimTable.width=this.oInterface.oConfig.tileWidth*this.iterTiles;this.dimTable.height=this.oInterface.oConfig.tileHeight*this.iterTiles}this.paddingLeft=Math.floor((this.dimTable.width-this.dimVisCarte.width)/2);this.paddingTop=Math.floor((this.dimTable.height-this.dimVisCarte.height)/2)},setCenterCoord:function(c,d){if(!this.centerPoint){this.centerPoint=new Punaise(this,c,d,"p_center");this.centerPoint.createPun({type:"centre"});this.centerPoint.posPunAtCenter()}else{this.centerPoint.setCoords(c,d)}var a=Math.floor((this.centerPoint.E-this.x_topleft)/this.oInterface.oConfig.resolution[this.niveau]),b=Math.floor((this.y_topleft-this.centerPoint.N)/this.oInterface.oConfig.resolution[this.niveau]);if(!this.centerCoord_px){this.centerCoord_px=new point(a,b)}else{this.centerCoord_px.E=a;this.centerCoord_px.N=b}},centerAt:function(a,c,b){this.varsCarte();if(this.zooming){this.removeEle()}this.reInitImg();this.niveau=b;this.maintile=new Tile(this);this.maintile.createMainTile(a,c,this.niveau);this.h_lim=(this.dimVisCarte.height-(this.maintile.height*(this.iterTiles-2)))/2;this.w_lim=(this.dimVisCarte.width-(this.maintile.width*(this.iterTiles-2)))/2;this.lstTiles(this.oHTML);this.posSlide();this.setCenterCoord(a,c);if(!is_ie){this.leftDiv=this.leftDiv+this.decE-this.curLeftOffset+this.oInterface.oConfig.bordure;this.topDiv=this.topDiv+this.decN-this.curTopOffset+this.oInterface.oConfig.bordure}else{this.leftDiv=this.leftDiv+this.decE-this.curLeftOffset;this.topDiv=this.topDiv+this.decN-this.curTopOffset}if((this.decE-this.curLeftOffset)!=0||(this.decN-this.curTopOffset)!=0){this.setPos()}if(!this.deplace){this.deplace=new deplacement(0,0)}else{this.deplace.x=0;this.deplace.y=0}},boundsBox:function(){return;if(jQuery("#boundsBox").length==0){var e=Math.floor(this.dimVisCarte.width/3)*2+"px",b=Math.floor(this.dimVisCarte.height/3)*2+"px",d=this.oInterface.oConfig.resolution[this.niveau],c=Math.floor((this.centerPoint.E-this.xtl_img)/d),a=Math.floor((this.ytl_img-this.centerPoint.N)/d),g=c-Math.floor(parseInt(e,10)/2)+"px",f=a-Math.floor(parseInt(b,10)/2)+"px";jQuery('<div id="boundsBox"></div>').css({top:f,left:g,width:e,height:b}).appendTo(this.oHTML)}},setInformationLayer:function(h){this.modeCarte=h||"SINGLE";if(this.zooming){this.zooming=false}var d=this,c,e,b,g,a,f;if(this.modeCarte=="SINGLE"||this.modeCarte=="FIXE"){if(this.modeCarte=="FIXE"){if(this.oInterface.aP[this.niveau]){jQuery.map(this.oInterface.aP[this.niveau],function(i){d.n[i[0]]=new Punaise(d,i[1],i[2],i[0]);d.n[i[0]].createPun({type:this.modeCarte,img_info:i[4]})})}}if(this.spot){e=new Punaise(this,this.spot.E,this.spot.N,this.spot.id);e.createPun({type:"ETAPE",img_info:this.spot.img_info})}if(!this.oInterface.doCheck){if(jQuery("#modchk").length>0){jQuery("#modchk").remove()}}}else{if(this.modeCarte=="POINTDARRET"||this.modeCarte=="ITINERAIRE"){if(this.oInterface.aP[this.niveau]&&this.modeCarte!="ITINERAIRE"){c=this.oInterface.aP[this.niveau].length;if(c>0){this.boundsBox();jQuery.map(this.oInterface.aP[this.niveau],function(i){d.n[i[0]]=new Punaise(d,i[1],i[2],i[0]);if(jQuery.isPlainObject(i[3])){d.n[i[0]].createPun({type:"ETAPE",img_info:i[4]})}else{d.n[i[0]].createPun({type:"arret",img_info:i[8],ligne:i[4],terminus:i[6],poleechange:i[5],inPTU:i[7]})}})}if(this.spot){e=new Punaise(this,this.spot.E,this.spot.N,this.spot.id);e.createPun({type:"FIXE",img_info:this.spot.img_info})}}else{if(this.oInterface.aP[this.niveau]){this.itineraire.getFromTo("ul_itidetails");jQuery.map(this.oInterface.aP[this.niveau],function(i){d.n[i[0]]=new Punaise(d,i[1],i[2],i[0]);if(jQuery.isArray(i[4])){d.n[i[0]].createPun({type:"arret",img_info:i[8],ligne:i[4],terminus:i[6],poleechange:i[5],inPTU:i[7]})}else{d.n[i[0]].createPun({type:"ETAPE",img_info:i[4]});if(d.n[i[0]].oHTML_img.attr("id").match(/origine|destination$/)){d.n[i[0]].displayEtiquette(false)}d.itineraire.setOrigineDestination()}if(i[0].indexOf("_")!=-1){g=i[0].split("_");for(b=0;b<g.length;b++){if(jQuery.inArray(g[b],d.itineraire.details)!=-1){a=g[b];break}}}else{a=i[0]}if(jQuery.isArray(d.itineraire.details)&&jQuery.inArray(a,d.itineraire.details)!=-1){d.n[i[0]].displayEtiquette(false)}})}}if(this.niveau.charCodeAt(0)<this.oInterface.oConfig.lim_level_for_checkbox.charCodeAt(0)&&this.modeCarte!="ITINERAIRE"){if(jQuery("#modchk").length==0){this.oInterface.genChkBoxes(this.oInterface.oConfig.lstChk,"modchk","frmchk")}if(!this.oInterface.doCheck){this.oInterface.initChkBoxes(this.oInterface.modeIn);this.oInterface.modeSel=this.oInterface.modeIn.concat()}else{this.oInterface.initChkBoxes(this.oInterface.modeSel)}}else{if(jQuery("#modchk").length>0){jQuery("#modchk").remove()}}}else{return false}}if(this.oInterface.pdfhreflink&&this.oInterface.pdfhreflink.match(/isocacheid=[a-f0-9]{32}&pointname=.*/)){f=this.oInterface.pdfhreflink.match(/isocacheid=[a-f0-9]{32}&pointname=(.*)/);this.createPDF(jQuery("#pdfLink a:first"),{href:"./iso/pdf/botanic_"+jQuery.enleveAccent(f[1].toLowerCase())+".pdf"})}else{}},handleLines:function(){if(this.modeCarte=="ITINERAIRE"){this.itineraire.showSVG(this.centerCoord_px.E,this.centerCoord_px.N,this.centerPoint.E,this.centerPoint.N,this.oInterface.oConfig.resolution[this.niveau])}else{this.displayLignes(this.centerCoord_px.E,this.centerCoord_px.N,this.centerPoint.E,this.centerPoint.N,this.oInterface.oConfig.resolution[this.niveau])}},appliZoom:function(b){if(this.niveau==b.substr(3,1)){return}if(this.contextMenu){moviLib.removeElement(this.contextMenu);this.contextMenu=null}this.zooming=true;var a;if(b=="moins"){a=this.nextNiv(this.niveau)}else{if(b=="plus"){a=this.prevNiv(this.niveau)}else{a=b.substr(3,1)}}this.zoomAt(this.centerPoint.E,this.centerPoint.N,a)},updateDatas:function(){var d=arguments.length==1&&typeof arguments[0]=="object"?arguments[0]:{},f=this,b,e,i,c,j,h,a,g;d.centerPoint=typeof d.centerPoint=="undefined"?this.centerPoint:d.centerPoint;d.noReload=typeof d.noReload=="undefined"?false:d.noReload;d.reloadLinks=typeof d.reloadLinks=="undefined"?false:d.reloadLinks;if(d.noReload){this.noreload=true;if(this.timeoutDrag){clearTimeout(this.timeoutDrag)}this.timeoutDrag=setTimeout(function(){f.setInformationLayer(f.modeCarte)},1000);return}else{this.noreload=false;this.parcours.x=0;this.parcours.y=0;if(this.itineraire&&this.itineraire.origine&&this.itineraire.destination){b=this.itineraire.origine.E+":"+this.itineraire.origine.N+":"+this.itineraire.origine["street-address"]+":"+this.itineraire.origine.locality+":"+this.itineraire.origine["postal-code"];e=this.itineraire.destination.E+":"+this.itineraire.destination.N+":"+this.itineraire.destination["street-address"]+":"+this.itineraire.destination.locality+":"+this.itineraire.destination["postal-code"];i=this.itineraire.cacheid}if(this.zooming){this.centerAt(d.centerPoint.E,d.centerPoint.N,this.niveau)}this.reloadInterface();if(this.oInterface.polygons){this.createPDF(jQuery("#pdfLink a:first"),{href:jQuery("#pdfLink a:first").attr("href")})}if(this.timeoutDrag){clearTimeout(this.timeoutDrag)}if(this.modeCarte=="ITINERAIRE"){c=this.dimVisCarte.width==0?this.oInterface.oConfig.width:this.dimVisCarte.width;j=this.dimVisCarte.height==0?this.oInterface.oConfig.height:this.dimVisCarte.height;g="xcenter="+d.centerPoint.E+"&ycenter="+d.centerPoint.N+"&level="+this.niveau+"&L="+c+"&H="+j+"&trajet="+this.itineraire.trajet+"&parcours="+this.itineraire.parcours;if(this.itineraire.selected){g+="&selected="+this.itineraire.selected}if(b&&e){g+="&origine="+b+"&destination="+e}if(i){g+="&cacheid="+i}if(d.reloadLinks){g+="liens=yes"}this.timeoutDrag=setTimeout(function(){f.oInterface.sendData(g,"./gen_include/itimap.php","POST")},1000)}else{g="E_center="+d.centerPoint.E+"&N_center="+d.centerPoint.N+"&level="+this.niveau+"&L="+this.dimVisCarte.width+"&H="+this.dimVisCarte.height;if(this.oInterface.affLigne[0]){h=this.oInterface.affLigne.join("_");g+="&derLig="+h}if(this.itineraire){if(b&&e){g+="&origine="+b;g+="&destination="+e}}if(this.oInterface.modeSel&&this.oInterface.modeSel.length>0&&this.oInterface.doCheck){a=this.oInterface.modeSel.join("_");g+="&derMode="+a}else{if(this.oInterface.doCheck){this.noreload=true;this.setInformationLayer(this.modeCarte);return}}if(!this.zooming){}this.timeoutDrag=setTimeout(function(){f.oInterface.sendData(g,"./gen_include/inmap.php","POST")},1000)}}},removeEtiquettes:function(){return;jQuery("img.dispinfo",this.oHTML[0]).each(function(a){var b=jQuery(a);if(b.next()&&b.attr("id").indexOf("_",0)==-1){b.next().css("visibility","hidden");b.next().next().css("visibility","hidden")}})},createPDF:function(a){var c=arguments.length==2&&typeof arguments[1]=="object"?arguments[1]:{},b;c.tuile=typeof c.tuile=="undefined"?this.maintile:c.tuile;c.x=typeof c.x=="undefined"?this.centerPoint.E:c.x;c.y=typeof c.y=="undefined"?this.centerPoint.N:c.y;c.width=typeof c.width=="undefined"?this.dimVisCarte.width:c.width;c.height=typeof c.height=="undefined"?this.dimVisCarte.height:c.height;c.href=typeof c.href=="undefined"?null:c.href;if(jQuery("#pdfLink").length==0){return}if(this.oInterface.pdfhreflink){if(c.href){a.attr({href:c.href});return}else{if(this.oInterface.pdfhreflink.match(/isocacheid=[a-f0-9]{32}$/)){return}else{b="./gen_include/pdfing.php?"+this.oInterface.pdfhreflink;this.getAllPuns(c.x,c.y,2083,2083);this.getAllSegs(c.x,c.y)}}}else{b="./gen_include/pdfing.php?x_center="+c.x+"&y_center="+c.y+"&level="+this.niveau;b+="&w="+c.width+"&h="+c.height;this.getAllPuns(c.x,c.y,c.width,c.height);this.getAllSegs(c.x,c.y)}if(this.stops&&this.stops.length>0){b+="&"+jQuery.param({stops:this.stops.join(";")})}if(this.flags&&this.flags.length>0){b+="&"+jQuery.param({flags:this.flags.join(";")})}if(this.segs&&this.segs.length>0){b+="&"+jQuery.param({segs:this.segs.join(";")})}if(this.modeCarte=="ITINERAIRE"&&this.itineraire.trajet&&this.itineraire.parcours){b+="&"+jQuery.param({trajet:this.itineraire.trajet.join(","),parcours:this.itineraire.parcours.join(",")});b+="&cacheid="+this.itineraire.cacheid}a.attr("href",b)},getAllPuns:function(e,d,m,i){if(!this.oInterface.aP||!this.oInterface.aP[this.niveau]){return}this.stops=[];this.flags=[];var q=this,k=this.oInterface.oConfig.stopPointPath,t=this.oInterface.oConfig.resolution[this.niveau],r=this.oInterface.aP[this.niveau].length,h=parseInt(e)-parseInt((m/2)*t),l=parseInt(e)+parseInt((m/2)*t),n=parseInt(d)-parseInt((i/2)*t),p=parseInt(d)+parseInt((i/2)*t),a,u,s,g,f,b,o;jQuery("img.dispinfo[id!=p_center][id!=p_origine][id!=p_destination]",this.oHTML).filter(":not([class*=fake])").each(function(){if(jQuery(this).data("E")>h&&jQuery(this).data("E")<l&&jQuery(this).data("N")>n&&jQuery(this).data("N")<p){for(o=0;o<r;o++){if(jQuery.inArray(jQuery(this).attr("id"),q.oInterface.aP[q.niveau][o])!=-1){b=o;break}else{continue}}if(typeof b!="undefined"){a="A";a+="_"+q.oInterface.aP[q.niveau][b][3]+"_"+jQuery(this).parent().data("lignes");u=jQuery(this).attr("src").substring(jQuery(this).attr("src").indexOf(k)+k.length+3,jQuery(this).attr("src").length-4);s=a+":"+jQuery(this).data("E")+":"+jQuery(this).data("N")+":"+u;if(jQuery.inArray(s,q.stops)==-1){q.stops.push(s)}}}});if(this.modeCarte=="ITINERAIRE"){jQuery("img#p_origine",this.oHTML).add(jQuery("img#p_destination",this.oHTML)).each(function(){u=jQuery(this).attr("src").substring(jQuery(this).attr("src").indexOf(k)+k.length,jQuery(this).attr("src").length-4);g=Math.floor((e-jQuery(this).data("E"))/t);f=Math.floor((jQuery(this).data("N")-d)/t);s=g+":"+f+":"+u;if(jQuery.inArray(s,q.flags)==-1){q.flags.push(s)}})}},getAllSegs:function(a,c){var b=this;this.segs=[];jQuery("div.ligne",this.oHTML).each(function(){if(jQuery.inArray(jQuery(this).attr("id"),b.segs)==-1&&b.modeCarte!="ITINERAIRE"){b.segs.push(jQuery(this).attr("id"))}})},zoomInPun:function(c,b){var a,d;if(b.attr("id")=="p_center"){if(c.which){a=(c.which==3)}else{if(c.button){a=(c.button==2)}}d=(a==true)?this.nextNiv(this.niveau):this.prevNiv(this.niveau)}else{d="A"}this.zoomAt(b.data("E"),b.data("N"),d)},zoomAt:function(a,d,c){var b=this.niveau;this.niveau=c;if(this.niveau==this.oInterface.oConfig.lastNiv){this.centerPoint.E=this.oInterface.oConfig.x_def;this.centerPoint.N=this.oInterface.oConfig.y_def}else{this.centerPoint.E=a;this.centerPoint.N=d}if(this.modeCarte=="ITINERAIRE"){this.oInterface.aL[this.niveau]=this.oInterface.aL[b];this.oInterface.aP=[];this.oInterface.aL[b]=[]}else{this.oInterface.aP=[];this.oInterface.aL=[]}this.zooming=true;this.updateDatas()},switchMode:function(a){if(this.modeCarte!=a){this.modeCarte=a}else{return}this.oInterface.aP=[];this.oInterface.aL=[];this.updateDatas()},clicOnLigne:function(b,c){b.stopPropagation();if(jQuery(c).data("mode")=="T"){return}var a=jQuery(c).data("ligne");if(jQuery("#"+a).length==0){this.loadLine(a,jQuery(c).data("mode"))}else{if(jQuery("#"+a).css("display")=="none"){this.showLine(a)}else{this.removeLine(a,jQuery(c).data("mode"))}}},showLine:function(a){jQuery("#"+a).show();this.highlightLigne(a);if(jQuery.inArray(a,this.oInterface.affLigne)==-1){this.oInterface.affLigne.unshift(a)}return},loadLine:function(b,d){if(jQuery("#"+b).length>0){this.showLine(b);return}var a=this.oInterface.oConfig.resolution[this.getCurrentNiv()],c="E_px="+this.centerCoord_px.E+"&N_px="+this.centerCoord_px.N+"&reso="+a+"&E_ref="+this.centerPoint.E+"&N_ref="+this.centerPoint.N+"&level="+this.niveau+"&L="+this.dimVisCarte.width+"&H="+this.dimVisCarte.height;c+="&singleLine="+b;this.oInterface.sendData(c,"./gen_include/inmap.php","POST");return},removeLine:function(a,b){if(jQuery("#infoLigne").length>0){jQuery("#infoLigne").remove()}jQuery("#"+a).hide();this.unHighlightLigne(a);if(jQuery.inArray(a,this.oInterface.affLigne)!=-1){this.oInterface.affLigne.splice(jQuery.inArray(a,this.oInterface.affLigne),1)}return},highlightLigne:function(a){var b,d,e,f,c;jQuery("div.divinfo:data(lignes=/.*\\b"+a+"\\b.*/)").each(function(g){jQuery(this).css("z-index",99);jQuery("img.dispinfo:data(src_on)",this).each(function(h){b=jQuery(this);b.width(b.data("width_on"));b.height(b.data("height_on"));d=b.data("src_on");if(d.indexOf(",",0)==-1){b.attr("src",d)}else{e=b.data("lignes").split(",");f=jQuery.inArray(a,e);c=d.split(",");b.attr("src",c[f])}if(b.data("mode").toString().charAt(0)=="B"||b.data("mode").toString().charAt(0)=="C"){b.parent().css("z-index",100)}});jQuery(this).find("li:data(ligne="+a+")").each(function(h){if(jQuery(this).data("ligne")==a){jQuery(this).addClass("disp")}})})},unHighlightLigne:function(a){var b;jQuery("div.divinfo:data(lignes=/.*\\b"+a+"\\b.*/)").each(function(c){jQuery(this).css("z-index",96);jQuery("img.dispinfo:data(src_on)",this).each(function(d){b=jQuery(this);b.width(b.data("defaultwidth"));b.height(b.data("defaultheight"));b.attr("src",b.data("defaultsrc"));if(b.data("mode").toString().charAt(0)=="B"||b.data("mode").toString().charAt(0)=="C"){b.parent().css("z-index",95)}});jQuery("div.divinfo",this).filter(":last-child").find("li:data(ligne="+a+")").each(function(d){jQuery(this).removeClass("disp")})})},removeEle:function(){if(this.oHTML.children().length){jQuery(".divinfo").each(function(a){jQuery(this).remove()});if(jQuery(".ligne shape",this.oHTML).first().length>0){jQuery(".ligne shape",this.oHTML).each(function(a){jQuery(this).remove()})}if(jQuery(".isochrone shape",this.oHTML).first().length>0){jQuery(".isochrone shape",this.oHTML).each(function(a){jQuery(this).remove()})}if(jQuery(".ligne svg",this.oHTML).first().length>0){jQuery(".ligne svg",this.oHTML).each(function(a){jQuery(this).remove()})}if(jQuery(".isochrone svg",this.oHTML).first().length>0){jQuery(".isochrone svg",this.oHTML).each(function(a){jQuery(this).remove()})}}},createLnkPDF:function(){if(jQuery("#pdfLink").length==0){}return},createZoomSelect:function(h){if(!this.zoomSelect){var e=this,j,k,f,b,a,g,d,c;this.zoomSelect=jQuery('<ul id="zoomSelect"></ul>');j=this.oMask.offset().top+14;this.zoomSelect.css({top:j,background:"url(./images/echelle-site.png) 0 21px no-repeat"});switch(this.oInterface.oConfig.zoomSelect){case"mini":case"none":this.zoomSelect.css("visibility","hidden");default:break}k=jQuery('<li id="deroulNiv"></li>');f=jQuery('<a class="toup" href="javascript:void(0)" title="'+locales[this.oInterface.lang]["fermer"]+'"></a>');f.click(function(){if(jQuery(this).hasClass("todown")){jQuery(this).addClass("toup");jQuery(this).removeClass("todown");jQuery(this).attr("title",locales[e.oInterface.lang]["fermer"]);b=e.zoomSelect.data("defaultHeight");e.zoomSelect.animate({height:b},500)}else{jQuery(this).addClass("todown");jQuery(this).removeClass("toup");jQuery(this).attr("title",locales[e.oInterface.lang]["ouvrir"]);e.zoomSelect.css("overflow","hidden");if(!e.zoomSelect.data("defaultHeight")){e.zoomSelect.data("defaultHeight",e.zoomSelect.height())}e.zoomSelect.animate({height:this.offsetHeight},500)}});k.append(f);this.zoomSelect.append(k);a=jQuery('<li id="moins"></li>');a.click(function(){e.appliZoom(this.id);return false});f=jQuery('<a href="javascript:void(0)" tabindex="-1" title="'+locales[this.oInterface.lang]["zoommoins"]+'"></a>');a.append(f);this.zoomSelect.append(a);for(d=0;d<this.oInterface.oConfig.nbNiv;d++){c=jQuery('<li id="niv'+String.fromCharCode(65+d)+'"></li>');c.click(function(){e.appliZoom(this.id);return false});f=jQuery('<a href="javascript:void(0)" tabindex="-1" title="'+locales[this.oInterface.lang].nameLevel[String.fromCharCode(65+d)]+'"></a>');c.append(f);this.zoomSelect.append(c)}g=jQuery('<li id="plus"></li>');g.click(function(){e.appliZoom(this.id);return false});f=jQuery('<a href="javascript:void(0)" tabindex="-1" title="'+locales[this.oInterface.lang]["zoomplus"]+'"></a>');g.append(f);this.zoomSelect.append(g);h.append(this.zoomSelect)}},getCurrentNiv:function(){return this.zoomSelect.find(".onit").attr("id").substr(3,1)},newEvClick:function(b,a){jQuery("."+b).each(function(c){this.onclick=a})},createContour:function(a){if(!this.contour){this.contour=jQuery('<div id="contour"><div id="c_GH" class="coin"></div><div id="c_GB" class="coin"></div><div id="c_DH" class="coin"></div><div id="c_DB" class="coin"></div><div id="c_G" class="coin"></div><div id="c_H" class="coin"></div><div id="c_D" class="coin"></div><div id="c_B" class="coin"></div></div>');a.append(this.contour);if(this.oInterface.params.device=="defaults"){jQuery("#c_GH").hover(function(b){this.style.backgroundPosition="-10px -40px"},function(b){this.style.backgroundPosition="-10px -10px"});jQuery("#c_GB").hover(function(b){this.style.backgroundPosition="-10px -100px"},function(b){this.style.backgroundPosition="-10px -70px"});jQuery("#c_DH").hover(function(b){this.style.backgroundPosition="-40px -40px"},function(b){this.style.backgroundPosition="-40px -10px"});jQuery("#c_DB").hover(function(b){this.style.backgroundPosition="-40px -100px"},function(b){this.style.backgroundPosition="-40px -70px"});jQuery("#c_G").hover(function(b){this.style.backgroundPosition="-100px -10px"},function(b){this.style.backgroundPosition="-80px -10px"});jQuery("#c_B").hover(function(b){this.style.backgroundPosition="-80px -110px"},function(b){this.style.backgroundPosition="-80px -90px"});jQuery("#c_H").hover(function(b){this.style.backgroundPosition="-80px -70px"},function(b){this.style.backgroundPosition="-80px -50px"});jQuery("#c_D").hover(function(b){this.style.backgroundPosition="-140px -10px"},function(b){this.style.backgroundPosition="-120px -10px"})}}},clickContour:function(a){switch(a.id){case"c_GH":this.moveCarte(Math.floor(this.dimVisCarte.width/2),Math.floor(this.dimVisCarte.height/2));break;case"c_GB":this.moveCarte(Math.floor(this.dimVisCarte.width/2),-Math.floor(this.dimVisCarte.height/2));break;case"c_DH":this.moveCarte(-Math.floor(this.dimVisCarte.width/2),Math.floor(this.dimVisCarte.height/2));break;case"c_DB":this.moveCarte(-Math.floor(this.dimVisCarte.width/2),-Math.floor(this.dimVisCarte.height/2));break;case"c_G":this.moveCarte(Math.floor(this.dimVisCarte.width/2),0);break;case"c_B":this.moveCarte(0,-Math.floor(this.dimVisCarte.height/2));break;case"c_H":this.moveCarte(0,Math.floor(this.dimVisCarte.height/2));break;case"c_D":this.moveCarte(-Math.floor(this.dimVisCarte.width/2),0);default:break}return},upDateContour:function(){var b=this.contour.children("div"),a=this.oMask.offset(),c;for(c=0;c<b.length;c++){switch(b[c].id){case"c_GH":b[c].style.top=parseInt(a.top)+"px";b[c].style.left=parseInt(a.left)+"px";break;case"c_G":b[c].style.top=(parseInt(a.top)+Math.floor(this.oMask.height()/2))-Math.floor(b[c].offsetHeight/2)+"px";b[c].style.left=parseInt(a.left)+"px";break;case"c_GB":b[c].style.top=(parseInt(a.top)+this.oMask.height())-b[c].offsetHeight+"px";b[c].style.left=parseInt(a.left)+"px";break;case"c_H":b[c].style.top=parseInt(a.top)+"px";b[c].style.left=(parseInt(a.left)+Math.floor(this.oMask.width()/2))-Math.floor(b[c].offsetWidth/2)+"px";break;case"c_DH":b[c].style.top=parseInt(a.top)+"px";b[c].style.left=(parseInt(a.left)+this.oMask.width())-b[c].offsetWidth+"px";break;case"c_D":b[c].style.top=(parseInt(a.top)+Math.floor(this.oMask.height()/2))-Math.floor(b[c].offsetHeight/2)+"px";b[c].style.left=parseInt(a.left)+this.oMask.width()-Math.floor(b[c].offsetWidth)+"px";break;case"c_B":b[c].style.top=parseInt(a.top)+this.oMask.height()-Math.floor(b[c].offsetHeight)+"px";b[c].style.left=(parseInt(a.left)+Math.floor(this.oMask.width()/2))-Math.floor(b[c].offsetWidth/2)+"px";break;case"c_DB":b[c].style.left=(parseInt(a.left)+this.oMask.width())-b[c].offsetWidth+"px";b[c].style.top=(parseInt(a.top)+this.oMask.height())-b[c].offsetHeight+"px";break}}},moveToCoords:function(d,e){var c=this.oInterface.oConfig.resolution[this.niveau],b=Math.floor((d-this.centerPoint.E)/c),a=Math.floor((this.centerPoint.N-e)/c);this.moveCarte(-b,-a,true)},moveCarte:function(b,a,c){var d=this;if(this.niveau==this.oInterface.oConfig.lastNiv){return}c=c||false;document.onkeydown=function(){return false};this.deplace.x=b;this.deplace.y=a;this.parcours=new deplacement(0,0);finX=parseInt(this.oHTML.css("left"))+b;finY=parseInt(this.oHTML.css("top"))+a;if(!c){this.oHTML.stop().animate({left:finX,top:finY},{duration:500,complete:function(){d.onDeplacement(new deplacement(b,a));d.dragTiles();oCart.oInterface.movedAndReload()}})}else{this.oHTML.stop().animate({left:finX,top:finY},{duration:500})}},onDeplacement:function(c){var e=this.centerPoint.E,f=this.centerPoint.N,d,b,a;e=this.centerPoint.E-(c.x*this.oInterface.oConfig.resolution[this.niveau]);f=parseInt(this.centerPoint.N,10)+(c.y*this.oInterface.oConfig.resolution[this.niveau]);this.setCenterCoord(e,f);if(jQuery("#boundsBox").length>0){d=this.oInterface.oConfig.resolution[this.niveau];b=Math.floor((this.centerPoint.E-this.xtl_img)/d);a=Math.floor((this.ytl_img-this.centerPoint.N)/d);jQuery("#boundsBox").css({top:b-Math.floor(jQuery("#boundsBox").width()/2),left:a-Math.floor(jQuery("#boundsBox").height()/2)})}},displayLignes:function(a,g,f,e,d){if(this.oInterface.aL[this.niveau]){var c=this,b;jQuery.map(this.oInterface.aL[this.niveau],function(h){b=h.split("_");if(b[5].length==0){return}jQuery(".ligne:data(mode=B)",this.oHTML).add(".ligne:data(mode=C)",this.oHTML).each(function(j){if(jQuery.inArray(this.id,c.oInterface.affLigne)!=-1){c.unHighlightLigne(this.id);c.oInterface.affLigne.splice(jQuery.inArray(this.id,c.oInterface.affLigne),1);jQuery(this).remove()}});if(jQuery.inArray(b[5],c.oInterface.affLigne)==-1){c.oInterface.affLigne.unshift(b[5])}new Segment(c,b[0],b[1],b[3],b[4],b[5],b[7],b[8],b[9],b[10],b[6],null,b[11])});if(this.oInterface.affLigne.length>0){jQuery.map(this.oInterface.affLigne,function(h){c.highlightLigne(h)})}}doLine=false},drawPolygon:function(c){var b=this,a;jQuery.map(c,function(d){a=d.split("_");if(a[5].length==0){return}new Polygon(b,a[0],a[1],a[3],a[4],a[2],a[5],a[8])})},zoomin:function(b){this.zooming=true;if(this.dragapproved){this.dragapproved=false;return false}var f=this,e=jQuery(b.target).parent(),d,c,a,i,g,h;if(e[0].parentNode){d=e.parent();switch(b.type){case"dblclick":if(e.attr("id")==this.oHTML.attr("id")||d.attr("id")==this.oHTML.attr("id")){c=(b.pageX-this.lstimg[0][0].offset().left)-this.centerCoord_px.E;a=(b.pageY-this.lstimg[0][0].offset().top)-this.centerCoord_px.N;i=parseInt(this.centerPoint.E,10)+(c*this.oInterface.oConfig.resolution[this.niveau]);g=parseInt(this.centerPoint.N,10)-(a*this.oInterface.oConfig.resolution[this.niveau]);h=this.prevNiv(this.niveau);this.zoomAt(i,g,h)}break;case"gesturestart":this.oHTML.bind("gesturechange",function(j){f.zoomin(j)});this.oHTML.bind("gestureend",function(j){f.zoomin(j)});break;case"gesturechange":b.preventDefault();this.oInterface.oConfig.scale=b.originalEvent.scale;break;case"gestureend":this.oHTML.unbind("gesturechange",function(j){f.zoomin(j)});this.oHTML.unbind("gestureend",function(j){f.zoomin(j)});if(this.oInterface.oConfig.scale<1){h=this.prevNiv(this.niveau);this.zoomAt(this.centerPoint.E,this.centerPoint.N,h)}if(this.oInterface.oConfig.scale>1){h=this.nextNiv(this.niveau);this.zoomAt(this.centerPoint.E,this.centerPoint.N,h)}break;default:break}}},dragTiles:function(){var a=this.getCurOffset();while(a.width<-this.paddingLeft/2){this.toRight();this.getCurOffset(a)}while(a.width>this.paddingLeft/2){this.toLeft();this.getCurOffset(a)}while(a.height<-this.paddingTop/2){this.toDown();this.getCurOffset(a)}while(a.height>this.paddingTop/2){this.toUp();this.getCurOffset(a)}},getCurOffset:function(a){if(!a){a=new dimW(0,0)}a.width=parseInt(this.oHTML.css("left"),10)+this.curLeftOffset*this.oInterface.oConfig.tileWidth;a.height=parseInt(this.oHTML.css("top"),10)+this.curTopOffset*this.oInterface.oConfig.tileHeight;return a},menuContextuel:function(d){var c=this,b=(d.pageX-this.lstimg[0][0].offset().left)-this.centerCoord_px.E,a=(d.pageY-this.lstimg[0][0].offset().top)-this.centerCoord_px.N,e=parseInt(this.centerPoint.E,10)+(b*this.oInterface.oConfig.resolution[this.niveau]),f=parseInt(this.centerPoint.N,10)-(a*this.oInterface.oConfig.resolution[this.niveau]);if(!this.contextMenu){this.contextMenu=jQuery('<div id="contextMenu"></div>').data("E",e).data("N",f);this.contextMenu.append(jQuery('<p class="rcquartier"></p>').append(jQuery('<a href="javascript:void(0)">Voir le quartier</a>').click(function(g){c.zoomAt(jQuery("#contextMenu").data("E"),jQuery("#contextMenu").data("N"),"A")})));this.contextMenu.click(function(){jQuery(this).remove();c.contextMenu=null});this.contextMenu.noContext();this.oConteneur.append(this.contextMenu)}else{this.contextMenu=jQuery("#contextMenu").data("E",e).data("N",f)}if((d.pageX+this.contextMenu.width())>(this.oMask.offset().left+this.dimVisCarte.width)){this.contextMenu.css("left",d.pageX-this.contextMenu.width())}else{this.contextMenu.css("left",d.pageX)}if((d.pageY+this.contextMenu.height())>(this.oMask.offset().top+this.dimVisCarte.height)){this.contextMenu.css("top",d.pageY-this.contextMenu.height())}else{this.contextMenu.css("top",d.pageY)}return},mdw:function(a){a.stopPropagation();if(this.timeoutDrag){clearTimeout(this.timeoutDrag)}this.mvswt=true;this.mouseup=false;this.antX=a.pageX;this.antY=a.pageY;this.offsetX=a.pageX-this.oHTML[0].offsetLeft;this.offsetY=a.pageY-this.oHTML[0].offsetTop;return true},mmv:function(c){c.stopPropagation();this.mouseup=false;if(this.mvswt){this.dragapproved=true;var b=c.pageX-this.offsetX,a=c.pageY-this.offsetY;if(this.antX<c.pageX){this.deplace.x+=c.pageX-this.antX}if(this.antX>c.pageX){this.deplace.x-=this.antX-c.pageX}if(this.antY>c.pageY){this.deplace.y-=this.antY-c.pageY}if(this.antY<c.pageY){this.deplace.y+=c.pageY-this.antY}this.oHTML.css("left",b);this.oHTML.css("top",a);this.onDeplacement(new deplacement((c.pageX-this.antX),(c.pageY-this.antY)));this.dragTiles();this.antX=c.pageX;this.antY=c.pageY}return true},mup:function(a){this.oHTML.removeClass("grab");a.stopPropagation();this.removeEtiquettes();this.mvswt=false;this.mouseup=true;if(this.dragapproved){this.oInterface.movedAndReload()}this.dragapproved=false;return true}};function Tile(a){this.conteneur=a;this.oInterface=this.conteneur.oInterface;this.level=null;this.ind=null;this.height=null;this.width=null;this.mpx=null;this.x_topleft=null;this.y_topleft=null;this.ligne=null;this.colonne=null;this.name=null;this.pathImg=null;this.extension=null;this.srcImage=null;this.E_px=null;this.N_px=null;this.tab=false;this.zone=null}Tile.prototype={set_tileDimensions:function(b,a){this.height=b;this.width=a},set_ligne_colonne:function(b,a,c){this.level=c;this.ligne=b;this.colonne=a},set_ligne_colonne_from_coord:function(c,d,g){this.level=g;if(this.level.charCodeAt(0)<=this.oInterface.oConfig.lim_niv_zone.charCodeAt(0)){this.tab=true;var a=this.oInterface.oConfig.resolution[this.level]*this.width*this.oInterface.oConfig.bottomRightCol[this.ind],f=this.oInterface.oConfig.resolution[this.level]*this.height*this.oInterface.oConfig.bottomRightLine[this.ind],e=Math.floor((c-this.oInterface.oConfig.xo[this.ind])/a),b=Math.floor((this.oInterface.oConfig.yo[this.ind]-d)/f);this.setZone(b,e);this.xoZone=this.oInterface.oConfig.xo[this.ind]+(a*e);this.yoZone=this.oInterface.oConfig.yo[this.ind]-(f*b);this.ligne=this.oInterface.oConfig.topLeftLine[this.ind]+Math.floor((this.yoZone-d)/(this.oInterface.oConfig.resolution[this.level]*this.height));this.colonne=this.oInterface.oConfig.topLeftCol[this.ind]+Math.floor((c-this.xoZone)/(this.oInterface.oConfig.resolution[this.level]*this.width))}else{this.ligne=this.oInterface.oConfig.topLeftLine[this.ind]+Math.floor((this.oInterface.oConfig.yo[this.ind]-d)/(this.oInterface.oConfig.resolution[this.level]*this.height));this.colonne=this.oInterface.oConfig.topLeftCol[this.ind]+Math.floor((c-this.oInterface.oConfig.xo[this.ind])/(this.oInterface.oConfig.resolution[this.level]*this.width))}this.set_srcImage()},setZone:function(c,d){var b,a;if(c>=0){b=jQuery.str_pad(String(c),2,"0","STR_PAD_LEFT")}else{b="-"+jQuery.str_pad(String(Math.abs(c)),2,"0","STR_PAD_LEFT")}if(d>=0){a=jQuery.str_pad(String(d),2,"0","STR_PAD_LEFT")}else{a="-"+jQuery.str_pad(String(Math.abs(d)),2,"0","STR_PAD_LEFT")}this.zone=this.oInterface.oConfig.tileLineColSep+this.level.toLowerCase()+this.oInterface.oConfig.tileLineColSep+b+this.oInterface.oConfig.tileLineColSep+a},set_tileName:function(){var b=jQuery.str_pad(String(this.ligne),this.oInterface.oConfig.tileNumFieldLen,this.oInterface.oConfig.tileNumFill,"STR_PAD_LEFT"),a=jQuery.str_pad(String(this.colonne),this.oInterface.oConfig.tileNumFieldLen,this.oInterface.oConfig.tileNumFill,"STR_PAD_LEFT");this.name=this.level+this.oInterface.oConfig.tileLineColSep+b+this.oInterface.oConfig.tileLineColSep+a},set_path:function(){if(this.tab){this.pathImg=this.oInterface.oConfig.tileRefPath+"_"+this.level.toLowerCase()+"/"+[this.zone]+"/"}else{this.pathImg=this.oInterface.oConfig.tileRefPath+"_"+this.level.toLowerCase()+"/"}},set_extension:function(){this.extension=this.oInterface.oConfig.tileSuffix},set_srcImage:function(){if(!this.pathImg){this.set_path()}if(!this.extension){this.set_extension()}if(!this.name){this.set_tileName()}this.srcImage=this.pathImg+this.name+this.extension},set_mpx:function(){if(!this.level){return false}this.mpx=this.oInterface.oConfig.resolution[this.level]},coordTopLeft:function(){if(!this.name){this.set_tileName()}if(!this.tab){this.x_topleft=this.oInterface.oConfig.xo[this.ind]+(this.oInterface.oConfig.resolution[this.level]*this.width*(this.colonne-1));this.y_topleft=this.oInterface.oConfig.yo[this.ind]-(this.oInterface.oConfig.resolution[this.level]*this.height*(this.ligne-1))}else{this.x_topleft=this.xoZone+(this.oInterface.oConfig.resolution[this.level]*this.width*(this.colonne-1));this.y_topleft=this.yoZone-(this.oInterface.oConfig.resolution[this.level]*this.height*(this.ligne-1))}},coordToPixel:function(a,b){if(!this.mpx){this.set_mpx()}this.E_px=Math.floor((a-this.x_topleft)/this.mpx);this.N_px=Math.floor((this.y_topleft-b)/this.mpx)},createMainTile:function(a,b,c){this.set_tileDimensions(this.oInterface.oConfig.tileWidth,this.oInterface.oConfig.tileHeight);this.ind=c.charCodeAt(0)-this.oInterface.firstNivAscii;this.set_ligne_colonne_from_coord(a,b,c);this.coordTopLeft();this.coordToPixel(a,b)}};function Punaise(b,a,d,c){this.oConteneur=b;this.oInterface=this.oConteneur.oInterface;this.id=c;this.oHTML=null;this.oHTML_img=null;this.E=a;this.N=d;this.E_px=null;this.N_px=null;this.isPole=false;this.multiLigne=false;this.typepole=null;this.src=null;this.src_on=null;this.width=12;this.height=12;this.left=null;this.top=null;this.visible=false;this.nomStation=null;this.spaninfo=null;this.id_div=null;this.classe="dispinfo";this.divClasse="divinfo";this.dimSelectedPun=new dimW(0,0);this.is24=false;this.zindex=91;this.infosLigne=null}Punaise.prototype={setMode:function(){return this.params.ligne[1]},setSrcImg:function(e){var c=this.oInterface.oConfig.stopPointPath+"_"+this.oConteneur.niveau.charAt(0).toLowerCase()+"/",b,f,d,a;if(this.params.type=="centre"){this.src="./images/pointer2.png";this.width=29;this.height=29;this.zindex=90}else{if(this.params.type=="FIXE"||this.params.type=="ETAPE"||e.toString().match(/.png/)){b=e.split(":");if(jQuery.inArray(b[0],this.oInterface.oConfig.aPNG24)!=-1){this.is24=true}if(this.mode&&this.mode[0].charAt(0)=="T"){this.src=c+b[0]}else{this.src=this.oInterface.oConfig.stopPointPath+b[0]}this.width=parseInt(b[1]);this.height=parseInt(b[2]);if(this.params.type=="ETAPE"){this.zindex=101}}else{if(!jQuery.isArray(e)){if(e.indexOf(";",0)==-1){b=e.split(":");if(b[1].indexOf("P",0)!=-1){this.typepole=b[1];this.isPole=true}this.src=c+b[0]+"_"+b[1]+"_"+b[2]+".png"}else{d=e.split(";");b=d[0].split(":");f=d[1].split(":");this.src=c+b[0]+"_"+b[1]+"_"+b[2]+".png";this.src_on=c+f[0]+"_"+f[1]+"_"+f[2]+"_on.png"}}else{this.src_on=[];for(a=0;a<e.length;a++){if(e[a].indexOf(";",0)==-1){b=e[a].split(":");if(b[1].indexOf("P",0)!=-1){this.typepole=b[1];this.isPole=true}this.src=c+b[0]+"_"+b[1]+"_"+b[2]+".png"}else{d=e[a].split(";");b=d[0].split(":");f=d[1].split(":");this.src=c+b[0]+"_"+b[1]+"_"+b[2]+".png";this.src_on=c+f[0]+"_"+f[1]+"_"+f[2]+"_on.png"}}}if(b[3]){this.width=parseInt(b[3])}if(b[4]){this.height=parseInt(b[4])}if(f){if(f[3]){this.dimSelectedPun.width=parseInt(f[3])}if(f[4]){this.dimSelectedPun.height=parseInt(f[4])}}}}},getCodeLigne:function(){var a=[],d=this.params.ligne[0],c,b;for(c=0;c<d.length;c++){b=d[c].split(":");a.push(b[0])}return a.join(",")},createPun:function(){this.params=arguments.length==1&&typeof arguments[0]=="object"?arguments[0]:{};this.params.type=typeof this.params.type=="undefined"?null:this.params.type;this.params.img_info=typeof this.params.img_info=="undefined"?null:this.params.img_info;this.params.ligne=typeof this.params.ligne=="undefined"?null:this.params.ligne;this.params.terminus=typeof this.params.terminus=="undefined"?false:this.params.terminus;this.params.nature=typeof this.params.nature=="undefined"?null:this.params.nature;this.params.poleEchange=typeof this.params.poleEchange=="undefined"?false:this.params.poleEchange;this.params.inPtu=typeof this.params.inPtu=="undefined"?"1":this.params.inPtu;var b,c,d,a;if(!this.params.ligne){this.mode=null}else{this.mode=this.setMode();(this.mode[0].charAt(0)=="B")?this.zindex=95:this.zindex=96}this.setSrcImg(this.params.img_info);if(jQuery("#divpun"+this.id).length==0){this.oHTML=jQuery('<div id="divpun'+this.id+'"></div>');this.id_div=this.oHTML.attr("id");if(this.params.ligne){b=this.getCodeLigne();this.oHTML.data("lignes",b);this.oHTML.data("type","Desserte")}this.oHTML.addClass(this.divClasse);this.oHTML.css("z-index",this.zindex);this.oHTML_img=jQuery('<img id="'+this.id+'" class="'+this.classe+'" src="'+this.src+'" width="'+this.width+'" height="'+this.height+'" alt="" />');this.oHTML_img.css({position:"absolute",height:this.height,width:this.width,"z-index":0,cursor:"pointer",visibility:"hidden"});if(this.params.type=="arret"){if(this.params.inPTU=="1"&&jQuery.inArray("C",this.mode)>-1&&jQuery.inArray("B",this.mode)==-1&&!this.isPole){this.oHTML_img.css("opacity",0.5)}this.oHTML_img.data("mode",this.mode.join(","));if(this.oInterface.modeSel&&this.oInterface.doCheck&&jQuery.inArray(this.mode[0].charAt(0),this.oInterface.modeSel)==-1){this.oHTML_img.css("visibility","hidden")}if(this.src_on){this.oHTML_img.data("defaultsrc",this.src);this.oHTML_img.data("defaultwidth",this.width);this.oHTML_img.data("defaultheight",this.height);if(jQuery.isArray(this.src_on)){c=this.src_on.join(",")}else{c=this.src_on}this.oHTML_img.data("src_on",c);this.oHTML_img.data("width_on",this.dimSelectedPun.width);this.oHTML_img.data("height_on",this.dimSelectedPun.height)}}this.oHTML_img.data("E",this.E);this.oHTML_img.data("N",this.N);this.oHTML_img.data("Motif",this.params.terminus);this.oHTML.append(this.oHTML_img);if(this.params.type!="centre"){this.setPosition();this.oConteneur.oHTML.append(this.oHTML)}else{this.oConteneur.oConteneur.append(this.oHTML)}if((this.width>30||this.height>30)&&this.oConteneur.niveau!="G"&&this.params.type=="arret"){d=this.oHTML.clone(true);d.attr("id","_"+this.oHTML.attr("id")+"_").css("z-index",parseInt(this.oHTML.css("z-index"))+1);this.oHTML.after(d);a=d.children(0);a.attr({id:"_"+this.oHTML_img.attr("id")+"_",src:"./images/spacer.gif"}).height(25).width(25);if(is_ie6){a.css("filter","");if(a.data("realsrc")){a.removeData("realsrc")}}a.addClass("fake");this.oHTML_img.css("cursor","default");this.setPosition(a,25,25)}}else{this.oHTML=jQuery("#divpun"+this.id);this.id_div=this.oHTML.attr("id");this.oHTML_img=this.oHTML.children("img.dispinfo");this.oHTML_img.attr({id:this.id,"class":this.classe,src:this.src}).show();this.setPosition()}},setPosition:function(g,i,q){g=g||this.oHTML_img;i=i||this.width;q=q||this.height;var t=this.oInterface.oConfig.resolution[this.oConteneur.niveau],h,d,k,j;if(this.E.match&&this.E.match(/;+/)){h=this.barycenter(this.E.split(";"))}else{h=this.E}if(this.N.match&&this.N.match(/;+/)){d=this.barycenter(this.N.split(";"))}else{d=this.N}k=Math.floor((h-this.oConteneur.xtl_img)/t);j=Math.floor((this.oConteneur.ytl_img-d)/t);g.css({left:k-Math.floor(i/2),top:j-Math.floor(q/2),visibility:"visible"});if(is_ie6){var p,o,f,c,e,n,m,s,r,l;p=g.attr("src").toUpperCase();if(p.substring(p.length-3,p.length)=="PNG"&&this.is24){o=(g.attr("src"))?"src='"+g.attr("src")+"' ":"";f=(g.attr("alt"))?"alt='"+g.attr("alt")+"' ":"";c=this.getImagesAttributes(g);e=(g.attr("id"))?"id='"+g.attr("id")+"' ":"";n=(g.attr("title"))?"title='"+g.attr("title")+"' ":"title='"+g.attr("alt")+"' ";m="stroked=t";m="stroked=f";s="<v:image "+m+" ";r="></v:image>";l=e+o+"style='position:absolute;top:"+g.css("top")+";left:"+g.css("left")+";width:"+i+"px;height:"+q+"px;visibility:visible;z-index:0'"+f+n+c;g.outerHTML=s+l+r}this.oHTML_img=this.oHTML.children().eq(0)}},barycenter:function(a,b){var c=0,f=0,e=a.length,d;b=b||jQuery.array_fill(0,e,1);for(d=0;d<e;d++){c+=parseInt(a[d],10);f+=parseInt(b[d],10)}return Math.round(c/f)},getImagesAttributes:function(a){var b="";if(a.data("E")){b+="E='"+a.data("E")+"' ";b+="N='"+a.data("N")+"' "}if(a.data("mode")){b+="mode='"+a.data("mode")+"' "}if(a.data("defaultsrc")){b+="defaultsrc='"+a.data("defaultsrc")+"' ";b+="src_on='"+a.data("src_on")+"' ";b+="width_on='"+a.data("width_on")+"' ";b+="height_on='"+a.data("height_on")+"' "}if(a.data("street-address")){b+="street-address='"+a.data("street-address")+"' "}if(a.data("postal-code")){b+="postal-code='"+a.data("postal-code")+"' "}if(a.data("locality")){b+="locality='"+a.data("locality")+"' "}return b},posPunAtCenter:function(){var a=jQuery("#"+this.id);this.E_px=Math.floor(this.oConteneur.dimVisCarte.width/2)+this.oConteneur.dimVisCarte.left;this.N_px=Math.floor(this.oConteneur.dimVisCarte.height/2)+this.oConteneur.dimVisCarte.top;a.parent().css({left:this.E_px-Math.floor(this.width/2),top:this.N_px-Math.floor(this.height/2)});a.css({"z-index":this.zindex,visibility:"hidden"})},setCoords:function(a,b){this.E=a;this.N=b;this.oHTML_img.data("E",this.E);this.oHTML_img.data("N",this.N)},createDivforInfo:function(h,d,i,a,f,j){var e=this,b,g;if(d=="divinfo"){g=this.divClasse}else{g=null}if(jQuery("#"+d+this.id).length>0){jQuery("#"+d+this.id).remove()}b=jQuery('<div id="'+d+this.id+'" class="'+g+'"></div>').css({position:"absolute","background-color":j,visibility:f}).width(a).height(i);if(d=="station"||d=="bulle"){jQuery('<button class="close" type="button"><img width="13" height="13" src="./images/close.gif" alt="Close"/></button>').bind("click",function(c){e.closeStation(c)}).appendTo(b)}b.appendTo(jQuery("#"+h));return b},setTxtInfo:function(n,d,p){var j=this,e,c,h,l,k,b,r,g,q,m,o,s,f;if(n=="station"){this.nomStation.css({"z-index":101,visibility:"hidden"}).addClass(n).data("Motif",this.params.terminus);e=jQuery("<p>"+p.replace(/\.+$/,"")+"</p>");if(d){e.addClass(d)}this.nomStation.append(e)}else{if(n=="bulle"){this.nomStation.css({"z-index":91,visibility:"hidden"}).addClass(n).data("Motif",this.params.terminus).append(jQuery("<h4>"+locales[this.oInterface.lang][this.id]+"</h4>"));if(jQuery.isPlainObject(p)){s=this.createVCard(p)}if(s){this.nomStation.append(s)}if(this.oConteneur.niveau!=this.oInterface.oConfig.firstNiv){c=jQuery("<p></p>").append(jQuery('<a href="javascript:void(0)">'+locales[this.oInterface.lang]["zoomIn"]+"</a>").click(function(a){a.preventDefault();a.stopPropagation();j.oConteneur.zoomInPun(a,j.oHTML_img)}));this.nomStation.append(c)}}else{h=this.params.ligne[0];l=jQuery("<ul></ul>");for(f=0;f<h.length;f++){if(h[f]!=""){switch(this.mode[f]){case"T":switch(h[f].substr(0,3)){case"TER":k=new oLigne(h[f],"TER");break;case"TGL":k=new oLigne(h[f],"Corail");break;case"TEI":k=new oLigne(h[f],"Transilien");break;case"TGV":k=new oLigne(h[f],"TGV");break;default:k=new oLigne(h[f],h[f]);break}ligne=k.label;b=k.code;break;default:r=h[f].split(":");k=new oLigne(r[0],r[1]);ligne=k.label;b=k.code;if(this.mode[f]=="Bt"){ligne+=" Terminus"}break}e=jQuery("<li>"+ligne+"</li>");e.css("margin",0);if(d){e.addClass(d)}if(d=="affInfo"&&this.mode){if(this.oConteneur.modeCarte!="ITINERAIRE"){e.mousedown(function(a){j.oConteneur.clicOnLigne(a,this)})}e.addClass(this.oInterface.oConfig.classeNom[this.mode[f].charAt(0)].substring(5));this.overOut(e,this.mode[f].charAt(0));e.data("mode",this.mode[f].charAt(0));e.data("ligne",b);if(this.mode[f]!="T"){e.prepend(jQuery('<img class="infoimg" alt="Informations sur la ligne" src="./images/infol.png"/>'))}}l.append(e)}}this.spaninfo.append(l);if(this.oConteneur.lastDisplayed&&this.oHTML_img.attr("id")==this.oConteneur.lastDisplayed[1]){g=l.find("li:data(ligne="+this.oConteneur.lastDisplayed[0]+")").get(0);q=g.offsetTop+"px";m=g.offsetLeft+g.offsetWidth+"px";o=jQuery('<div id="infoLigne" class="'+jQuery(g).data("mode")+'"><img src="./images/ld.gif" width="16" height="16" alt=""/></div>').css({position:"absolute",top:q,left:m}).html(this.oConteneur.lastDisplayed[2]);o.insertAfter(jQuery(g))}}}},retrieveInfosHandler:function(d,c,e,a,f){var b=this;if(this.oConteneur.oInterface.timeOutLigne){clearTimeout(this.oConteneur.oInterface.timeOutLigne)}this.oConteneur.oInterface.timeOutLigne=setTimeout(function(){b.retrieveInfos(d,c,e,a,f)},250)},retrieveInfos:function(d,q,f,m,k){if(this.oInterface.timeOutLigne){clearTimeout(this.oInterface.timeOutLigne)}var g=this,b,p=d.offsetTop+"px",j=d.offsetLeft+d.offsetWidth+"px",l,o,i,n,e,c,a;this.oConteneur.lastDisplayed=[q,this.oHTML_img.attr("id")];b=this.oConteneur.lastDisplayed.join();if(jQuery("#infoLigne").length>0){if((jQuery("#infoLigne").data("ligneAndId")==b)){return}jQuery("#infoLigne").remove()}l=jQuery('<div id="infoLigne" class="'+f+'"><img src="./images/ld.gif" width="16" height="16" alt=""/></div>').css({position:"absolute",top:p,left:j});l.data("ligneAndId",b);l.appendTo(jQuery(d.parentNode)).hide();o=jQuery(this.nomStation[0].firstChild).text();i="infosligne="+q+"&lang="+this.oInterface.lang+"&level="+this.oConteneur.niveau+"&nomStation="+o;if(m&&k){i+="&xpoint="+m+"&ypoint="+k}this.oConteneur.oInterface.sendData(i,"./gen_include/traitement.php","POST",l,function(){jQuery('<button class="close" type="button"><img src="./images/close.gif" alt="Close"/></button>').bind("click",function(){jQuery("#infoLigne").remove()}).appendTo(l);g.oConteneur.lastDisplayed.push(l.html());n=l.first().width();e=l.first().height();l.animate({width:n,height:e},"normal","swing");c=l.offset().left+n;a=l.offset().top+e;if(c>g.oConteneur.dimVisCarte.right&&a>g.oConteneur.dimVisCarte.bottom){g.oConteneur.moveCarte(g.oConteneur.dimVisCarte.right-c-20,g.oConteneur.dimVisCarte.bottom-a-20)}else{if(c>g.oConteneur.dimVisCarte.right){g.oConteneur.moveCarte(g.oConteneur.dimVisCarte.right-c-20,0)}else{if(a>g.oConteneur.dimVisCarte.bottom){g.oConteneur.moveCarte(0,g.oConteneur.dimVisCarte.bottom-a-20)}}}});return},removeInfos:function(b){b.stopPropagation();var c=b.target,a;if(!jQuery(c).is("li.affInfo")){return}a=b.relatedTarget;while(a!=c&&jQuery(a).is("#infoLigne")&&!jQuery(a).is("BODY")){a=a.parentNode}if(a==c||jQuery(a).is("#infoLigne")){return}if(jQuery("#infoLigne").length>0){jQuery("#infoLigne").remove()}},getCurrentIndex:function(){var d=this.oInterface.aP[this.oConteneur.niveau].length,a,b;for(a=0;a<d;a++){if(jQuery.inArray(this.id,this.oInterface.aP[this.oConteneur.niveau][a])!=-1){b=a;break}}return b},createVCard:function(d){var c=jQuery('<div class="vcard"><span class="fn" style="display:none;">&nbsp;</span></div>'),b=jQuery('<div class="adr"></div>'),a;for(a in d){this.oHTML_img.data(a,d[a]);if(d[a].length==0){continue}b.append(jQuery('<p class="'+a+'">'+jQuery.stripslashes(d[a])+"</p>"))}c.append(b);return c},setPositionStation:function(g,d,i){var c=d.css("left"),k=d.css("top"),j=d.width(),e=d.height(),m=jQuery("#"+g+this.id),f,b,a;if(g=="bulle"){if(this.E<this.oConteneur.centerPoint.E){if(this.N>this.oConteneur.centerPoint.N){f=jQuery('<div class="bulle_gb"></div>').appendTo(m);m.css({left:parseInt(c)+Math.floor(parseInt(j)/2),top:parseInt(k)+Math.floor(parseInt(e)/2)-m.height()});if(m.offset().top<this.oConteneur.oMask.offset().top){m.addClass("bulle_gh");f.removeClass("bulle_gb");f.addClass("bulle_bottom");m.css({left:parseInt(c)+Math.floor(parseInt(j)/2),top:parseInt(k)+Math.floor(parseInt(e)/2)})}}else{m.addClass("bulle_gh");f=jQuery('<div class="bulle_bottom"></div>').appendTo(m);m.css({left:parseInt(c)+Math.floor(parseInt(j)/2),top:parseInt(k)+Math.floor(parseInt(e)/2)});if((m.offset().top+m.height())>(this.oConteneur.oMask.offset().top+Math.floor(this.oConteneur.dimVisCarte.height))){m.removeClass("bulle_gh");f.removeClass("bulle_bottom");f.addClass("bulle_gb");m.css({left:parseInt(c)+Math.floor(parseInt(j)/2),top:parseInt(k)+Math.floor(parseInt(e)/2)-m.height()})}}}else{if(this.N>this.oConteneur.centerPoint.N){f=jQuery('<div class="bulle_db"></div>').appendTo(m);m.css({left:parseInt(c)+Math.floor(parseInt(j)/2)-m.width(),top:parseInt(k)+Math.floor(parseInt(e)/2)-m.height()});if(m.offset().top<this.oConteneur.oMask.offset().top){m.addClass("bulle_dh");f.removeClass("bulle_db");f.addClass("bulle_bottom");m.css({left:parseInt(c)+Math.floor(parseInt(j)/2)-m.width(),top:parseInt(k)+Math.floor(parseInt(e)/2)})}}else{m.addClass("bulle_dh");f=jQuery('<div class="bulle_bottom"></div>').appendTo(m);m.css({left:parseInt(c)+Math.floor(parseInt(j)/2)-m.width(),top:parseInt(k)+Math.floor(parseInt(e)/2)});if((m.offset().top+m.height())>(this.oConteneur.oMask.offset().top+Math.floor(this.oConteneur.dimVisCarte.height))){m.removeClass("bulle_dh");f.removeClass("bulle_bottom");f.addClass("bulle_db");m.css({left:parseInt(c)+Math.floor(parseInt(j)/2)-m.width(),top:parseInt(k)+Math.floor(parseInt(e)/2)-m.height()})}}}}else{if(this.oConteneur.niveau!=this.oInterface.oConfig.lastNiv){b=d.offset().left+parseInt(j)+m.width();a=(d.offset().top-Math.floor(m.height()/4))+m.next().height()+m.height();if(b>this.oConteneur.dimVisCarte.right){m.css("left",parseInt(c)-m.width())}else{m.css("left",parseInt(c)+parseInt(j))}if(a>this.oConteneur.dimVisCarte.bottom){m.css("top",parseInt(k)-(m.height()+m.next().height()-parseInt(e)))}else{if(a<this.oConteneur.oMask.offset().top){m.css("top",parseInt(k)+Math.floor(m.height()/4))}else{m.css("top",parseInt(k)-Math.floor(m.height()/4))}}}else{m.css({left:parseInt(c),top:parseInt(k)+parseInt(e)})}}},overOut:function(b,c){var a=this;switch(c){case"T":b.css("cursor","default").hover(function(){return false},function(){return false});break;default:b.hover(function(d){a.oConteneur.oInterface.inverseColorBackground(jQuery(this))},function(d){a.oConteneur.oInterface.inverseColorBackground(jQuery(this))});break}},creeEtiquette:function(a){if(!this.oInterface.aP||!this.oInterface.aP[this.oConteneur.niveau]||this.oInterface.aP[this.oConteneur.niveau].length==0){if(this.oInterface.infospanel.oHTML.children().length>0){this.oInterface.infospanel.storeInfos()}else{return false}}a=typeof a=="undefined"?this.getCurrentIndex():a;var b;if(this.params.type=="ETAPE"){this.nomStation=this.createDivforInfo(this.id_div,"bulle","auto","185px","visible","transparent");this.setTxtInfo("bulle",null,this.oInterface.aP[this.oConteneur.niveau][a][3]);b=this.oHTML_img;this.setPositionStation("bulle",b,this.oInterface.aP[this.oConteneur.niveau][a][8])}else{if(this.oHTML_img.parent().data("type")){if(is_ie6){this.nomStation=this.createDivforInfo(this.id_div,"station","auto","102px","visible","#FFFFFF")}else{this.nomStation=this.createDivforInfo(this.id_div,"station","auto","auto","visible","#FFFFFF")}this.spaninfo=this.createDivforInfo(this.id_div,"divinfo","auto","45px","hidden","transparent");if(this.isPole){if(this.typepole=="P"){this.setTxtInfo("station",this.oInterface.oConfig.classeNom.P,this.oInterface.aP[this.oConteneur.niveau][a][3])}else{this.setTxtInfo("station",this.oInterface.oConfig.classeNom[this.typepole.substr(1,1)],this.oInterface.aP[this.oConteneur.niveau][a][3])}}else{this.setTxtInfo("station",this.oInterface.oConfig.classeNom[this.mode[0].charAt(0)],this.oInterface.aP[this.oConteneur.niveau][a][3])}this.setTxtInfo("divinfo","affInfo");if(this.oHTML_img.parent().next().length>0&&this.oHTML_img.parent().next().children(":first").hasClass("fake")){b=this.oHTML_img.parent().next().children(":first")}else{b=this.oHTML_img}this.setPositionStation("station",b,this.oInterface.aP[this.oConteneur.niveau][a][8])}}return true},displayEtiquette:function(b){if(!this.nomStation){this.creeEtiquette()}this.oHTML_img.next().css("visibility","visible");if(b){this.openLignes(this.oHTML_img.next())}if(this.oHTML_img.data("src_on")){this.oHTML_img.width(this.oHTML_img.data("width_on"));this.oHTML_img.height(this.oHTML_img.data("height_on"));var a=this.oHTML_img.data("src_on");this.oHTML_img.attr("src",a)}if(this.params.type=="ETAPE"){return}this.oHTML_img.parent().css("z-index","100")},openStationHandler:function(){var a=this;if(this.oConteneur.oInterface.timeOutId){clearTimeout(this.oConteneur.oInterface.timeOutId)}this.oConteneur.oInterface.timeOutId=setTimeout(function(){a.openStation()},250)},openStation:function(){var b=this,c,a,d=this.oHTML_img;if(this.oConteneur.oInterface.timeOutId){clearTimeout(this.oConteneur.oInterface.timeOutId)}if(!this.nomStation){this.creeEtiquette();jQuery("div[id^=divpun] div li.affInfo").each(function(){c=jQuery(this).parents("div[id^=divpun]").eq(0);if(c.data("type")=="Desserte"){a=jQuery(c.get(0).firstChild).data("mode").toString();(a.charAt(0)=="B")?c.css("z-index",95):c.css("z-index",96);if(b.oInterface.affLigne.length>0){if(jQuery.inArray(jQuery(this).data("ligne"),b.oInterface.affLigne)!=-1){jQuery(this).addClass("disp");c.css("z-index",99)}}}})}jQuery("div[id^=station]").each(function(e){jQuery(this).css("visibility","hidden")});jQuery("div[id^=divinfo]").each(function(e){jQuery(this).css("visibility","hidden")});d.parent().css("z-index",100);if(d.parent().next().length>0&&d.parent().next().attr("id").indexOf("_",0)!=-1){d.parent().next().css("z-index",100)}d.next().css("visibility","visible");if(this.params.type=="ETAPE"){return}this.openLignes(d.next())},zoomInStage:function(c){if(jQuery("#ul_itidetails").length==0){return false}var b=moviLib.findObj("ul_itidetails"),a=this.id.substring(2),d;if(isNaN(a)){if(a=="origine"){moviLib.removeClassFromBrothers(b.firstChild,"onit");moviLib.addClass(b.firstChild,"onit");handleDetails(c,b.firstChild);return}if(a=="destination"){moviLib.removeClassFromBrothers(b.firstChild,"onit");moviLib.addClass(b.firstChild,"onit");handleDetails(c,b.lastChild);return}return false}else{d=2*parseInt(a);moviLib.removeClassFromBrothers(b.childNodes[d],"onit");moviLib.addClass(b.childNodes[d],"onit");handleDetails(c,b.childNodes[d]);return}},openLignes:function(a){a.next().css({left:parseInt(a.css("left"),10),top:parseInt(a.css("top"),10)+a.height(),visibility:"visible"})},outOfPun:function(a){if(this.oConteneur.oInterface.timeOutId){clearTimeout(this.oConteneur.oInterface.timeOutId)}return},closeStation:function(a){a.stopPropagation();this.nomStation.css("visibility","hidden");this.nomStation.next().css("visibility","hidden");if(this.nomStation.parent().data("type")=="Desserte"&&this.nomStation.parent().css("z-index")==100){if(this.nomStation.prev().data("mode").toString().charAt(0)=="B"){this.nomStation.prev().css("z-index",95)}else{this.nomStation.prev().css("z-index",96)}}}};function Polygon(d,a,i,c,e,g,f,b){this.id="iso"+g;this.classe="isochrone";this.zindex="75";this.E=a;this.N=i;this.width=null;this.height=null;this.left=null;this.top=null;this.marge="100";this.visible=false;this.conteneur=d;this.oInterface=this.conteneur.oInterface;this.setDimensions(c,e);this.controlPoints=[];this.pointsSVG=this.convertCoords(b)||null;this.createPolygon()}Polygon.prototype={setDimensions:function(c,a){var b=this.oInterface.oConfig.resolution[this.conteneur.niveau];this.width=Math.ceil(c/b)+(2*this.marge);this.height=Math.ceil(a/b)+(2*this.marge);return},convertCoords:function(a){var c=this,b=this.oInterface.oConfig.resolution[this.conteneur.niveau];return jQuery.map(a.split(" "),function(g,f){var e,h,d,i;if(isNaN(g.charAt(0))&&g.charAt(0)!="-"){e=g.charAt(0);h=g.substr(1).split(",")}else{e="";h=g.split(",")}if(isNaN(h[0])||isNaN(h[1])){return g}switch(e.toUpperCase()){case"M":default:d=(h[0]-c.conteneur.xtl_img)/b;i=(c.conteneur.ytl_img-h[1])/b;break}if(f%3==1||f%3==2){c.controlPoints.push(d+","+i)}return e+Math.round(d)+","+Math.round(i)}).join(" ")},createPolygon:function(d){var b,l,k,h;if(jQuery("#"+this.id).length>0){b=jQuery("#"+this.id)}else{b=jQuery('<div id="'+this.id+'" class="'+this.classe+'"></div>').css("z-index",this.zindex);b.data("type","Polygon");this.conteneur.oHTML.append(b)}if(this.pointsSVG){l=Math.floor((this.E-this.conteneur.x_topleft)/this.oInterface.oConfig.resolution[this.conteneur.niveau])+this.conteneur.lstimg[0][0][0].offsetLeft;k=Math.floor((this.conteneur.y_topleft-this.N)/this.oInterface.oConfig.resolution[this.conteneur.niveau])+this.conteneur.lstimg[0][0][0].offsetTop;h=true;if(is_ie){if(typeof document.namespaces.v=="undefined"){document.namespaces.add("v","urn:schemas-microsoft-com:vml")}var n=(document.styleSheets.length>0)?document.styleSheets[0]:document.createStyleSheet(),c=["shape","fill","stroke"],j=c.length,p=jQuery.trim(this.pointsSVG),a,g,r=75,f;c=["shape","fill","stroke"];for(f=0;f<j;f++){n.addRule("v\\:"+c[f],"behavior: url(#default#VML); ")}p=p.replace(/M(-?[0-9]+\.?[0-9]+,-?[0-9]+\.?[0-9]+)/g,"m $1");p=p.replace(/C(-?[0-9]+\.?[0-9]+,-?[0-9]+\.?[0-9]+)/g,"c $1");a='<v:shape style="position:absolute;left:'+(l-this.marge)+"px;top:"+(k-this.marge)+"px;";if(!h||this.mode=="MAPD"){a+=" display:none;"}a+=" z-index:"+r+";width:"+this.width+"px;height:"+this.height+'px;" filled="false;" coordorigin="'+parseInt(l-this.marge)+","+parseInt(k-this.marge)+'"';a+=' coordsize="'+this.width+","+this.height+'" strokecolor="'+this.oInterface.oConfig.isochronesColor[this.id]+'" strokeweight="6px"';a+=' path="'+p+' e">';a+="</v:shape>";g='<v:shape style="position:absolute;left:'+(l-this.marge)+"px;top:"+(k-this.marge)+"px;";if(!h){g+=" display:none;"}g+=" z-index:"+(r-1)+";width:"+this.width+"px;height:"+this.height+'px;" filled="false;" coordorigin="'+parseInt(l-this.marge)+","+parseInt(k-this.marge)+'"';g+=' coordsize="'+this.width+","+this.height+'" strokecolor="#fff" strokeweight="8px"';g+=' path="'+p+' e">';g+="</v:shape>";b.append(a+g)}else{var o="http://www.w3.org/2000/svg",m=document.createElementNS(o,"svg"),q=document.createElementNS(o,"path"),e=document.createElementNS(o,"path");m.setAttribute("version","1.1");m.setAttribute("overflow","visible");m.style.position="absolute";m.style.left=l-this.marge+"px";m.style.top=k-this.marge+"px";m.style.zIndex=75;m.setAttribute("width",this.width+"px");m.setAttribute("height",this.height+"px");m.setAttribute("viewBox",(l-this.marge)+" "+(k-this.marge)+" "+this.width+" "+this.height);if(!h){m.style.display="none"}q.setAttribute("style","stroke:#fff;");q.setAttribute("stroke-width","8");q.setAttribute("d",this.pointsSVG);m.appendChild(q);e.setAttribute("style","stroke:"+this.oInterface.oConfig.isochronesColor[this.id]+";");e.setAttribute("stroke-width","6");e.setAttribute("d",this.pointsSVG);m.appendChild(e);b.append(m)}return}return}};function Segment(i,l,j,n,c,m,a,f,e,d,k,g,b){g=g||"./images/lignes/_";this.id_div=m;this.classe="ligne";this.E=l;this.N=j;if(g){this.src=g+a.toLowerCase()+"/"+a+"_"+encodeURIComponent(m)+"_"+l+"_"+j+"_"+f+"_"+e+".png"}this.width=null;this.height=null;this.left=null;this.top=null;this.visible=false;this.conteneur=i;this.oInterface=this.conteneur.oInterface;this.mode=d;this.marge=k;(this.mode=="B")?this.zindex=94:this.zindex=90;this.setDimensions(n,c);this.pathSVG=this.convertCoords(b)||null;this.createSegment()}Segment.prototype={setDimensions:function(c,a){var b=this.oInterface.oConfig.resolution[this.conteneur.niveau];this.width=Math.ceil(c/b)+(2*this.marge);this.height=Math.ceil(a/b)+(2*this.marge);return},convertCoords:function(c){var b=this,a=this.oInterface.oConfig.resolution[this.conteneur.niveau];return jQuery.map(c.split(" "),function(f){var e=f.charAt(0),g=f.substr(1).split(","),d,h;if(isNaN(g[0])||isNaN(g[1])){return f}d=Math.floor((g[0]-b.conteneur.xtl_img)/a);h=Math.floor((b.conteneur.ytl_img-g[1])/a);return e+d+","+h}).join(" ")},createSegment:function(g){var h,m,k,o,s,p=true;if(jQuery("#"+this.id_div).length>0){h=jQuery("#"+this.id_div)}else{h=jQuery('<div id="'+this.id_div+'" class="'+this.classe+'"></div>').css("z-index",this.zindex);h.data("type","Ligne");h.data("mode",this.mode);this.conteneur.oHTML.append(h)}if(this.pathSVG){m=Math.floor((this.E-this.conteneur.x_topleft)/this.oInterface.oConfig.resolution[this.conteneur.niveau])+this.conteneur.lstimg[0][0][0].offsetLeft;k=Math.floor((this.conteneur.y_topleft-this.N)/this.oInterface.oConfig.resolution[this.conteneur.niveau])+this.conteneur.lstimg[0][0][0].offsetTop;switch(this.mode){case"W":o="2px";s="6px";break;case"R":o="9px";s="11px";break;case"MAP":o="0px";s="6px";break;case"MAPD":o="0px";s="10px";break;default:o=this.oInterface.oConfig.vectorLineWidth[this.conteneur.niveau]+"px";s=this.oInterface.oConfig.vectorBorderWidth[this.conteneur.niveau]+"px";break}if(jQuery.inArray(this.mode,jQuery.keys(this.oInterface.oConfig.levelMax))!=-1){if(this.conteneur.niveau.charCodeAt(0)>this.oInterface.oConfig.levelMax[this.mode].charCodeAt(0)){p=false}}if(jQuery.inArray(this.mode,jQuery.keys(this.oInterface.oConfig.levelMin))!=-1){if(this.conteneur.niveau.charCodeAt(0)<this.oInterface.oConfig.levelMin[this.mode].charCodeAt(0)){p=false}}if(is_ie){if(typeof document.namespaces.v=="undefined"){document.namespaces.add("v","urn:schemas-microsoft-com:vml")}var c=(document.styleSheets.length>0)?document.styleSheets[0]:document.createStyleSheet(),n=["shape","stroke","fill"],r=n.length,t=jQuery.trim(this.pathSVG),b,a,f=85,q;for(q=0;q<r;q++){c.addRule("v\\:"+n[q],"behavior: url(#default#VML);")}t=t.replace(/L/g," ");t=t.replace(/M(-?[0-9]+,-?[0-9]+)/g,"m $1 l");b='<v:shape style="position:absolute;left:'+(m-this.marge)+"px;top:"+(k-this.marge)+"px;";if(!p||this.mode=="MAPD"){b+=" display:none;"}if(this.mode.substr(0,3)=="MAP"){f=87}b+=" z-index:"+f+";width:"+this.width+"px;height:"+this.height+'px;" filled="false;" coordorigin="'+parseInt(m-this.marge)+","+parseInt(k-this.marge)+'"';b+=' coordsize="'+this.width+","+this.height+'" strokecolor="'+this.oInterface.oConfig.vectorLineColor[this.mode]+'" strokeweight="'+o+'"';b+=' path="'+t+' e">';if(this.mode=="MAPD"){b+='<v:stroke dashStyle="1 1" endcap="round" ></v:stroke>'}else{if(this.mode=="MAP"){b+='<v:stroke opacity="0.5" ></v:stroke>'}}b+="</v:shape>";a='<v:shape style="position:absolute;left:'+(m-this.marge)+"px;top:"+(k-this.marge)+"px;";if(!p){a+=" display:none;"}a+=" z-index:"+(f-1)+";width:"+this.width+"px;height:"+this.height+'px;" filled="false;" coordorigin="'+parseInt(m-this.marge)+","+parseInt(k-this.marge)+'"';a+=' coordsize="'+this.width+","+this.height+'" strokecolor="'+this.oInterface.oConfig.vectorBorderColor[this.mode]+'" strokeweight="'+s+'"';a+=' path="'+t+' e">';if(this.mode=="MAPD"){a+='<v:stroke dashStyle="1 1" endcap="round" ></v:stroke>'}else{if(this.mode=="MAP"){a+='<v:stroke opacity="0.5" ></v:stroke>'}}a+="</v:shape>";h.append(b+a)}else{var e="http://www.w3.org/2000/svg",l=document.createElementNS(e,"svg"),d=document.createElementNS(e,"path"),j=document.createElementNS(e,"path");l.setAttribute("version","1.1");l.setAttribute("overflow","visible");l.style.position="absolute";l.style.left=m-this.marge+"px";l.style.top=k-this.marge+"px";l.style.zIndex=85;l.setAttribute("width",this.width+"px");l.setAttribute("height",this.height+"px");l.setAttribute("viewBox",(m-this.marge)+" "+(k-this.marge)+" "+this.width+" "+this.height);if(!p){l.style.display="none"}d.setAttribute("stroke-width",s);d.setAttribute("class",this.mode.toLowerCase()+"Border");d.setAttribute("d",this.pathSVG);l.appendChild(d);j.setAttribute("stroke-width",o);j.setAttribute("class",this.mode.toLowerCase()+"Stroke");j.setAttribute("d",this.pathSVG);l.appendChild(j);h.append(l)}return}return}};function Itineraire(a){this.oConteneur=a;this.panel=null;this.trajet=null;this.parcours=null;this.connexions=null;this.selected=0;this.listeResume=null;this.listeDetails=null;this.details=[];this.origine=null;this.destination=null;this.modeswitcher=null;this.cacheid=null;this.init()}Itineraire.prototype={init:function(){this.panel=jQuery("#cetp");this.itineraireDetails();this.modeSwitcher();return},modeSwitcher:function(){if(this.oConteneur.oInterface.oConfig.modeSwitcher===false){return}if(jQuery("#modeswitcher").length!=0){return}var a=this;this.modeswitcher=jQuery('<div id="modeswitcher"></div>').hover(function(){jQuery(this).css("background-position","0 -30px")},function(){jQuery(this).css("background-position","0 0")}).css({top:parseInt(this.oConteneur.oMask.css("top"))+5,left:parseInt(this.oConteneur.oMask.css("left"))+35}).click(function(){jQuery(this).remove();a.oConteneur.switchMode("POINTDARRET")});this.oConteneur.oInterface.oHTML.append(this.modeswitcher)},setOrigineDestination:function(){this.origine={id:jQuery("#p_origine").attr("id"),E:jQuery("#p_origine").data("E"),N:jQuery("#p_origine").data("N"),"street-address":jQuery("#p_origine").data("street-address"),locality:jQuery("#p_origine").data("locality"),"postal-code":jQuery("#p_origine").data("postal-code")}||null;this.destination={id:jQuery("#p_destination").attr("id"),E:jQuery("#p_destination").data("E"),N:jQuery("#p_destination").data("N"),"street-address":jQuery("#p_destination").data("street-address"),locality:jQuery("#p_destination").data("locality"),"postal-code":jQuery("#p_destination").data("postal-code")}||null},itineraireDetails:function(b){if(jQuery("#itiOverview").length==0){return false}if(jQuery("#ul_itidetails").length==0){return false}b=b||this.oConteneur;var a=this,c;b.oInterface.defaultPanel();jQuery("#itiRetour h2.collapsible").click(function(d){d.preventDefault();jQuery(this).next().slideToggle()});this.setHeight(b);this.trajet=jQuery("#itiOverview").attr("trajet").split(",");this.parcours=jQuery("#itiOverview").attr("parcours").split(",");if(jQuery("#roadmapSend").length!=0){jQuery("#roadmapSend").click(function(f){var g=this,e={},d={};f.preventDefault();b.oHTML.append(jQuery('<div id="sendMailTo"><form id="sendMail"><fieldset><label for="emailfrom">'+locales[b.oInterface.lang]["sendFrom"]+' :*</label><input type="text" title="'+locales[b.oInterface.lang]["remplirChamp"]+'" name="emailfrom" id="emailfrom" value="" class="text ui-widget-content ui-corner-all required"/><p class="extra"><input type="checkbox" name="copyfrom" id="copyfrom" checked="checked" class="ui-widget-content ui-corner-all"/><label for="copyfrom">'+locales[b.oInterface.lang]["sendCopyFrom"]+'</label></p><label for="emailto">'+locales[b.oInterface.lang]["sendTo"]+' :*</label><input type="text" title="'+locales[b.oInterface.lang]["remplirChamp"]+'" name="emailto" id="emailto" value="" class="text ui-widget-content ui-corner-all required"/><p class="extra">'+locales[b.oInterface.lang]["sendMultiple"]+'</p><label for="comment">'+locales[b.oInterface.lang]["sendComment"]+' :</label><textarea class="text ui-corner-all" name="comment" id="comment" rows="5"  cols="15" ></textarea><span class="required infos">'+locales[b.oInterface.lang]["sendRequiredField"]+"</span></fieldset></form></div>").hide());e[locales[b.oInterface.lang]["fermer"]]=function(){jQuery(this).dialog("close")};d[locales[b.oInterface.lang]["sendSend"]]=function(){var h,i;h=new VerificationFormulaire(jQuery("form",this),{messageBefore:true,validation:function(){var j=h.checkRegexp(jQuery("#emailfrom"),/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,locales[b.oInterface.lang]["sendMailInvalid"]),k=h.checkRegexp(jQuery("#emailto"),/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,locales[b.oInterface.lang]["sendMailInvalid"]);return j&&k}});if(h.checkForm()){i="lang="+b.oInterface.lang;i+="&start="+a.origine["street-address"]+":"+a.origine.locality+":"+a.origine["postal-code"];i+="&end="+a.destination["street-address"]+":"+a.destination.locality+":"+a.destination["postal-code"];i+="&cacheid="+a.cacheid;i+="&url="+encodeURI(g.href.substring(g.href.lastIndexOf("http:")));i+="&emailfrom="+jQuery("#emailfrom").val();i+="&emailto="+jQuery("#emailto").val();i+="&copyfrom="+jQuery("#copyfrom").val();if(jQuery("#comment").val().length>0){i+="&comment="+jQuery("#comment").val()}b.oInterface.sendData(i,"./gen_include/sendmail.php","POST",jQuery(this),function(){jQuery("#sendMailTo").dialog("option","buttons",e)})}};d[locales[b.oInterface.lang]["sendCancel"]]=function(){jQuery(this).dialog("close")};jQuery("#sendMailTo").dialog({modal:"true",title:locales[b.oInterface.lang]["sendTitle"],buttons:d,close:function(h,i){jQuery(this).remove()}})})}if(jQuery("#autoprint").length==0){c=jQuery("#itiActions a:last-child").clone(false);c.text(locales[this.oConteneur.oInterface.lang]["imprimer"]).attr({id:"autoprint",href:"javascript:void(0)",title:locales[this.oConteneur.oInterface.lang]["imprimer_title"]}).click(function(d){d.preventDefault();window.print()});jQuery("#itiActions").append(c)}jQuery('<ul id="roadmapActions"><li><a id="globalMap" href="javascript:void(0)">Parcours global</a></li></ul>').insertBefore(jQuery("div.resume"));jQuery("#globalMap").click(function(d){a.handleDetails(d,jQuery("#itiOverview").get(0))});return},handleDetails:function(h,d){if(!d.getAttribute){return}jQuery("tr:not(.row1)",d.parentNode).addClass("hide");jQuery("tr:not(.row1)",d).removeClass("hide");if(d.getAttribute("level")){if(d.getAttribute("level")==this.oConteneur.niveau&&d.getAttribute("xcenter")==jQuery("#p_center").data("E")&&d.getAttribute("ycenter")==jQuery("#p_center").data("N")){return}var a=this.origine.E+":"+this.origine.N+":"+this.origine["street-address"]+":"+this.origine.locality+":"+this.origine["postal-code"],f=this.destination.E+":"+this.destination.N+":"+this.destination["street-address"]+":"+this.destination.locality+":"+this.destination["postal-code"],i=this.cacheid,c=this.oConteneur.niveau,b,j,g;this.oConteneur.oInterface.oHTML.show();this.oConteneur.removeEle();this.oConteneur.reInitImg();this.oConteneur.centerAt(d.getAttribute("xcenter"),d.getAttribute("ycenter"),d.getAttribute("level"));this.oConteneur.reloadInterface();if(this.oConteneur.niveau!=c){this.oConteneur.oInterface.aP=[];this.oConteneur.oInterface.aL[this.oConteneur.niveau]=this.oConteneur.oInterface.aL[c];this.oConteneur.oInterface.aL[c]=[]}this.modeSwitcher();b=this.oConteneur.dimVisCarte.width==0?this.oConteneur.oInterface.oConfig.width:this.oConteneur.dimVisCarte.width;j=this.oConteneur.dimVisCarte.height==0?this.oConteneur.oInterface.oConfig.height:this.oConteneur.dimVisCarte.height;g="xcenter="+d.getAttribute("xcenter")+"&ycenter="+d.getAttribute("ycenter")+"&level="+d.getAttribute("level")+"&L="+b+"&H="+j+"&trajet="+this.trajet+"&typeParcours=ETAPE";if(this.origine&&this.destination){g+="&origine="+a+"&destination="+f}if(i){g+="&cacheid="+i}if(this.parcours){g+="&parcours="+this.parcours.join(",")}if(this.oConteneur.modeCarte!="ITINERAIRE"){g+="&liens=yes"}this.oConteneur.oInterface.sendData(g,"./gen_include/itimap.php","POST");return}else{if(d.parentNode.getAttribute("x")&&d.parentNode.getAttribute("y")){this.oConteneur.zoomAt(d.parentNode.getAttribute("x"),d.parentNode.getAttribute("y"),"A")}}return},setHeight:function(a){a=a||this.oConteneur;this.listeDetails=jQuery("#ul_itidetails");this.listeDetails.height(a.oInterface.pageSize.height-this.listeDetails.offset().top-80);return},show:function(b,h,g,f,e){if(this.oConteneur.oInterface.aL[this.oConteneur.niveau]){var c,a,d;for(d=0;d<this.oConteneur.oInterface.aL[this.oConteneur.niveau].length;d++){c=this.oConteneur.oInterface.aL[this.oConteneur.niveau][d].split("_");a=c[6];new Segment(this.oConteneur,c[0],c[1],c[3],c[4],c[5],c[7],c[8],c[9],c[10],a,"./images/iti/_")}}},showSVG:function(a,g,f,e,d){if(this.oConteneur.oInterface.aL[this.oConteneur.niveau]){var c=this,b;jQuery.map(this.oConteneur.oInterface.aL[this.oConteneur.niveau],function(h){b=h.split("_");new Segment(c.oConteneur,b[0],b[1],b[3],b[4],b[5],b[7],b[8],b[9],b[10],b[6],null,b[11])})}},getFromTo:function(b){if(jQuery("#"+b).length==0){return}var a=this;this.details=[];jQuery("td.parcours .from, td.parcours .to",jQuery("li[level="+this.oConteneur.niveau+"]",jQuery("#"+b)).filter(".onit").filter(":not(.pieton)")).each(function(c){a.details.push(jQuery(this).attr("id").replace(/^_/,""))});return}};function handleWheel(a){if(cart.niveau==this.oInterface.oConfig.lastNiv){return}if(a<0){cart.appliZoom("moins")}else{cart.appliZoom("plus")}}function wheel(a){var b=0;if(!a){a=window.event}if(a.wheelDelta){b=a.wheelDelta/120;if(window.opera){b=-b}}else{if(a.detail){b=-a.detail/3}}if(b){handleWheel(b)}if(a.preventDefault){a.preventDefault()}a.returnValue=false};