var is_ie=(function(){var c,a=3,d=document.createElement("div"),b=d.getElementsByTagName("i");while(d.innerHTML="<!--[if gt IE "+(++a)+"]><i></i><![endif]-->",b[0]){}return a>4?a:c}());if(typeof jQuery=="function"){jQuery.support.canvas=(function(){var a=document.createElement("canvas");return !!(a.getContext&&a.getContext("2d"))})();jQuery.support.svg=(function(){return !!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect})();
/*
 * global.js
 */
}document.documentElement.className+=" js";if(is_ie===6){document.documentElement.setAttribute("xmlns:v","urn:schemas-microsoft-com:vml")}window.moviLib=(function(f,e,a,g){var b={},d=["fr","en"],c=a.baseURI||(a.getElementsByTagName("BASE")[0]||a.baseURI)?a.baseURI||a.getElementsByTagName("BASE")[0].href:"http://preprod.itransports.fr/";b.getLanguageFromUrl=function(){var h,j;if(unescape(e.location.search.substr(1)).indexOf("&")!=-1){h=unescape(e.location.search.substr(1)).split("&");$_GET=new Array();for(j=0;j<h.length;j++){$_GET[h[j].substring(0,h[j].indexOf("="))]=h[j].substr(h[j].indexOf("=")+1)}return $_GET.lang||"fr"}else{h=unescape(e.location.href.substr(c.length)).split("/");return(f.inArray(h[0],d)!=-1)?d[f.inArray(h[0],d)]:"fr"}};b.checkKeyOnInput=function(i){var h=i.target;if(h.nodeName&&(h.nodeName=="SELECT"||h.nodeName=="INPUT"||h.nodeName=="TEXTAREA")){return true}else{return false}};b.newWindowsForLink=function(m,l,k,j,i,h){if(f("a."+m).length==0){return}f("a."+m).live("click",function(n){if(((!f.browser.msie||(f.browser.msie&&parseInt(f.browser.version,10)>=8))&&n.button==0)||(f.browser.msie&&n.button==1)){n.preventDefault();b.nouvelleFenetre(this.href,this.target,l,k,j,i,h)}});return};b.nouvelleFenetre=function(i,j,h,k,m,n,o){var p="",l;o=o||Math.floor((f(e).height()-m)/2);n=n||Math.floor((f(e).width()-k)/2);if(h=="console"){p="resizable=yes,scrollbars=yes,status=yes,height="+m+",width="+k+",left="+n+",top="+o}if(h=="withMenu"){p="resizable=yes,scrollbars=yes,menubar=yes,status=yes,height="+m+",width="+k+",left="+n+",top="+o}if(h=="withTool"){p="resizable=yes,scrollbars=yes,status=yes,toolbar=yes,height="+m+",width="+k}if(h=="image"){p="resizable=yes,scrollbars=yes,status=yes,toolbar=yes,width="+k}l=e.open(i,f.trim(j.split(" ").join("_")),p);l.focus()};b.baseURL=c;return b})(jQuery,this,this.document);(function(a){a.extend({enleveAccent:function(f){var e="",d=f.length,c,b;for(c=0;c<d;c++){b=f.charAt(c);if((b=="à")||(b=="â")){b="a"}else{if(b=="ç"){b="c"}else{if((b=="é")||(b=="è")||(b=="ê")||(b=="ë")){b="e"}else{if((b=="ï")||(b=="î")){b="i"}else{if((b=="ö")||(b=="ô")){b="o"}else{if((b=="ü")||(b=="ù")||(b=="û")){b="u"}else{if(b==" "){b=""}}}}}}}e+=b}return e},stripslashes:function(b){return(b+"").replace("/\0/g","0").replace("/(.)/g","$1")},str_pad:function(f,g,e,d){var c=f,b;for(b=f.length;b<g;b++){d=d||"STR_PAD_LEFT";if(d=="STR_PAD_LEFT"){c=e+c}if(d=="STR_PAD_RIGHT"){c=c+e}}return c},array_fill:function(b,d,f){var e,c={};if(!isNaN(b)&&!isNaN(d)){for(e=0;e<d;e++){c[(e+b)]=f}}return c},isUrl:function(b){return/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([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])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(b)},keys:function(d){var b=[],c;for(c in d){b.push(c)}return b},values:function(d){var b=[],c;for(c in d){b.push(d[c])}return b}})})(jQuery);(function(a){a.extend(a.expr[":"],{data:function(f,g,d){var h=a(f).get(0),c,b;if(!d[3]){for(b in h){if((/jQuery\d+/).test(b)){return true}}}else{c=d[3].split("=");if(c[1]){if((/^\/.+\/([mig]+)?$/).test(c[1])){return(new RegExp(c[1].substr(1,c[1].lastIndexOf("/")-1),c[1].substr(c[1].lastIndexOf("/")+1))).test(a(f).data(c[0]))}else{return a(f).data(c[0])==c[1]}}else{if(a(f).data(c[0])){return true}else{a(f).removeData(c[0]);return false}}}return false}})})(jQuery);if(jQuery){(function(){jQuery.extend(jQuery.fn,{rightClick:function(b,a){a=a||null;jQuery(this).each(function(){jQuery(this).bind("mousedown.rightclick",function(d){var c=d;jQuery(this).bind("mouseup.rightclick",function(){jQuery(this).unbind("mouseup.rightclick");var e=jQuery(this);if(c.which==3){if(e.data("rightclicked")&&jQuery.isFunction(a)){clearTimeout(e.data("rcTimer"));e.data("rightclicked",false);c.type="rightdblclick";a.call(jQuery(this),c);return false}else{e.data("rightclicked",true);e.data("rcTimer",setTimeout((function(g,f){return function(){g.data("rightclicked",false);b.call(g,f)}})(e,c),800));return false}}else{return true}})});jQuery(this)[0].oncontextmenu=function(){return false}});return jQuery(this)},rightMouseDown:function(a){jQuery(this).each(function(){jQuery(this).bind("mousedown.rightmousedown",function(b){if(b.which==3){a.call(jQuery(this),b);return false}else{return true}});jQuery(this)[0].oncontextmenu=function(){return false}});return jQuery(this)},rightMouseUp:function(a){jQuery(this).each(function(){jQuery(this).bind("mouseup.rightmouseup",function(b){if(b.which==3){a.call(jQuery(this),b);return false}else{return true}});jQuery(this)[0].oncontextmenu=function(){return false}});return jQuery(this)},noContext:function(){jQuery(this).each(function(){jQuery(this)[0].oncontextmenu=function(){return false}});return jQuery(this)}})})(jQuery);
/*
 * jQuery UI Touch Punch 0.1.0
 *
 * Copyright 2010, Dave Furfero
 * Dual licensed under the MIT or GPL Version 2 licenses.
 *
 * Depends:
 *  jquery.ui.widget.js
 *  jquery.ui.mouse.js
 */
}(function(c){c.support.touch=typeof Touch==="object";if(!c.support.touch){return}var f=c.ui.mouse.prototype,g=f._mouseInit,a=f._mouseDown,e=f._mouseUp,b={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup"};function d(h){var i=h.originalEvent.changedTouches[0];return c.extend(h,{type:b[h.type],which:1,pageX:i.pageX,pageY:i.pageY,screenX:i.screenX,screenY:i.screenY,clientX:i.clientX,clientY:i.clientY})}f._mouseInit=function(){var h=this;h.element.bind("touchstart."+h.widgetName,function(i){return h._mouseDown(d(i))});g.call(h)};f._mouseDown=function(j){var h=this,i=a.call(h,j);h._touchMoveDelegate=function(k){return h._mouseMove(d(k))};h._touchEndDelegate=function(k){return h._mouseUp(d(k))};c(document).bind("touchmove."+h.widgetName,h._touchMoveDelegate).bind("touchend."+h.widgetName,h._touchEndDelegate);return i};f._mouseUp=function(i){var h=this;c(document).unbind("touchmove."+h.widgetName,h._touchMoveDelegate).unbind("touchend."+h.widgetName,h._touchEndDelegate);return e.call(h,i)}})(jQuery);
/*
 * itmaps_i18n.js
 * 	localization content for itmaps
 *
 */
var locales={fr:{lienLegende:"Légende",titreLienLegende:"Afficher la légende des cartes",lienNavigation:"Plus",titreLienNavigation:"Afficher les principes de navigation dans les cartes",lstMode:{B:"Bus",C:"Car",M:"Métro",T:"Train",W:"Tram",R:"RER",F:"Funiculaire",O:"Bateau",A:"Avion"},fermer:"Fermer",ouvrir:"Ouvrir",zoommoins:"zoom arrière",zoomplus:"zoom avant",nameLevel:{A:"Rue",B:"Quartier",C:"Secteur",D:"Ville",E:"Agglomération",F:"Aire urbaine",G:"Bassin",H:"Département",I:"Région",J:"Pays"},ligne:"ligne",titreCheckBoxes:"Modes de transport",imprimer:"Imprimer",imprimer_title:"Imprimer la feuille de route",voir_plan:"Voir à proximité",starthere:"Partir de là",endhere:"Arriver ici",centerhere:"Centrer la carte",infosLignes:"Informations sur la ",infosAmplitude:"Fonctionne de ",infosAmp_a:" à ",infosLignesReseau:" du réseau ",infosFrequence1:"Fréquence heures de pointe :",infosFrequence2:"Fréquence heures creuses :",infosAllerRetour:"Nb Aller/Retour :",infosSamedi:"Circule le samedi",infosDimanche:"Circule le dimanche",infosTerminus:"Terminus :",infosCorrespondance:"Correspondance :",exportPDF:"Exporter en PDF",adresse:"Adresse",gare:"Gare/Station",selectChoisir:"Choisir ...",remplirChamp:"Veuillez remplir ce champ",remplirUnChamp:"Veuillez remplir au moins un champ pour effectuer une recherche.",remplirVilleCP:"Veuillez renseigner le nom de la commune ou le code postal de l'adresse que vous recherchez.",helpFinding:"Lancer la recherche assistée",modifier:"Modifier",itiDepart:"Départ",itiArrivee:"Arrivée",sendFrom:"De",sendCopyFrom:"M'envoyer une copie",sendTo:"À",sendMultiple:"Séparer les adresses par des virgules",sendComment:"Message",sendTitle:"Envoyer la feuille de route",sendCancel:"Annuler",sendSend:"Envoyer",sendMailInvalid:"Adresse email incorrecte",sendRequiredField:"* champs requis",hor_seedetails:"Voir le détail",hor_hidedetails:"Masquer le détail",hor_loading:"Chargement ...",daysOfWeek:"Dim Lun Mar Mer Jeu Ven Sam",months:"Janvier Février Mars Avril Mai Juin Juillet Août Septembre Octobre Novembre Décembre",today:"Aujourd'hui: ",p_origine:"Départ",p_destination:"Arrivée",titreinstr:"Conseils pour bien naviguer",zoomIn:"Voir le plan de quartier",fullWindow:"Pleine page",fullWindowTitle:"Carte en pleine page",nofullWindow:"Taille normale",nofullWindowTitle:"Revenir à la taille initiale",locateMe:"Me localiser",locateMeTitle:"Me localiser sur la carte",loading:"Vérification en cours ...",entiredir:"Parcours global",examples:{adresse:["Ex. : 21, avenue Victor Hugo","0:1:1","* un champ au moins est obligatoire."],gare:["Ex. : Lyon-Perrache ou Montparnasse","0:0:0",""],station:["Ex. : République","1:0:0","* champs obligatoire."]},labels:{adresse:"Adresse",gare:"Gare",station:"Station"},lstinstr:{"Survol d'un point":"Le survol d'un point d'arrêt ouvre un menu avec les lignes qui le desservent","Clic sur le nom d'une ligne":"En cliquant dans le menu, faites apparaître les lignes de votre choix","Déplacer la carte":"Naviguer en emmenant la carte"},pois:{open:"Horaires :",coord:"Adresse :",tel:"",web:"Site web : "},modes:{train:"train",RER:"RER",metro:"métro",tramway:"tramway",autocar:"car",bus:"bus",bateau:"bateau",funi:"funiculaire"},rodloading:"Recherche d'itinéraires en transport en commun en cours ...",noresult:"Aucun résultat pour votre recherche.",directions:{retour:"Itinéraire retour",changement:"changement",changements:"changements",connection:"Correspondance",marche:"de marche",go_to:"Aller jusqu'à",attente:"Attente",duree:"Durée",prendre:"Prendre le ",reseau:"Réseau",direction:"Direction"},co2:{intro:"<strong>Les émissions de CO<sub>2</sub></strong> pour cet itinéraire sont estimées à :",co2:" <strong>de CO<sub>2</sub></strong>",transports:"<strong>Transports en commun : </strong>",driving:"Voiture : "},suffixDuration:{days:"j",hours:"h",minutes:"min"}},en:{lienLegende:"Legend",titreLienLegende:"Display the legend",lienNavigation:"More",titreLienNavigation:"Display the principle of navigation",lstMode:{B:"Bus",C:"Car",M:"Subway",T:"Train",W:"Tram",R:"RER",F:"Funicular",O:"Boat",A:"Plane"},fermer:"Close",ouvrir:"Open",zoommoins:"zoom out",zoomplus:"zoom in",nameLevel:{A:"Street",B:"District",C:"",D:"City",E:"",F:"Urban area",G:"",H:"",I:"Region",J:"State"},ligne:"line",titreCheckBoxes:"Means of Transport",imprimer:"Print",imprimer_title:"Print",voir_plan:"See closeness",starthere:"Start here",endhere:"End here",centerhere:"Center the map",infosLignes:"Informations on ",infosLignesReseau:" of the network ",infosAmplitude:"Running hours ",infosAmp_a:" to ",infosFrequence1:"Rush hour :",infosFrequence2:"Lowest hourly traffic :",infosAllerRetour:"Number of round trip :",infosSamedi:"Operated on Saturday",infosDimanche:"Operated on Sunday",infosTerminus:"Terminus :",infosCorrespondance:"Connection :",exportPDF:"PDF Export",adresse:"Address",gare:"Station",selectChoisir:"Choose ...",remplirChamp:"This field can't be empty.",remplirUnChamp:"Please fill at least one field to proceed.",remplirVilleCP:"Please enter a city or a zipcode to search a postal address.",helpFinding:"Proceed",modifier:"Edit",itiDepart:"Start",itiArrivee:"End",sendFrom:"From",sendCopyFrom:"Send a copy",sendTo:"To",sendMultiple:"Separate emails with commas",sendComment:"Message",sendTitle:"Sending the roadmap",sendCancel:"Cancel",sendSend:"Send",sendMailInvalid:"Invalid email",sendRequiredField:"* required fields",hor_seedetails:"See details",hor_hidedetails:"Hide details",hor_loading:"Loading ...",daysOfWeek:"Sun Mon Tue Wed Thu Fri Sat",months:"January February March April May June July August September October November December",today:"Today is: ",p_origine:"Departure",p_destination:"Arrival",titreinstr:"Helpful tips",zoomIn:"Voir le plan de quartier",fullWindow:"Fullwindow",fullWindowTitle:"View in full window",locateMe:"Locate me",locateMeTitle:"Locate me on the map",nofullWindow:"Normal view",nofullWindowTitle:"Back to normal view",loading:"Loading ...",entiredir:"See entire",examples:{adresse:["Ex. : 21, avenue Victor Hugo","0:1:1","* at least one field is required."],gare:["Ex. : Lyon-Perrache ou Montparnasse","0:0:0",""],station:["Ex. : République","1:0:0","* required field."]},labels:{adresse:"Address",gare:"Station",station:"Stop point"},lstinstr:{"Survol d'un point":"The mouse over a station opens a menu with the lines which service it","Clic sur le nom d'une ligne":"A mouse click in the menu displays the lines you choose","Déplacer la carte":"Drag the map to navigate"},pois:{open:"Open hours :",coord:"Address :",tel:"Tel : ",web:"Website : "},modes:{train:"train",RER:"RER",metro:"métro",tramway:"tramway",autocar:"car",bus:"bus",bateau:"bateau",funi:"funiculaire"},rodloading:"Calculating routes ...",noresult:"No result for your request.",directions:{retour:"Return journey",changement:"connection",changements:"connections",connection:"Connection",marche:"walk",go_to:"Go to",attente:"Wait times",duree:"Duration",prendre:"Take ",reseau:"Network",direction:"Towards"},co2:{intro:"<strong>Les émissions de CO<sub>2</sub></strong> pour cet itinéraire sont estimées à :",co2:" <strong>de CO<sub>2</sub></strong>",transports:"<strong>Transports en commun : </strong>",driving:"Voiture : "},suffixDuration:{days:"d",hours:"h",minutes:"min"}},de:{lienLegende:"Bildunterschrift",titreLienLegende:"Die Bildunterschrift darstellen",lienNavigation:"Mehr",titreLienNavigation:"Die Browsingsprinzipien anzeigen",lstMode:{B:"Bus",C:"Car",M:"U-Bahn",T:"Zug",W:"Straßenbahn",R:"S-Bahn",F:"Seilbahn"},ligne:"",titreCheckBoxes:"Verkehrsmittel",infosLignes:"Informationen ûber ",infosLignesReseau:" des Netz ",infosAmplitude:"Funktioniert von ",infosAmp_a:" bis ",infosFrequence1:"Spitzenzeiten :",infosFrequence2:"verkehrsschwache Zeiten :",infosAllerRetour:"Anzahl Hin- und Rückfahrten :",infosSamedi:"Verkehrt am Samstag",infosDimanche:"Verkehrt am Sonntag",infosTerminus:"Terminus :",infosCorrespondance:"Verbindung :",exportPDF:"PDF Export",selectChoisir:"Auswählen ...",remplirChamp:"This field can't be empty.",daysOfWeek:"Son Mon Die Mit Don Fre Sam",months:"Januar Februar März April Mai Juni Juli August September Oktober November Dezember",today:"Heute: ",p_origine:"Departure",p_destination:"Arrival",titreinstr:"Helpful tips",zoomIn:"Voir le plan de quartier",lstinstr:{"Survol d'un point":"The mouse over a station opens a menu with the lines which service it","Clic sur le nom d'une ligne":"A mouse click in the menu displays the lines you choose","Déplacer la carte":"Drag the map to navigate"}}};
/*
 *
 *	itmaps.js
 *
 */
(function(d,c,a,e){var b=function(){this.defaults={actions:["fullwindow","locateme"],layout:"fluid",panel:"menugauche",parent:"body",footer:"pied",lat_def:47.040182,long_def:2.5708,defaultLevel:6,topContainer:0,leftContainer:0,top:0,left:0,width:null,height:null,tileWidth:256,tileHeight:256,firstNiv:0,lastNiv:17,scaleWidth:100,minLatitude:-85.05112878,maxLatitude:85.05112878,minLongitude:-180,maxLongitude:180,bordure:0,actionsOnMarkers:true,iconInfoLine:true,imagesPath:"http://img.itransports.fr/",stopPointPath:"http://img.itransports.fr/arrets/",poisPointPath:"http://img.itransports.fr/images/poi/",tileRefPath:"http://t0.itransports.fr/",tileNbUrls:4,tileLinesPath:"_transport/",tileModes:{B:{zIndex:"6",name:"Bus"},W:{zIndex:"7",name:"Tramway"},M:{zIndex:"8",name:"Metro"}},tileSuffix:".png",lstChk:["R","M","W","B","C","O","F"],classeNom:{A:"arretavion",O:"arretbateau",B:"arretbus",C:"arretcar",M:"arretmetro",W:"arrettram",R:"arretrer",T:"arrettrain",P:"arretpole",F:"arretfuni"},maxBoxesLevel:12,maxCopyrightLevel:10,maxPointsLevel:9,levelMax:{A:2,B:5,M:5,W:5,R:5,T:5,F:5,O:5,W:5},levelMin:{},vectorLineWidth:{normal:"3",thick:"5"},vectorBorderWidth:{normal:"5",thick:"7"},vectorLineColor:{A:"#bc8cff",O:"#4fdbff",B:"#2ae700",C:"#02ded6",W:"#fff",M:"#FF0000",R:"#9619d6",F:"#dcaf27",T:"#9619d6",PEDESTRIAN:"#ed7f06",PEDESTRIAND:"#ed7f06"},vectorBorderColor:{A:"#bc8cff",O:"#4fdbff",B:"#000",C:"#000",W:"#e51ae3",M:"#000",R:"#000",F:"#000",T:"#000",PEDESTRIAN:"#ed7f06",PEDESTRIAND:"#ed7f06"},vectorThickMinLevel:12,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",levelControl:"normal",modesFilter:true,modeSwitcher:false,exportPDF:false,requestTC:true,nonTCModes:["PEDESTRIAN","BIKE","DRIVING","MAP"],hiddenOnStart:false,segmentTag:"li",modeROD:false,rootUrl:moviLib.baseURL+"gen_include/",RODUrl:"http://api.itransports.fr/itineraires/",ajaxParams:{method:"POST",type:"json"},ZINDEX:{CENTER:90,DEFAULT:85,INFOBOX_DEFAULT:91,ARRETBUS:95,POI:95,ARRET:96,ARRET_LINE_DISPLAYED:99,ETAPE:100,FAKE_HOVER:100,HOVER:101,INFOBOX_ARRET:101,INFOBOX_POI:110}};this.iphone={top:0,left:0,width:320,height:362,tileLinesPath:null,stopPointPath:"http://img.itransports.fr/arrets/",resizeEvent:"orientationchange",requestTC:false,modesFilter:false,modeSwitcher:false,exportPDF:false,scale:1,panel:null,actions:["locateme"],callback:function(){itMap.oInterface.oHTML.bind("touchmove",function(f){f.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=d.extend({},this.defaults,this[this.params.device]);if(this.oConfig.rootUrl.split(/\/+/g)[1]!=a.domain||this.oConfig.RODUrl.split(/\/+/g)[1]!=a.domain){this.oConfig.ajaxParams={method:"GET",type:"jsonp"};this.params.modeSwitcher=false;this.oConfig.exportPDF=false}this.params.callback=typeof this.params.callback=="undefined"?this.oConfig.callback:this.params.callback;this.params.height=typeof this.params.height=="undefined"?this.oConfig.height:this.params.height;this.params.hiddenOnStart=typeof this.params.hiddenOnStart=="undefined"?this.oConfig.hiddenOnStart:this.params.hiddenOnStart;this.params.lang=typeof this.params.lang=="undefined"?null:this.params.lang;this.params.latitude=typeof this.params.latitude=="undefined"?this.oConfig.lat_def:this.params.latitude;this.params.layout=typeof this.params.layout=="undefined"?this.oConfig.layout:this.params.layout;this.params.left=typeof this.params.left=="undefined"?this.oConfig.left:this.params.left;this.params.level=typeof this.params.level=="undefined"?this.oConfig.defaultLevel:this.params.level;this.params.levelControl=typeof this.params.levelControl=="undefined"?this.oConfig.levelControl:this.params.levelControl;this.params.longitude=typeof this.params.longitude=="undefined"?this.oConfig.long_def:this.params.longitude;this.params.lstChk=typeof this.params.lstChk=="undefined"?this.oConfig.lstChk:this.params.lstChk;this.params.maxBoxesLevel=typeof this.params.maxBoxesLevel=="undefined"?this.oConfig.maxBoxesLevel:this.params.maxBoxesLevel;this.params.modesFilter=typeof this.params.modesFilter=="undefined"?this.oConfig.modesFilter:this.params.modesFilter;this.params.modeROD=typeof this.params.modeROD=="undefined"?this.oConfig.modeROD:this.params.modeROD;this.params.modeSwitcher=typeof this.params.modeSwitcher=="undefined"?this.oConfig.modeSwitcher:this.params.modeSwitcher;this.params.panel=typeof this.params.panel=="undefined"?this.oConfig.panel:this.params.panel;this.params.parent=typeof this.params.parent=="undefined"?this.oConfig.parent:this.params.parent;this.params.requestTC=typeof this.params.requestTC=="undefined"?this.oConfig.requestTC:this.params.requestTC;this.params.segmentTag=typeof this.params.segmentTag=="undefined"?this.oConfig.segmentTag:this.params.segmentTag;this.params.stoppoints=typeof this.params.stoppoints=="undefined"?null:this.params.stoppoints;this.params.top=typeof this.params.top=="undefined"?this.oConfig.top:this.params.top;this.params.width=typeof this.params.width=="undefined"?this.oConfig.width:this.params.width;this.oConfig.actions=typeof this.params.actions=="undefined"?this.oConfig.actions:d.merge(this.oConfig.actions,this.params.actions);this.affLigne=[];this.aP=[];this.aL=[];this.lstgare=[];this.modeIn=this.modeSel=this.params.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=(!this.params.lang)?moviLib.getLanguageFromUrl():this.params.lang;this.xhr=null;this.init(this.params.latitude,this.params.longitude,this.params.level)};b.prototype.init=function(i,g,h){if(typeof d!=="function"){alert("jQuery required");return}if(!d.isPlainObject(d.ui)){alert("jQuery UI required");return}if(this.params.panel){a.documentElement.style.overflow="hidden"}this.create();this.winWH();this.setPanelHeight();if(!this.cart){this.cart=new b.Carte(this,i,g,h);if(this.params.stoppoints){this.sendData("aArrets="+this.params.stoppoints+"&level="+this.cart.niveau+"&L="+this.cart.dimVisCarte.width+"&H="+this.cart.dimVisCarte.height,this.oConfig.rootUrl+"inmap.php",this.oConfig.ajaxParams.method)}}else{this.cart.centerAt(i,g,h);this.cart.reSize()}(this.params.hiddenOnStart)?this.oHTML.hide():this.oHTML.show();var f=this;itMap=c.itMap=this.cart;if(is_ie){a.onselectstart=function(){return false}}a.dragstart=function(){return false};d(a).bind((d.browser.opera?"keypress":"keydown"),function(j){f.keyHandler(j)});d(c).error(function(){f.endLoading()});if(this.params.callback&&typeof this.params.callback==="function"){this.params.callback()}};b.prototype.create=function(){this.oHTML=d("<div></div>").attr("id",this.id).css({left:this.oConfig.leftContainer,top:this.oConfig.topContainer,"background-color":"#FCFEDC"});if(this.params.parent==="body"){d("body").append(this.oHTML);return}this.oHTML.css("position","relative");if(typeof this.params.parent==="string"){this.params.parent=d("#"+this.params.parent)}this.params.parent.append(this.oHTML);return};b.prototype.destroy=function(){d(a).bind((d.browser.opera?"keypress":"keydown"));d(c).unbind(this.oConfig.resizeEvent);this.oHTML.remove();itMap=c.itMap=null;return};b.prototype.winWH=function(){if(c.event&&c.event.type=="orientationchange"){switch(c.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}c.scrollTo(0,0)}else{var i,g,f,h;i=d(c).width();g=d(c).height();if(this.cart&&this.cart.fullscreen){f=i}else{f=(this.params.parent=="body")?d("body").outerWidth():parseInt(this.params.parent.css("width"),10)}h=(this.params.parent=="body")?g:d("body").outerHeight();if(!this.winSize){this.winSize=new b.dimensions(null,null,i,g)}else{this.winSize.width=i;this.winSize.height=g}if(!this.pageSize){this.pageSize=new b.dimensions(null,null,f,h)}else{this.pageSize.width=f;this.pageSize.height=h}}};b.prototype.fullScreen=function(){if(this.cart.oMask.offset().left===0&&this.cart.oMask.offset().top===0){d("html").removeClass("fullscreen");this.cart.fullscreen=false;this.cart.oMask.css({left:this.params.left,top:this.params.top});if(this.params.parent!="body"){this.oHTML.css("position","relative");this.params.parent.append(this.oHTML)}}else{d("html").addClass("fullscreen");d("html, body").scrollTop(0);this.cart.fullscreen=true;this.cart.oMask.css({left:0,top:0});this.oHTML.css("position","absolute");if(this.params.parent!="body"){d("body").append(this.oHTML)}}this.winSize=new b.dimensions(null,null,0,0);this.cart.reSize()};b.prototype.sendData=function(i,h,m,g,l){var f=this,k,j;if(!g){k=this.oConfig.ajaxParams.type;j=function(n){if(is_ie<9){if(f.cart.oHTML.children().length){if(d(".isochrone",this.oHTML).length>0){d(".isochrone",this.oHTML).each(function(o){d(this).remove()})}}}if(d.isEmptyObject(n)){return}if(n.coords&&!n.pdf){f.cart.zooming=true;f.cart.centerAt(n.coords[0],n.coords[1],n.coords[2])}if(n.boundary){f.cart.zoomToBoundary(new b.bounds(n.boundary.latmin,n.boundary.latmax,n.boundary.longmin,n.boundary.longmax))}if(n.modein){f.modeIn=n.modein}if(n.polygons){f.polygons=n.polygons}if(n.stages){f.aP=[];f.aP[f.cart.niveau]=n.stages;if(!f.cart.itineraire){f.cart.itineraire=new b.Itineraire(f.cart)}f.cart.itineraire.cacheid=n.cacheid||null;f.cart.addToLayer("Marker",n.stages)}if(n.directions){f.aL=[];f.aL[f.cart.niveau]=n.directions;f.cart.handleLines()}if(n.pdf&&n.coords){f.pdfhreflink="x_center="+n.coords[0]+"&y_center="+n.coords[1]+"&level=C&isocacheid=no&pointname="+n.pointname+"&client="+c.client}if(n.stoppoint){f.aP=[];f.aP[f.cart.niveau]=n.stoppoint;if(n.poi){d.merge(f.aP[f.cart.niveau],n.poi)}f.cart.setInformationLayer("POINTDARRET")}if(n.lines){if(f.aL[f.cart.niveau]&&f.aL[f.cart.niveau].length>0){d.merge(f.aL[f.cart.niveau],n.lines)}else{f.aL=[];f.aL[f.cart.niveau]=n.lines}f.cart.handleLines()}if(n.isocacheid&&n.coords){f.pdfhreflink="x_center="+n.coords[0]+"&y_center="+n.coords[1]+"&level=C&isocacheid="+n.isocacheid+"&pointname="+n.pointname+"&client="+c.client;f.cart.createPDF(d("#pdfLink a:first"),{href:"./iso/pdf/botanic_"+d.enleveAccent(n.pointname.toLowerCase())+".pdf"});f.cart.setInformationLayer()}if(f.polygons){f.cart.drawPolygon(f.polygons)}if(n.markers){f.cart.addToLayer("Marker",n.markers)}if(l&&typeof l==="function"){l()}}}else{k="html";j=function(n){g.html(n);if(l&&typeof l==="function"){l()}}}if(this.xhr){this.xhr.abort()}if(c.client){i+="&client="+c.client}if(this.lang!=="fr"){i+="&lang="+this.lang}this.xhr=d.ajax({type:m,url:h,data:i,dataType:k,beforeSend:function(o,n){f.startLoading()},complete:function(n,o){f.endLoading()},success:j,error:function(o,p,n){f.endLoading()},timeout:0})};b.prototype.movedAndReload=function(f){f=f||null;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,callback:f})}else{this.cart.updateDatas({centerPoint:this.cart.centerPoint,callback:f})}};b.prototype.keyHandler=function(h){var f={UP:38,UP_NUM:104,RIGHT:39,RIGHT_NUM:102,DOWN:40,DOWN_NUM:98,LEFT:37,LEFT_NUM:100,UP_LEFT:103,UP_RIGHT:105,DOWN_LEFT:97,DOWN_RIGHT:99,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8,STAR:106,PLUS:107,MINUS:109},g=h.which;if(g==f.ESC){this.cart.fullscreen=false;d("html").removeClass("fullscreen");this.cart.oMask.css({left:this.params.left,top:this.params.top});if(this.params.parent!="body"){this.oHTML.css("position","relative");this.params.parent.append(this.oHTML)}this.winSize=new b.dimensions(null,null,0,0);this.cart.reSize();return}if(moviLib.checkKeyOnInput(h)){return}if(g==f.STAR){this.fullScreen();return}if(g==f.PLUS){this.cart.appliZoom("zoom-in");return}if(g==f.MINUS){this.cart.appliZoom("zoom-out");return}if((g<37&&g>40)){return}if(g==f.LEFT||g==f.LEFT_NUM){this.cart.moveCarte(250,0)}else{if(g==f.UP||g==f.UP_NUM){this.cart.moveCarte(0,250)}else{if(g==f.RIGHT||g==f.RIGHT_NUM){this.cart.moveCarte(-250,0)}else{if(g==f.DOWN||g==f.DOWN_NUM){this.cart.moveCarte(0,-250)}else{if(g==f.UP_LEFT){this.cart.moveCarte(250,250)}else{if(g==f.UP_RIGHT){this.cart.moveCarte(-250,250)}else{if(g==f.DOWN_RIGHT){this.cart.moveCarte(-250,-250)}else{if(g==f.DOWN_RIGHT){this.cart.moveCarte(250,-250)}}}}}}}}return false};b.prototype.startLoading=function(){if(this.loadingMsg&&d("#chargement").length>0){this.loadingMsg.show();return}this.loadingMsg=d('<a id="chargement" class="action" href="javascript:void(0)"></a>');var g=d('<img src="'+this.oConfig.imagesPath+'ld.gif" width="16" height="16" alt=""/>'),f=this;this.loadingMsg.append(g).bind("click",function(){if(f.xhr){f.xhr.abort()}});this.actions.append(this.loadingMsg)};b.prototype.endLoading=function(){if(this.loadingMsg&&d("#chargement").length>0){this.loadingMsg.hide()}};b.prototype.setPanelHeight=function(){if(d("#"+this.params.panel).length===0){return}var f=d("#"+this.params.panel),g=(d("#"+this.oConfig.footer).length===0)?30:d("#"+this.oConfig.footer).height()+5;if(!this.params.modeROD&&f.height()>this.pageSize.height-f.position().top-g){f.height(this.pageSize.height-f.position().top-g);f.addClass("scrollbar")}else{this.defaultPanel()}return};b.prototype.defaultPanel=function(){if(d("#"+this.params.panel).length===0){return}var f=d("#"+this.params.panel).height("");f.removeClass("scrollbar")};b.prototype.genChkBoxes=function(h,f,j){if(this.params.modesFilter===false){return}var g=this,i=d("<div></div>").css({position:"absolute",top:parseInt(this.cart.oMask.css("top"),10)+14,left:this.cart.oMask.width()+this.cart.oMask.position().left-200,"z-index":1000}).width("150").appendTo(this.oHTML);this.chkboxes=new b.chkBoxes(f,i,j,locales[this.lang].titreCheckBoxes);this.chkboxes.createDerouleur(function(){g.chkBoxesHandler(this);return false});d.map(h,function(l,k){g.chkboxes.addElement("checkbox","checkSet"+k,d.enleveAccent("check_"+locales.fr.lstMode[l]),locales[g.lang].lstMode[l],function(){g.checkCheck(this)},l)});this.chkboxes.setDimensions(this.chkboxes.oHTML.width(),this.chkboxes.oHTML.height())};b.prototype.initChkBoxes=function(f){var g=this,h=(this.cart.niveau>14)?"":"small-";if(!this.chkboxes||!this.chkboxes.oHTML){return}d(":checkbox",this.oHTML).each(function(i){g.chkboxes.uncheck(d(this));g.chkboxes.disable(d(this));var j=d.data(this,"mode");g.chkboxes.addLegend(d(this),h+d.enleveAccent(locales.fr.lstMode[j]).toLowerCase())});d.map(this.modeIn,function(i){if(d(d.enleveAccent("#check_"+locales.fr.lstMode[i])).length===0){return}g.chkboxes.enable(d(d.enleveAccent("#check_"+locales.fr.lstMode[i])))});d.map(f,function(i){if(d(d.enleveAccent("#check_"+locales.fr.lstMode[i])).length===0){return}g.chkboxes.check(d(d.enleveAccent("#check_"+locales.fr.lstMode[i])))})};b.prototype.chkBoxesHandler=function(g){var f=this.chkboxes.dimensions.height;if(d(g).hasClass("todown")){d(g).next().removeClass("collapsed");this.chkboxes.oHTML.animate({height:f},500)}else{this.chkboxes.oHTML.css("overflow","hidden");this.chkboxes.oHTML.animate({height:d(g).next().outerHeight()},500,function(){d(g).next().addClass("collapsed")})}d(g).toggleClass("toup").toggleClass("todown");return true};b.prototype.checkCheck=function(h){this.doCheck=true;var g=d(h),i=g.data("mode"),f=this;if(h.checked){this.modeSel.push(i);this.aP=[];this.aL=[];this.cart.updateDatas();if(d.inArray(i,d.keys(this.oConfig.tileModes))!=-1){d("img.lineTiles",this.cart.oHTML).filter("."+this.oConfig.tileModes[d.enleveAccent(i)].name).show()}}else{if(!h.checked){d("div:data(type=Desserte) img:data(mode=/^"+i+"/):first-child").hide();d("div.ligne:data(mode="+i+")").hide().each(function(){var j=d.inArray(this.id,f.affLigne);if(j!=-1){f.affLigne.splice(j,1)}});if(d.inArray(i,d.keys(this.oConfig.tileModes))!=-1){d("img.lineTiles",this.cart.oHTML).filter("."+this.oConfig.tileModes[d.enleveAccent(i)].name).hide()}if(d.inArray(i,this.modeSel)!=-1){this.modeSel.splice(d.inArray(i,this.modeSel),1)}}}};b.prototype.createActions=function(g){if(this.actions){this.actions.remove()}this.actions=d('<div id="actionsmap"></div>');var f=this;d.each(this.oConfig.actions,function(h,i){if(typeof f[i]==="function"){f[i](g)}});this.actions.css({left:g.oMask.position().left,top:g.oMask.position().top+32})};b.prototype.backbutton=function(g){var i=this.oConfig.imagesPath+"backbutton.png",f=locales[this.lang].backbutton,h=locales[this.lang].backbuttonTitle;this.actions.append(d('<a id="backbutton" class="action" href="javascript:void(0)" title="'+h+'"><img widht="22" height="22" src="'+i+'" alt="'+f+'"/></a>').click(function(l){l.preventDefault();var k=0,m;function j(n){k+=20;if(k>=100){k=100;clearInterval(m);itMap.oInterface.oHTML.css("left",k+"%");if(n&&typeof n==="function"){n()}return}itMap.oInterface.oHTML.css("left",k+"%")}}));slide();timer=setInterval(function(){slide(function(){setTimeout(function(){itMap.oInterface.oHTML.hide()},250)})},0);this.oHTML.append(this.actions)};b.prototype.fullwindow=function(h){var f=this,j,g,i;if(h.oMask.offset().left===0&&h.oMask.offset().top===0){j=this.oConfig.imagesPath+"nofullwindow.png";g=locales[this.lang].nofullWindow;i=locales[this.lang].nofullWindowTitle}else{j=this.oConfig.imagesPath+"fullwindow.png";g=locales[this.lang].fullWindow;i=locales[this.lang].fullWindowTitle}this.actions.append(d('<a id="fullwindow" class="action" href="javascript:void(0)" title="'+i+'"><img src="'+j+'" alt="'+g+'"/></a>').click(function(k){k.preventDefault();f.fullScreen(this)}));this.oHTML.append(this.actions)};b.prototype.locateme=function(g){if(!navigator.geolocation){return false}var i=this.oConfig.imagesPath+"locateme.png",f=locales[this.lang].locateMe,h=locales[this.lang].locateMeTitle,j;this.actions.append(d('<a id="locateme" class="action" href="javascript:void(0)" title="'+h+'"><img widht="22" height="22" src="'+i+'" alt="'+f+'"/></a>').click(function(k){k.preventDefault();if(navigator.geolocation){navigator.geolocation.getCurrentPosition(function(l){j=(l.coords.accuracy<=200)?16:10;itMap.centerAt(l.coords.latitude,l.coords.longitude,j)},function(l){itMap.oHTML.append(d('<div id="locationError"><p>Votre position n\'a pas pu être déterminée<p></div>').hide());d("#locationError").dialog({modal:"true",title:"Erreur",buttons:{Ok:function(){d(this).dialog("close")}},close:function(m,n){d(this).remove()}})},{enableHighAccuracy:true})}}));this.oHTML.append(this.actions)};b.prototype.createFooter=function(h){var j,k,i,f,g;i=Math.round((Math.round(h.getResolution(h.latitude,h.niveau))*this.oConfig.scaleWidth)/10)*10;i=(i>2000)?(i>10000)?Math.round(Math.round(i/1000)/10)*10+"km":Math.round(i/1000)+"km":i+"m";if(this.footer){g=this.footer.find(".copyright").eq(0);g.css({width:Math.floor(h.oMask.width()/2),left:0});this.footer.find(".scale").eq(0).text(i);this.footer.width(h.oMask.width());this.footer.height(g.height());this.footer.css({left:h.oMask.position().left,top:h.oMask.position().top+h.oMask.height()-this.footer[0].offsetHeight});return}this.footer=d('<div id="footermap"></div>');this.oHTML.append(this.footer);this.footer.append(d('<span class="scale">'+i+"</span>"));j=d('<div id="legend" style="position:absolute;display:inline;right:35px;"></div>');k=d('<a class="newwindow" href="'+this.oConfig.imagesPath+'legende.png">Légende</a>');k.click(function(){moviLib.nouvelleFenetre(this.href,this.target,"console",400,350);return false});j.append(k);f=new Date();g=d('<span class="copyright">©Moviken iTransports '+f.getFullYear()+"</span>");g.append("| ©TeleAtlas "+f.getFullYear());g.append("| ©les contributeurs d'OpenStreetMap CC-BY-SA");g.css({width:Math.floor(h.oMask.width()/2),left:0});j.append(g);this.footer.append(j);this.footer.width(h.oMask.width());this.footer.height(g.height());this.footer.css({left:h.oMask.position().left,top:h.oMask.position().top+h.oMask.height()-this.footer[0].offsetHeight})};b.prototype.inverseColorBackground=function(h){if(this.cart.modeCarte=="ITINERAIRE"){return}var g=h.css("color"),f=h.css("background-color");h.css("backgroundColor",g);h.css("color",f)};b.chkBoxes=function(k,f,j,i,h,g){this.id=k;this.oHTML=null;this.oConteneur=f;this.formId=j;this.form=null;this.titre=i;this.onOver=h||null;this.onOut=g||null;this.dimensions=null;this.init()};b.chkBoxes.prototype.init=function(){this.create()};b.chkBoxes.prototype.create=function(){var f=this;this.oHTML=d('<div id="'+this.id+'"></div>');if(this.onOver&&this.onOut){this.oHTML.hover(function(){f.onOver()},function(){f.onOut()})}if(this.titre){this.oHTML.append(d("<h3>"+this.titre+"</h3>"))}this.form=d('<form id="'+this.formId+'"></form>');this.oHTML.append(this.form);this.oConteneur.append(this.oHTML)};b.chkBoxes.prototype.addElement=function(i,f,m,l,g,k,h){h=h||null;k=k||null;d('<p><input id="'+m+'" type="'+i+'" name="'+f+'" value="'+l+'"/><label for="'+m+'">'+l+"</label></br></p>").appendTo(this.form);var j=d("#"+m);j.click(g);if(h){j.parent().addClass(h)}if(k){d.data(j.get(0),"mode",k)}};b.chkBoxes.prototype.addLegend=function(f,h){var g=f.prev("span");if(g){g.remove()}f.before(d('<span class="'+h+'"></span>'))};b.chkBoxes.prototype.setDimensions=function(g,f){this.dimensions=new b.dimensions(null,null,g,f)};b.chkBoxes.prototype.setPositionRelativeTo=function(h){var f=parseInt(Parent.offsetTop,10),g=parseInt(h.offsetLeft,10);this.oHTML.style.top=f+5+"px";this.oHTML.style.left=g+5+"px"};b.chkBoxes.prototype.setPositionUnder=function(h){var f=parseInt(h.offsetTop,10)+parseInt(h.offsetHeight,10),g=parseInt(h.offsetLeft,10);this.oHTML.style.top=f+5+"px";this.oHTML.style.left=g+"px"};b.chkBoxes.prototype.createDerouleur=function(g){var f=d('<a id="deroul" class="toup" href="javascript:void(0)"></a>');f.click(g);this.oHTML.prepend(f)};b.chkBoxes.prototype.disable=function(f){f[0].disabled=true;f.parent().addClass("disabled")};b.chkBoxes.prototype.enable=function(f){f[0].disabled=false;f.parent().removeClass("disabled")};b.chkBoxes.prototype.check=function(f){f[0].checked=true};b.chkBoxes.prototype.uncheck=function(f){f[0].checked=false};b.point=function(f,g){this.E=f;this.N=g};b.point.prototype.distm=function(h){var g=this.E-h.E,f=this.N-h.N;return Math.sqrt(g*g+f*f)};b.point.prototype.center=function(f){var h=Math.round((parseInt(this.E,10)+parseInt(f.E,10))/2),g=Math.round((parseInt(this.N,10)+parseInt(f.N,10))/2);return new b.point(h,g)};b.deplacement=function(f,g){this.x=f;this.y=g};b.oLigne=function(h,g,f){this.code=h;this.label=g;this.type_ligne=f};b.bounds=function(f,h,g,i){this.latmin=typeof f=="undefined"?null:Number(f);this.latmax=typeof h=="undefined"?null:Number(h);this.longmin=typeof g=="undefined"?null:Number(g);this.longmax=typeof i=="undefined"?null:Number(i)};b.bounds.prototype.addBounds=function(g){if(g instanceof b.bounds){var f=g.getBounds();this.latmin=(f.latmin<this.latmin||!this.latmin)?f.latmin:this.latmin;this.latmax=(f.latmax>this.latmax||!this.latmax)?f.latmax:this.latmax;this.longmin=(f.longmin<this.longmin||!this.longmin)?f.longmin:this.longmin;this.longmax=(f.longmax>this.longmax||!this.longmax)?f.longmax:this.longmax}};b.bounds.prototype.getBounds=function(){return{latmin:this.latmin,latmax:this.latmax,longmin:this.longmin,longmax:this.longmax}};b.bounds.prototype.contains=function(f,g){f=Number(f);g=Number(g);return((f>=this.latmin)&&(f<=this.latmax)&&(g>=this.longmin)&&(g<=this.longmax))};b.bounds.prototype.intersects=function(h){if(h instanceof b.bounds){var g=h.getBounds(),k,f,j,i;f=((g.latmin>=this.latmin&&g.latmin<=this.latmax)||(this.latmin>=g.latmin&&this.latmin<=g.latmax));k=((g.latmax>=this.latmin&&g.latmax<=this.latmax)||(this.latmax>g.latmin&&this.latmax<g.latmax));j=((g.longmin>=this.longmin&&g.longmin<=this.longmax)||(this.longmin>=g.longmin&&this.longmin<=g.longmax));i=((g.longmax>=this.longmin&&g.longmax<=this.longmax)||(this.longmax>=g.longmin&&this.longmax<=g.longmax));return(f||k)&&(j||i)}};b.bounds.prototype.getIntersect=function(f){if(f instanceof b.bounds&&this.intersects(f)){return new b.bounds(Math.max(this.latmin,f.latmin),Math.min(this.latmax,f.latmax),Math.max(this.longmin,f.longmin),Math.min(this.longmax,f.longmax))}else{return null}};b.bounds.prototype.isEmptyBounds=function(){return(this.latmin===null||this.latmax===null||this.longmin===null||this.longmax===null)};b.dimensions=function(i,h,g,f){this.left=typeof i=="undefined"?"undefined":i;this.top=typeof h=="undefined"?"undefined":h;this.width=typeof g=="undefined"?"undefined":g;this.height=typeof f=="undefined"?"undefined":f;this.right=(typeof i=="undefined"&&typeof g=="undefined")?"undefined":i+g;this.bottom=(typeof h=="undefined"&&typeof f=="undefined")?"undefined":h+f};b.Carte=function(g,i,f,h){this.oInterface=g;this.latitude=i||this.oInterface.oConfig.lat_def;this.longitude=f||this.oInterface.oConfig.long_def;this.niveau=h||0;this.letterLevel=null;this.oConteneur=this.oInterface.oHTML;this.iterTiles=null;this.height=null;this.width=null;this.xmin=null;this.xmax=null;this.ymin=null;this.ymax=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.centerCoord_px=null;this.lstimg=[];this.tilesWrapper=null;this.previousTilesWrapper=null;this.dragapproved=false;this.mouseup=false;this.mvswt=false;this.rightdrag=false;this.rightmup=false;this.rightmvswt=false;this.stops=null;this.segs=null;this.timeoutDrag=null;this.timeoutWheel=null;this.oHTML=null;this.oMask=null;this.noreload=false;this.zooming=false;this.resizing=false;this.fullscreen=false;this.contour=null;this.levelControl=null;this.contextMenu=null;this.modeCarte=null;this.centerPoint=null;this.layer={};this.request={};this.createCarte(this.latitude,this.longitude,this.niveau)};b.Carte.prototype.createCarte=function(i,g,h){this.createMask();this.createContour(this.oConteneur);this.createLevelControl(this.oConteneur);if(!this.oInterface.params.width){if(this.oInterface.params.layout=="fixed"){this.oMask.width(this.oInterface.pageSize.width-d("#"+this.oInterface.oConfig.panel).width())}else{this.oMask.width(this.oInterface.pageSize.width-this.oMask.position().left)}}else{this.oMask.width(this.oInterface.params.width)}if(!this.oInterface.params.height){if(this.oInterface.params.layout=="fixed"){this.oMask.height(this.oInterface.pageSize.height-this.oMask.position().top-(d("#"+this.oInterface.oConfig.footer).height()-15))}else{this.oMask.height(this.oInterface.pageSize.height-this.oMask.position().top)}}else{this.oMask.height(this.oInterface.params.height)}this.levelControl.css("left",this.oMask.width()+this.oMask.position().left-40);this.dimVisCarte=new b.dimensions(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();if(this.oInterface.oConfig.exportPDF){this.createLnkPDF()}this.oHTML=d('<div id="carte"></div>');this.oHTML.css({left:this.leftDiv,top:this.topDiv});this.oMask.append(this.oHTML);this.centerAt(i,g,h);this.oInterface.createActions(this);this.oInterface.createFooter(this);var f=this;d("body").delegate("a[lat][lng][level]","click",function(j){j.preventDefault();itMap.zoomAt(d(this).attr("lat"),d(this).attr("lng"),d(this).attr("level"));if(f.layer.DEFAULT["default"]){itMap.addToLayer("Marker",[{id:"default",type:"DEFAULT",latitude:d(this).attr("lat"),longitude:d(this).attr("lng"),content:"<h4>"+d(this).text()+"</h4>",icon:f.layer.DEFAULT["default"].params.icon}])}}).delegate("#infosListe li.state-default","hover",function(j){d(this).toggleClass("state-hover");return false}).delegate("#infosListe li","click",function(k){k.stopPropagation();var l=d(this),j;j=l.children("ul");if((j.is("ul"))&&(j.is(":visible"))){j.slideUp("normal").parent().removeClass("state-active").addClass("state-default");return false}if((j.is("ul"))&&(!j.is(":visible"))){d("#infosListe li ul:visible").slideUp("normal").parent().removeClass("state-active").addClass("state-default");j.slideDown("normal").parent().removeClass("state-default").addClass("state-active").parent().animate({scrollTop:j.parent().offset().top},500);return false}});d("#navigationControl").delegate("div","click",function(j){f.clickContour(this)});d(this.oInterface.params.segmentTag+"[segmentid]").delegate(".it-stage","click mouseover active inactive",function(k){var l,j;switch(k.type){case"mouseover":d(this).css("cursor","pointer");break;case"click":itMap.itineraire.handleDetails(k,this);break;case"active":l=/default-stage-(\d+)\.png/;j=d(this);if(l.test(j.attr("src"))){j.parent().find("table").addClass("active");j.attr("src",j.attr("src").replace(l,"active-stage-$1.png"))}d(f.oInterface.params.segmentTag+"[segmentid]").each(function(){d(".it-stage",this).not(j.get(0)).trigger("inactive")});break;case"inactive":l=/active-stage-(\d+)\.png/;j=d(this);if(l.test(j.attr("src"))){j.parent().find("table").removeClass("active");j.attr("src",j.attr("src").replace(l,"default-stage-$1.png"))}break;default:break}});this.oHTML.bind({mouseover:function(j,k){var l=typeof k=="undefined"?d(j.target):d(k);if(l.hasClass("dispinfo")){if(l.hasClass("fake")){l=d(l.parent().prev().children(":first"))}if(typeof f.layer[l.data("type")][l.attr("id")]!=="undefined"){switch(f.layer[l.data("type")][l.attr("id")].type){case"CENTRE":case"FIXE":j.preventDefault();break;default:l.doTimeout("over-station",250,function(){f.layer[l.data("type")][l.attr("id")].openStation()});break}}}},mouseout:function(j){var k=d(j.target);if(k.hasClass("dispinfo")&&k.not("#p_center")){if(k.hasClass("fake")){k=d(k.parent().prev().children(":first"))}k.doTimeout("over-station")}},click:function(j){if(f.contextMenu){f.contextMenu.remove();f.contextMenu=null}},mousewheel:function(j,k){f.zoomWheel(j,k);return false}});this.oHTML.delegate("li:data(ligne)","click",function(j){f.clicOnLigne(j,this);return false}).delegate("li:data(mode=/R|M|W|C|B|F/)","hover",function(j){f.oInterface.inverseColorBackground(d(this));return false}).delegate(".infobox img.infoimg","click",function(){var k=d(this),j=k.closest("div[id^=divpun]").children().eq(0),l=j.attr("id");f.layer[j.data("type")][l].retrieveInfosHandler({action:"retrieveInfos",obj:k.parent().get(0),ligne:d.data(k.parent().get(0),"ligne"),mode:d.data(k.parent().get(0),"mode")});return false}).delegate(".action-list li","click",function(k){if(typeof f[this.className]==="function"){var j=d(this).closest("div[id^=divpun]").children().eq(0),l=j.attr("id");f[this.className](k,f.layer[j.data("type")][l].oHTML_img);return false}}).delegate("img.drag","contextmenu",function(j){});this.oHTML.draggable({addClasses:false,cancel:"ul#infosListe",start:function(j,k){d(this).addClass("grab");d("#p_center").show();f.mdw(j.originalEvent,k)},drag:function(j,k){f.mmv(j.originalEvent,k)},stop:function(j,k){f.mup(j.originalEvent,k);d("#p_center").hide()}});this.oHTML.bind(this.oInterface.oConfig.zoomEvent,function(j){f.zoomin(j)});this.oHTML.rightClick(function(j){return false},function(j){f.zoomin(j)});this.oHTML.rightMouseDown(function(l){l.stopPropagation();var k=l.pageX,j=l.pageY,m=d('<div id="boundingbox"></div>');m.css({left:l.pageX-f.oHTML.offset().left,top:l.pageY-f.oHTML.offset().top,width:0,height:0});m.appendTo(f.oHTML);f.rightmvswt=true;f.rightmup=false;f.oHTML.bind("mousemove.rightmousemove",function(n){n.stopPropagation();if(f.rightmvswt&&Math.abs(n.pageX-k)>0&&Math.abs(n.pageY-j)>0){f.oHTML.get(0).ondragstart=function(){return false};d(this).unbind("mouseup.rightclick");f.rightdrag=true;if(n.pageX-k>0){m.width(n.pageX-k)}else{m.css("left",n.pageX-f.oHTML.offset().left);m.width(k-n.pageX)}if(n.pageY-j>0){m.height(n.pageY-j)}else{m.css("top",n.pageY-f.oHTML.offset().top);m.height(j-n.pageY)}}});f.oHTML.rightMouseUp(function(p){p.stopPropagation();f.oHTML.unbind("mousemove.rightmousemove");f.oHTML.unbind("mouseup.rightmouseup");f.rightmvswt=false;if(f.rightdrag&&p.which==3){f.rightdrag=false;f.rightmup=true;var o=f.centerCoord_px.E+m.offset().left-(f.dimVisCarte.left+Math.floor(f.dimVisCarte.width/2)),t=parseInt(o,10)+m.width(),n=f.centerCoord_px.N+m.offset().top-(f.dimVisCarte.top+Math.floor(f.dimVisCarte.height/2)),r=parseInt(n,10)+m.height(),s=f.pixelToLatlong(o,n,f.niveau),q=f.pixelToLatlong(t,r,f.niveau);f.zoomToBoundary(new b.bounds(q.latitude,s.latitude,s.longitude,q.longitude))}d("#boundingbox").remove();f.oHTML.get(0).ondragstart=null})});d(c).bind(this.oInterface.oConfig.resizeEvent,function(){d.doTimeout(f.oInterface.oConfig.resizeEvent,250,function(){f.reSize()})})};b.Carte.prototype.show=function(){this.oInterface.oHTML.show()};b.Carte.prototype.hide=function(){this.oInterface.oHTML.hide()};b.Carte.prototype.destroyMap=function(){this.oInterface.destroy()};b.Carte.prototype.fullScreen=function(){this.oInterface.fullScreen()};b.Carte.prototype.reSize=function(){this.resizing=true;if(this.oInterface.winSize.height!=d(c).height()||this.oInterface.winSize.width!=d(c).width()){this.oInterface.winWH();if(!this.fullscreen&&(d.isFunction(this.oInterface.params.top)||d.isFunction(this.oInterface.params.left))){this.oMask.css({top:this.oInterface.params.top,left:this.oInterface.params.left})}if(!this.oInterface.params.width||this.fullscreen){if((this.oInterface.winSize.width-this.oMask.position().left)<450){this.oMask.width(450)}else{this.oMask.width(this.oInterface.winSize.width-this.oMask.position().left)}}else{this.oMask.width(this.oInterface.params.width)}if(!this.oInterface.params.height||this.fullscreen){if((this.oInterface.winSize.height-this.oMask.position().top)<350){this.oMask.height(350)}else{this.oMask.height(this.oInterface.winSize.height-this.oMask.position().top)}}else{this.oMask.height(this.oInterface.params.height)}this.dimVisCarte=new b.dimensions(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.oInterface.params.modeROD&&this.itineraire){this.itineraire.setHeight()}else{if(this.oInterface.params.panel){this.oInterface.setPanelHeight()}}this.removeEle();this.centerAt(this.centerPoint.latitude,this.centerPoint.longitude,this.niveau);if((this.niveau==this.oInterface.oConfig.lastNiv)&&!this.itineraire&&d.isEmptyObject(this.layer.DEFAULT)){this.reloadInterface();return}this.updateDatas();this.reloadInterface()}};b.Carte.prototype.reloadInterface=function(){this.varsCarte();this.levelControl.css({left:this.oMask.width()+this.oMask.position().left-40,top:this.oMask.position().top+14});if(this.oInterface.chkboxes){this.oInterface.chkboxes.oHTML.parent().css({top:this.oMask.position().top+14,left:this.oMask.width()+this.oMask.position().left-200})}this.upDateContour();this.oInterface.createActions(this);this.oInterface.createFooter(this);this.centerPoint.posPunAtCenter()};b.Carte.prototype.createMask=function(){this.oMask=d('<div id="t_tableau"></div>');if(typeof this.oInterface.params.top=="undefined"&&typeof this.oInterface.params.left=="undefined"){if(this.oInterface.params.layout=="fluid"){this.oMask.css({top:d("#onglet").position().top+d("#onglet").height()+1,left:d("#"+this.oInterface.oConfig.panel).position().left+d("#"+this.oInterface.oConfig.panel).width()+25,"background-color":"#FCFEDC"})}else{this.oMask.css({top:d("#onglet").position().top+d("#onglet").height()+1,left:d("#"+this.oInterface.oConfig.panel).position().left+d("#"+this.oInterface.oConfig.panel).width(),"background-color":"#FCFEDC"})}}else{this.oMask.css({top:this.oInterface.params.top,left:this.oInterface.params.left,"background-color":"#FCFEDC"})}this.oConteneur.append(this.oMask)};b.Carte.prototype.lstTiles=function(){if(isNaN(this.niveau)){this.niveau=this.oInterface.oConfig.defaultLevel}this.creeImg();if(!this.deplace){this.deplace=new b.deplacement(0,0)}else{this.deplace.x=0;this.deplace.y=0}if(!this.parcours){this.parcours=new b.deplacement(0,0)}else{this.parcours.x=0;this.parcours.y=0}};b.Carte.prototype.getSrcTile=function(g,f,l){if(g>=Math.pow(2,this.niveau)){g-=Math.pow(2,this.niveau)}if(g<0){g+=Math.pow(2,this.niveau)}if(f<0||f>=Math.pow(2,this.niveau)){return this.oInterface.oConfig.imagesPath+"spacer.gif"}var k,j,i=Math.floor(this.oInterface.oConfig.tileNbUrls*Math.random()),h=/(https?:\/\/t)\d(.itransports.fr\/)/;if(h.test(this.oInterface.oConfig.tileRefPath)){j=h.exec(this.oInterface.oConfig.tileRefPath)}k=(h.test(this.oInterface.oConfig.tileRefPath))?j[1]+i+j[2]:this.oInterface.oConfig.tileRefPath;return k+"tile.php?zoom="+l+"&xtile="+String(g)+"&ytile="+String(f)};b.Carte.prototype.creeImg=function(){var f,k,h,g,l;this.tilesWrapper=this.tilesWrapper||d('<div style="position:absolute;left:0;top:0;"/>');while(this.lstimg.length>this.iterTiles.x){f=this.lstimg.pop();for(k=0;k<f.length;k++){f[k].remove()}}for(k=this.lstimg.length;k<this.iterTiles.x;k++){this.lstimg.push([])}for(k=0;k<this.lstimg.length;k++){while(this.lstimg[k].length>this.iterTiles.y){g=this.lstimg[k].pop();g.remove()}for(h=this.lstimg[k].length;h<this.iterTiles.y;h++){l=d('<img id="'+k+"_"+h+'" width="'+this.oInterface.oConfig.tileWidth+'" height="'+this.oInterface.oConfig.tileHeight+'" class="drag"/>');l.mousedown(function(i){i.preventDefault()});this.lstimg[k].push(l);this.tilesWrapper.append(l);this.configImage(l,k,h)}}this.oHTML.prepend(this.tilesWrapper);return};b.Carte.prototype.latlongToPixel=function(h,j,l){h=this.clipValue(h,this.oInterface.oConfig.minLatitude,this.oInterface.oConfig.maxLatitude);j=this.clipValue(j,this.oInterface.oConfig.minLongitude,this.oInterface.oConfig.maxLongitude);var f=(j+180)/360,g=Math.sin(h*Math.PI/180),k=0.5-Math.log((1+g)/(1-g))/(4*Math.PI),i=this.mapSize(l);return{x:Math.round(this.clipValue(f*i+0.5,0,i-1)),y:Math.round(this.clipValue(k*i+0.5,0,i-1))}};b.Carte.prototype.latLongToMeters=function(i,j){var g=6378137,h=2*Math.PI*g/2,f=j*h/180,k=Math.log(Math.tan((90+i)*Math.PI/360))/(Math.PI/180);k=k*h/180;return{x:f,y:k}};b.Carte.prototype.latLongToTile=function(h,i,j){var f=Math.floor((i+180)/360*Math.pow(2,j)),g=Math.floor((1-Math.log(Math.tan(h*Math.PI/180)+1/Math.cos(h*Math.PI/180))/Math.PI)/2*Math.pow(2,j));return{xtile:f,ytile:g}};b.Carte.prototype.metersToLatlong=function(k,i){var f=6378137,g=2*Math.PI*f/2,j=(k/g)*180,h=(i/g)*180;h=180/Math.PI*(2*Math.atan(Math.exp(h*Math.PI/180))-Math.PI/2);return{latitude:h,longitude:j}};b.Carte.prototype.pixelToLatlong=function(f,k,j){var i=this.mapSize(j),g,h;f=(this.clipValue(f,0,i-1)/i)-0.5;k=0.5-(this.clipValue(k,0,i-1)/i);g=90-360*Math.atan(Math.exp(-k*2*Math.PI))/Math.PI,h=360*f;return{latitude:g,longitude:h}};b.Carte.prototype.pixelToPosition=function(f,i){var h=f+(this.curLeftOffset-this.topLeft.E)*this.oInterface.oConfig.tileWidth-this.paddingLeft,g=i+(this.curTopOffset-this.topLeft.N)*this.oInterface.oConfig.tileHeight-this.paddingTop;return{left:h,top:g}};b.Carte.prototype.tileToLatlong=function(f,k,j){var h=f/Math.pow(2,j)*360-180,i=Math.PI-2*Math.PI*k/Math.pow(2,j),g=180/Math.PI*Math.atan(0.5*(Math.exp(i)-Math.exp(-i)));return{latitude:g,longitude:h}};b.Carte.prototype.clipValue=function(h,f,g){return Math.min(Math.max(h,f),g)};b.Carte.prototype.getResolution=function(f,g){f=this.clipValue(f,this.oInterface.oConfig.minLatitude,this.oInterface.oConfig.maxLatitude);return Math.cos(f*Math.PI/180)*2*Math.PI*6378137/this.mapSize(g)};b.Carte.prototype.mapScale=function(g,h,f){f=f||72;return this.getResolution(g,h)*f/0.0254};b.Carte.prototype.mapSize=function(f){return 256<<f};b.Carte.prototype.normaliseIndices=function(f,h,g){return[this.mod(f,Math.pow(2,g)),this.mod(h,Math.pow(2,g)),g]};b.Carte.prototype.mod=function(g,f){return((g%f)+f)%f};b.Carte.prototype.correspondingOldLevel=function(g){var f={"7":"J","8":"I","9":"H","10":"G","11":"F","12":"E","13":"D","14":"C","15":"B","16":"A","17":"A"};g=g.toString()||0;return(d.inArray(g,d.keys(f))!=-1)?f[g]:null};b.Carte.prototype.configImage=function(m,n,l){var p=(this.curLeftOffset+n)*this.oInterface.oConfig.tileWidth,h=(this.curTopOffset+l)*this.oInterface.oConfig.tileHeight,k=-this.paddingLeft+p,g=-this.paddingTop+h,o=this.topLeft.E+n,f=this.topLeft.N+l,q;m.css({position:"absolute",left:Math.round(k),top:Math.round(g)});if(d.data(m.get(0),"curL")!=o||d.data(m.get(0),"curC")!=f){d.data(m.get(0),"curL",o);d.data(m.get(0),"curC",f)}q=this.getSrcTile(o,f,this.niveau);if(m.attr("src")!=q){m[0].removeAttribute("src");m.bind("load",function(){d(this).fadeIn()});m[0].style.display="none";m.attr("src",q);if(m[0].complete){m.trigger("load")}}};b.Carte.prototype.toDown=function(){var g,f;this.curTopOffset++;this.topLeft.N++;for(g=0;g<this.lstimg.length;g++){f=this.lstimg[g].shift();this.lstimg[g].push(f);this.configImage(f,g,this.lstimg[0].length-1)}};b.Carte.prototype.toUp=function(){var g,f;this.curTopOffset--;this.topLeft.N--;for(g=0;g<this.lstimg.length;g++){f=this.lstimg[g].pop();this.lstimg[g].unshift(f);this.configImage(f,g,0)}};b.Carte.prototype.toLeft=function(){var g,f=this.lstimg.pop();this.curLeftOffset--;this.topLeft.E--;if(f){this.lstimg.unshift(f);for(g=0;g<f.length;g++){this.configImage(f[g],0,g)}}};b.Carte.prototype.toRight=function(){this.curLeftOffset++;this.topLeft.E++;var f=this.lstimg.shift(),g,h;this.lstimg.push(f);h=this.lstimg.length-1;for(g=0;g<f.length;g++){this.configImage(f[g],h,g)}};b.Carte.prototype.reInitImg=function(){d("img.lineTiles").each(function(h){d(this).remove()});var g,f;if(this.lstimg){for(g=0;g<this.lstimg.length;g++){if(this.lstimg[g]){for(f=0;f<this.lstimg[g].length;f++){this.lstimg[g][f].remove()}}}}this.lstimg=[];this.leftDiv=this.topDiv=0;this.oHTML.css({left:0,top: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};b.Carte.prototype.setPosition=function(){this.oHTML.css({left:this.leftDiv,top:this.topDiv})};b.Carte.prototype.nextNiv=function(f){return(f>this.oInterface.oConfig.firstNiv)?--f:this.oInterface.oConfig.firstNiv};b.Carte.prototype.prevNiv=function(f){return(f<this.oInterface.oConfig.lastNiv)?++f:this.oInterface.oConfig.lastNiv};b.Carte.prototype.posSlide=function(f){f=f||this.niveau;d("#zoomslider").slider("value",f*100)};b.Carte.prototype.varsCarte=function(){this.iterTiles={x:Math.ceil(this.dimVisCarte.width/this.oInterface.oConfig.tileWidth)+2,y:Math.ceil(this.dimVisCarte.height/this.oInterface.oConfig.tileHeight)+2};if(!this.dimTable){this.dimTable=new b.dimensions(null,null,this.oInterface.oConfig.tileWidth*this.iterTiles.x,this.oInterface.oConfig.tileHeight*this.iterTiles.y)}else{this.dimTable.width=this.oInterface.oConfig.tileWidth*this.iterTiles.x;this.dimTable.height=this.oInterface.oConfig.tileHeight*this.iterTiles.y}this.paddingLeft=Math.floor((this.dimTable.width-this.dimVisCarte.width)/2);this.paddingTop=Math.floor((this.dimTable.height-this.dimVisCarte.height)/2)};b.Carte.prototype.setCenterCoord=function(f,g){if(!this.centerPoint){this.centerPoint=new b.Marker(this,{id:"p_center",latitude:this.latitude,longitude:this.longitude,type:"CENTRE",icon:{url:this.oInterface.oConfig.imagesPath+"pointer2.png",width:"29",height:"29"}});this.centerPoint.posPunAtCenter()}else{this.centerPoint.setCoords(this.latitude,this.longitude)}if(!this.centerCoord_px){this.centerCoord_px=new b.point(f,g)}else{this.centerCoord_px.E=f;this.centerCoord_px.N=g}};b.Carte.prototype.getCenter=function(){return{latitude:this.centerPoint.latitude,longitude:this.centerPoint.longitude}};b.Carte.prototype.getGeoViewbox=function(){var f=this.latlongToPixel(this.oInterface.oConfig.minLatitude,this.oInterface.oConfig.maxLongitude,this.niveau),h=this.pixelToLatlong(this.clipValue((this.centerCoord_px.E-this.dimVisCarte.width/2),0,f.x),this.clipValue((this.centerCoord_px.N-this.dimVisCarte.height/2),0,f.y),this.niveau),g=this.pixelToLatlong(this.clipValue((this.centerCoord_px.E+this.dimVisCarte.width/2),0,f.x),this.clipValue((this.centerCoord_px.N+this.dimVisCarte.height/2),0,f.y),this.niveau);return new b.bounds(g.latitude,h.latitude,h.longitude,g.longitude)};b.Carte.prototype.centerAt=function(o,f,m){m=m||this.niveau;this.latitude=o;this.longitude=f;this.niveau=this.clipValue(m,this.oInterface.oConfig.firstNiv,this.oInterface.oConfig.lastNiv);this.letterLevel=this.correspondingOldLevel(this.niveau);var q=this.latlongToPixel(o,f,this.niveau),k=parseInt(q.x,10),g=parseInt(q.y,10),l=this.latlongToPixel(this.oInterface.oConfig.minLatitude,this.oInterface.oConfig.maxLongitude,this.niveau),h,p,j,i,n;h=this.clipValue((k-this.dimVisCarte.width/2),0,l.x);p=this.clipValue((g-this.dimVisCarte.height/2),0,l.y);j=this.clipValue((k+this.dimVisCarte.width/2),0,l.x);i=this.clipValue((g+this.dimVisCarte.height/2),0,l.y);if(!this.topLeft){this.topLeft=new b.point(Math.floor(h/this.oInterface.oConfig.tileWidth),Math.floor(p/this.oInterface.oConfig.tileWidth))}else{this.topLeft.E=Math.floor(h/this.oInterface.oConfig.tileWidth);this.topLeft.N=Math.floor(p/this.oInterface.oConfig.tileWidth)}this.setCenterCoord(k,g);this.varsCarte();this.reInitImg();this.lstTiles();n=this.pixelToPosition(k,g);if(is_ie==="undefined"){this.leftDiv+=Math.floor(this.dimVisCarte.width/2)-n.left+this.oInterface.oConfig.bordure;this.topDiv+=Math.floor(this.dimVisCarte.height/2)-n.top+this.oInterface.oConfig.bordure}else{this.leftDiv+=Math.floor(this.dimVisCarte.width/2)-n.left;this.topDiv+=Math.floor(this.dimVisCarte.height/2)-n.top}this.setPosition();if(!this.deplace){this.deplace=new b.deplacement(0,0)}else{this.deplace.x=0;this.deplace.y=0}if(this.zooming){this.posSlide();this.reloadInterface();this.zooming=false}};b.Carte.prototype.getBoundsAllMarkers=function(h){h=h||"DEFAULT";if(this.layer&&this.layer[h]&&!d.isEmptyObject(this.layer[h])){var f=this.oInterface.oConfig.maxLatitude,i=this.oInterface.oConfig.minLatitude,g=this.oInterface.oConfig.maxLongitude,j=this.oInterface.oConfig.minLongitude;d.each(this.layer[h],function(k,l){f=(l.latitude<f)?l.latitude:f;i=(l.latitude>i)?l.latitude:i;g=(l.longitude<g)?l.longitude:g;j=(l.longitude>j)?l.longitude:j})}return new b.bounds(f,i,g,j)};b.Carte.prototype.addToLayer=function(g){var h=arguments.length==2&&typeof arguments[1]=="object"?arguments[1]:{},f=this;if(typeof b[g]==="function"){d.map(h,function(i){"type" in i||(i.type="DEFAULT");if(typeof f.layer[i.type]==="undefined"){f.layer[i.type]={}}f.layer[i.type][i.id]=new b[g](f,i)})}};b.Carte.prototype.removeLayer=function(f){var g=this,h;if(this.layer&&this.layer[f]&&!d.isEmptyObject(this.layer[f])){d.each(this.layer[f],function(k,j){h=d("#"+j.id_div,g.oHTML);if(h.length>0){h.remove()}});this.layer[f]={}}};b.Carte.prototype.updateLayer=function(f){f=f||"DEFAULT";var g=this;if(this.layer&&this.layer[f]&&!d.isEmptyObject(this.layer[f])){d.each(this.layer[f],function(j,h){g.layer[f][h.id]=new b[h._type](g,h.params)})}};b.Carte.prototype.setInformationLayer=function(h){this.modeCarte=h||"SINGLE";if(this.zooming){this.zooming=false}var g=this,f;this.updateLayer("DEFAULT");if(this.modeCarte=="SINGLE"||this.modeCarte=="FIXE"){if(this.modeCarte=="FIXE"){if(this.oInterface.aP[this.niveau]){d.map(this.oInterface.aP[this.niveau],function(i){i.type=this.modeCarte;if(typeof g.layer[i.type]==="undefined"){g.layer[i.type]={}}g.layer[i.type][i[0]]=new b.Marker(g,i)})}}if(!this.oInterface.doCheck){if(d("#modchk").length>0){d("#modchk").remove()}}}else{if(this.modeCarte=="POINTDARRET"||this.modeCarte=="ITINERAIRE"){if(this.oInterface.aP[this.niveau]&&this.modeCarte!="ITINERAIRE"){f=this.oInterface.aP[this.niveau].length;if(f>0){d.map(this.oInterface.aP[this.niveau],function(i){if(typeof g.layer[i.type]==="undefined"){g.layer[i.type]={}}g.layer[i.type][i.id]=new b.Marker(g,i);if(g.lastDisplayed&&g.layer[i.type][i.id].oHTML_img.attr("id")==g.lastDisplayed[1]){if(g.layer[i.type][i.id].oHTML_img.attr("id")==g.lastDisplayed[1]){g.layer[i.type][i.id].creeEtiquette();g.layer[i.type][i.id].displayEtiquette(true);g.lastDisplayed=null}}})}if(this.oInterface.infospanel){this.oInterface.infospanel.oHTML.empty();this.oInterface.infospanel.updateStopsFromMap()}}else{if(this.oInterface.aP[this.niveau]){d.map(this.oInterface.aP[this.niveau],function(i){if(typeof g.layer[i.type]==="undefined"){g.layer[i.type]={}}g.layer[i.type][i.id]=new b.Marker(g,i)})}}if(this.niveau>this.oInterface.params.maxBoxesLevel&&this.modeCarte!="ITINERAIRE"){if(d("#modchk").length===0){this.oInterface.genChkBoxes(this.oInterface.params.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(d("#modchk").length>0){d("#modchk").remove()}}}else{return false}}if(this.oInterface.pdfhreflink){this.createPDF(d("#pdfLink a:first"))}else{this.createPDF(d("#pdfLink"))}return true};b.Carte.prototype.handleLines=function(){if(this.oInterface.params.modeROD||this.oInterface.params.mapType=="TRAFFIC"){this.showSVG()}else{this.displayLignes()}};b.Carte.prototype.showSVG=function(){if(this.oInterface.aL[this.niveau]){var f=this;if(d(".ligne",this.oHTML).length>0){d(".ligne",this.oHTML).each(function(g){d(this).remove()})}d.map(this.oInterface.aL[this.niveau],function(g){new b.Path(f,g)})}};b.Carte.prototype.appliZoom=function(g){if(this.niveau==g){return}if(this.contextMenu){this.contextMenu.remove();this.contextMenu=null}this.zooming=true;var f;if(g=="zoom-out"){f=this.nextNiv(this.niveau)}else{if(g=="zoom-in"){f=this.prevNiv(this.niveau)}else{f=g}}this.zoomAt(this.centerPoint.latitude,this.centerPoint.longitude,f)};b.Carte.prototype.updateDatas=function(){var i=arguments.length==1&&typeof arguments[0]=="object"?arguments[0]:{},k=this,f,j,m,g,n,h,l;i.centerPoint=typeof i.centerPoint=="undefined"?this.centerPoint:i.centerPoint;i.noReload=typeof i.noReload=="undefined"?false:i.noReload;i.reloadLinks=typeof i.reloadLinks=="undefined"?false:i.reloadLinks;if(i.noReload){this.noreload=true;if(this.timeoutDrag){clearTimeout(this.timeoutDrag)}return}else{this.noreload=false;this.parcours.x=0;this.parcours.y=0;if(this.itineraire&&this.itineraire.origine&&this.itineraire.destination){f=this.itineraire.origine.latitude+":"+this.itineraire.origine.longitude+":"+this.itineraire.origine["street-address"]+":"+this.itineraire.origine.locality+":"+this.itineraire.origine["postal-code"];j=this.itineraire.destination.latitude+":"+this.itineraire.destination.longitude+":"+this.itineraire.destination["street-address"]+":"+this.itineraire.destination.locality+":"+this.itineraire.destination["postal-code"];m=this.itineraire.cacheid}if(this.zooming){this.centerAt(i.centerPoint.latitude,i.centerPoint.longitude,this.niveau)}this.reloadInterface();if(this.timeoutDrag){clearTimeout(this.timeoutDrag)}if(this.oInterface.params.modeROD){this.updateLayer("DEFAULT");this.updateLayer("ETAPE");if(!d.isEmptyObject(this.oInterface.aL[this.niveau])){this.handleLines()}if(!d.isEmptyObject(this.request)){g=this.dimVisCarte.width===0?this.oInterface.oConfig.width:this.dimVisCarte.width;n=this.dimVisCarte.height===0?this.oInterface.oConfig.height:this.dimVisCarte.height;l="key="+this.request.key+"&rodid="+this.request.rodid+"&guid="+this.request.guid+"&L="+g+"&H="+n+"&return=json";l+="&lat="+i.centerPoint.latitude+"&lon="+i.centerPoint.longitude+"&level="+this.niveau;if(this.request.startIcon){l+="&startIcon="+this.request.startIcon.url+";"+this.request.startIcon.width+";"+this.request.startIcon.height}if(this.request.endIcon){l+="&endIcon="+this.request.endIcon.url+";"+this.request.endIcon.width+";"+this.request.endIcon.height}if(this.request.alternative){l+="&alternative="+this.request.alternative}if(this.request.debug){l+="&debug="+this.request.debug}this.timeoutDrag=setTimeout(function(){k.oInterface.sendData(l,k.oInterface.oConfig.RODUrl+"get_drawings/",k.oInterface.oConfig.ajaxParams.method,null,i.callback)},1000);return}}this.updateLayer("DEFAULT");if(!this.oInterface.params.requestTC){return}if(this.modeCarte=="ITINERAIRE"){g=this.dimVisCarte.width===0?this.oInterface.oConfig.width:this.dimVisCarte.width;n=this.dimVisCarte.height===0?this.oInterface.oConfig.height:this.dimVisCarte.height;this.itineraire.modeSwitcher();l="xcenter="+i.centerPoint.latitude+"&ycenter="+i.centerPoint.longitude+"&level="+this.niveau+"&L="+g+"&H="+n+"&trajet="+this.itineraire.trajet+"&parcours="+this.itineraire.parcours;if(this.itineraire.selected){l+="&selected="+this.itineraire.selected}if(f&&j){l+="&origine="+f+"&destination="+j}if(m){l+="&cacheid="+m}if(i.reloadLinks){l+="liens=yes"}this.timeoutDrag=setTimeout(function(){k.oInterface.sendData(l,k.oInterface.oConfig.rootUrl+"itimap.php",k.oInterface.oConfig.ajaxParams.method)},1000)}else{l="E_center="+i.centerPoint.latitude+"&N_center="+i.centerPoint.longitude+"&level="+this.niveau+"&L="+this.dimVisCarte.width+"&H="+this.dimVisCarte.height;if(!d.isEmptyObject(this.oInterface.aL[this.niveau])){this.handleLines()}if(this.itineraire){if(f&&j){l+="&origine="+f;l+="&destination="+j}}if(this.oInterface.modeSel&&this.oInterface.modeSel.length>0&&this.oInterface.doCheck){h=this.oInterface.modeSel.join("_");l+="&derMode="+h}else{if(this.oInterface.doCheck){this.noreload=true;this.setInformationLayer(this.modeCarte);return}}if(!this.zooming){}this.timeoutDrag=setTimeout(function(){k.oInterface.sendData(l,k.oInterface.oConfig.rootUrl+"inmap.php",k.oInterface.oConfig.ajaxParams.method)},1000)}}};b.Carte.prototype.removeEtiquettes=function(){return};b.Carte.prototype.createPDF=function(f){var i=arguments.length==2&&typeof arguments[1]=="object"?arguments[1]:{},g;i.tuile=typeof i.tuile=="undefined"?this.maintile:i.tuile;i.x=typeof i.x=="undefined"?this.centerPoint.latitude:i.x;i.y=typeof i.y=="undefined"?this.centerPoint.longitude:i.y;i.width=typeof i.width=="undefined"?this.dimVisCarte.width:i.width;i.height=typeof i.height=="undefined"?this.dimVisCarte.height:i.height;i.href=typeof i.href=="undefined"?null:i.href;if(d("#pdfLink").length===0){return}d("#pdfLink").show();if(this.oInterface.pdfhreflink){if(i.href){f.attr({href:i.href,title:"Voir le PDF"});f.text("Voir le PDF");return}else{g=this.oInterface.oConfig.rootUrl+"pdfing.php?"+this.oInterface.pdfhreflink;this.getAllPuns(i.x,i.y,2083,2083);this.getAllSegs(i.x,i.y)}}else{g=this.oInterface.oConfig.rootUrl+"pdfing.php?x_center="+i.x+"&y_center="+i.y+"&level="+this.niveau;g+="&w="+i.width+"&h="+i.height;this.getAllPuns(i.x,i.y,i.width,i.height);this.getAllSegs(i.x,i.y)}if(this.stops&&this.stops.length>0){g+="&"+d.param({stops:this.stops.join(";")})}if(this.flags&&this.flags.length>0){g+="&"+d.param({flags:this.flags.join(";")})}if(this.segs&&this.segs.length>0){g+="&"+d.param({segs:this.segs.join(";")})}if(this.modeCarte=="ITINERAIRE"&&this.itineraire.trajet&&this.itineraire.parcours){g+="&"+d.param({trajet:this.itineraire.trajet.join(","),parcours:this.itineraire.parcours.join(",")});g+="&cacheid="+this.itineraire.cacheid}f.attr("href",g)};b.Carte.prototype.getAllPuns=function(t,s,h,v){if(!this.oInterface.aP||!this.oInterface.aP[this.niveau]){return}this.stops=[];this.flags=[];var o=this,w=this.oInterface.oConfig.stopPointPath,p=this.oInterface.oConfig.resolution[this.niveau],r=this.oInterface.aP[this.niveau].length,f=parseInt(t,10)-parseInt((h/2)*p,10),m=parseInt(t,10)+parseInt((h/2)*p,10),u=parseInt(s,10)-parseInt((v/2)*p,10),i=parseInt(s,10)+parseInt((v/2)*p,10),q,g,n,k,l;d("img.dispinfo[id!=p_center][id!=p_origine][id!=p_destination]",this.oHTML).filter(":not([class*=fake])").each(function(){if(d.data(this,"latitude")>f&&d.data(this,"latitude")<m&&d.data(this,"longitude")>u&&d.data(this,"longitude")<i){for(l=0;l<r;l++){if(d.inArray(this.id,o.oInterface.aP[o.niveau][l])!=-1){k=l;break}else{continue}}if(typeof k!="undefined"){q="A";q+="_"+o.oInterface.aP[o.niveau][k][3]+"_"+d.data(this.parentNode,"lignes");g=d(this).attr("src").substring(d(this).attr("src").indexOf(w)+w.length+3,d(this).attr("src").length-4);n=q+":"+d.data(this,"latitude")+":"+d.data(this,"longitude")+":"+g;if(d.inArray(n,o.stops)==-1){o.stops.push(n)}}}});if(this.modeCarte=="ITINERAIRE"){d("img#p_origine",this.oHTML).add(d("img#p_destination",this.oHTML)).each(function(){g=d(this).attr("src").substring(d(this).attr("src").indexOf(w)+w.length,d(this).attr("src").length-4);n=d.data(this,"latitude")+":"+d.data(this,"N")+":"+g;if(d.inArray(n,o.flags)==-1){o.flags.push(n)}})}};b.Carte.prototype.getAllSegs=function(f,h){var g=this;this.segs=[];d("div.ligne",this.oHTML).each(function(){if(d.inArray(this.id,g.segs)==-1&&g.modeCarte!="ITINERAIRE"){g.segs.push(this.id)}})};b.Carte.prototype.definePoint=function(g){this.oConteneur.oInterface.aP[this.oConteneur.niveau]=[];if(this.origine&&g[0]==this.origine.id){d("#"+this.origine.id).parent().remove()}if(this.destination&&g[0]==this.destination.id){d("#"+this.destination.id).parent().remove()}this.oConteneur.oInterface.aP[this.oConteneur.niveau].push(g);this.oConteneur.n[g[0]]=new b.Marker(this.oConteneur,g[1],g[2],g[0]);this.oConteneur.n[g[0]].createPun({type:"ETAPE",img_info:element[4]});this.oConteneur.n[g[0]].displayEtiquette(false);this.setOrigineDestination();if(this.origine&&this.destination){var f=this,h="E_origine="+this.origine.latitude+"&N_origine="+this.origine.longitude;h+="&E_destination="+this.destination.latitude+"&N_destination="+this.destination.longitude;h+="&userChoice=yes&lang="+this.oConteneur.oInterface.lang;d("#menugauche").empty();this.oConteneur.oInterface.sendData(h,"./gen_include/itineraire.php","POST",d("#menugauche"),function(){f.init();f.oConteneur.modeCarte="ITINERAIRE";f.oConteneur.zoomAt(d("#itioverview").attr("xcenter"),d("#itioverview").attr("ycenter"),d("#itioverview").attr("level"));if(!f.listeResume){return false}for(var j=0;j<f.listeResume.length;j++){if(f.listeResume[j].nodeName=="UL"&&moviLib.hasClass(f.listeResume[j],"onit")){f.listeResume[j].firstChild.onclick()}}})}};b.Carte.prototype.requestStopPoints=function(k,m,l,p,n){if(typeof k=="undefined"||typeof m=="undefined"){return}l=l||"nearby";p=p||"0";n=n||"1000";var h=arguments.length==6&&typeof arguments[5]=="object"?arguments[5]:{},o,j,i=this,g=new Date(),f;h.boundary=typeof h.boundary=="undefined"?null:h.boundary;h.icon=typeof h.icon=="undefined"?null:h.icon;h.maxResults=typeof h.maxResults=="undefined"?null:h.maxResults;o=function(){i.zoomToBoundary(i.getBoundsAllMarkers())};j="function="+l+"&latitude="+k+"&longitude="+m+"&return=json";if(l=="nearby"){j+="&distance="+n+"&style=full"}if(l=="isochrone"){f=g.getFullYear()+"-"+d.str_pad(String(g.getMonth()+1),2,"0")+"-"+d.str_pad(String(g.getDate()),2,"0")+"T09:00";j+="&minminutes="+p+"&maxminutes="+n+"&date="+f}if(h.icon){j+="&icon="+h.icon.url+";"+h.icon.width+";"+h.icon.height}this.oInterface.params.requestTC=false;this.oInterface.sendData(j,this.oInterface.oConfig.rootUrl+"inmap.php",this.oInterface.oConfig.ajaxParams.method,null,o);return};b.Carte.prototype.requestPOIs=function(f,h){if(typeof f!=="string"&&typeof h!=="string"){return}var j=arguments.length==3&&typeof arguments[2]=="object"?arguments[2]:{},k,i,g=this;j.boundary=typeof j.boundary=="undefined"?null:j.boundary;j.icon=typeof j.icon=="undefined"?null:j.icon;j.maxResults=typeof j.maxResults=="undefined"?null:j.maxResults;j.showBestZoom=typeof j.showBestZoom=="undefined"?true:j.showBestZoom;k=j.showBestZoom?function(){g.zoomToBoundary(g.getBoundsAllMarkers())}:null;i="key=8y6e8ybe&domaine="+f+"&nature="+h+"&return=json";if(j.icon){i+="&icon="+j.icon.url+";"+j.icon.width+";"+j.icon.height}this.oInterface.sendData(i,this.oInterface.oConfig.RODUrl+"get_pois/",this.oInterface.oConfig.ajaxParams.method,null,k);return};b.Carte.prototype.requestRoute=function(f,g){var i=arguments.length==3&&typeof arguments[2]=="object"?arguments[2]:{},h;"key" in i||(i.key="8y6e8ybe");"debug" in i||(i.debug=0);this.request={key:i.key,rodid:f,guid:g,debug:i.debug};this.oInterface.params.modeROD=true;h="key="+i.key+"&rodid="+f+"&guid="+g+"&L="+this.dimVisCarte.width+"&H="+this.dimVisCarte.height+"&return=json";if(i.startIcon){this.request.startIcon=i.startIcon;h+="&startIcon="+i.startIcon.url+";"+i.startIcon.width+";"+i.startIcon.height}if(i.endIcon){this.request.endIcon=i.endIcon;h+="&endIcon="+i.endIcon.url+";"+i.endIcon.width+";"+i.endIcon.height}if(i.alternative){this.request.alternative=i.alternative;h+="&alternative="+i.alternative}if(i.debug){h+="&debug="+i.debug}this.oInterface.sendData(h,this.oInterface.oConfig.RODUrl+"get_drawings/",this.oInterface.oConfig.ajaxParams.method);return};b.Carte.prototype.requestformItineraire=function(f){d("li","#onglet").removeClass("onit").filter("#ongIti").addClass("onit");d("#"+this.oInterface.oConfig.panel).empty();this.oInterface.sendData(d.param(f),this.oInterface.oConfig.rootUrl+"itineraire.php",this.oInterface.oConfig.ajaxParams.method,d("#"+this.oInterface.oConfig.panel),function(){onLoadFunctions()});return};b.Carte.prototype.starthere=function(h,g){var k=this.layer[g.data("type")][g.attr("id")],f=k.params.type=="ARRET"&&!k.isPole?k.params.label+" ("+locales.fr.lstMode[k.mode[0].charAt(0)]+")":k.params.label,j={q:"formiti",lang:this.oInterface.lang,ville_from:k.params.city.name+" ("+k.params.city.zipcode+")",adresse_from:f,ac_location_ville_from:k.params.city.latitude+":"+k.params.city.longitude,ac_location_adresse_from:k.latitude+":"+k.longitude,ac_flag_from:"yes",L:this.dimVisCarte.width,H:this.dimVisCarte.height},i,l;if(d("#search_iti_from","#"+this.oInterface.oConfig.panel).length===0){this.requestformItineraire(j)}else{for(l in j){i=d("#"+l,"#search_iti_from");if(i.length&&i.is("input")){i.val(j[l]);if(i.is(".dynvalue")){i.resetInputs()}}}}return false};b.Carte.prototype.endhere=function(h,g){var k=this.layer[g.data("type")][g.attr("id")],f=k.params.type=="ARRET"&&!k.isPole?k.params.label+" ("+locales.fr.lstMode[k.mode[0].charAt(0)]+")":k.params.label,j,i,l;if(c.client&&k.params.type=="DEFAULT"){c.location.href=moviLib.baseURL+this.oInterface.lang+"/itineraire/"+c.client+"/"+g.attr("id");return false}j={q:"formiti",lang:this.oInterface.lang,ville_to:k.params.city.name+" ("+k.params.city.zipcode+")",adresse_to:f,ac_location_ville_to:k.params.city.x+":"+k.params.city.y,ac_location_adresse_to:k.latitude+":"+k.longitude,ac_flag_to:"yes",L:this.dimVisCarte.width,H:this.dimVisCarte.height};if(d("#search_iti_to","#"+this.oInterface.oConfig.panel).length===0){this.requestformItineraire(j)}else{for(l in j){i=d("#"+l,"#search_iti_to");if(i.length&&i.is("input")){i.val(j[l]);if(i.is(".dynvalue")){i.resetInputs()}}}}return false};b.Carte.prototype.centerhere=function(g,f){this.moveToCoords(d.data(f.get(0),"latitude"),d.data(f.get(0),"longitude"),this.niveau)};b.Carte.prototype.departureStage=function(g,f){if(d("#p_origine",this.oHTML).length>0){var f=d("#p_origine",this.oHTML);f.eq(0).trigger("mouseover")}};b.Carte.prototype.firstStage=function(g,f){if(d("#it-roadmap-stage-1").length>0){d("#it-roadmap-stage-1").eq(0).trigger("click")}};b.Carte.prototype.prevStage=function(h,g){var f=g.attr("id").replace(/it-stage-(\d+)/,function(j,k){return"it-roadmap-stage-"+(Number(k)-1)}),i=d("#"+f);if(/it-roadmap-stage-([0-9]+)/.test(f)){i.trigger("click")}};b.Carte.prototype.nextStage=function(i,h){var g=h.attr("id").replace(/it-stage-(\d+)/,function(j,k){return"it-roadmap-stage-"+(Number(k)+1)}),f=d("#"+g);if(/it-roadmap-stage-([0-9]+)/.test(g)){f.trigger("click")}};b.Carte.prototype.lastStage=function(g,f){if(d(".it-stage").length>0){d(".it-stage").last().trigger("click")}};b.Carte.prototype.arrivalStage=function(g,f){if(d("#p_destination",this.oHTML).length>0){var f=d("#p_destination",this.oHTML);f.eq(0).trigger("mouseover")}};b.Carte.prototype.zoomInPun=function(h,g){var f,i;if(g.attr("id")=="p_center"){if(h.which){f=(h.which==3)}else{if(h.button){f=(h.button==2)}}i=(f===true)?this.nextNiv(this.niveau):this.prevNiv(this.niveau)}else{i=17}this.zoomAt(d.data(g.get(0),"latitude"),d.data(g.get(0),"longitude"),i)};b.Carte.prototype.zoomAt=function(q,g,j,t){if(j<this.oInterface.oConfig.firstNiv||j>this.oInterface.oConfig.lastNiv){return}if(j==this.niveau){this.zooming=false;this.moveToCoords(q,g);this.rebindWheel();return}var o=this,n=this.niveau,p=Math.pow(2,(j-n)),k=this.latlongToPixel(q,g,n),i=Math.floor(k.x-this.centerCoord_px.E),f=Math.floor(k.y-this.centerCoord_px.N),l=(Math.abs(j-n)<3&&(i<this.dimVisCarte.width/2||f<this.dimVisCarte.height/2))?true:false,r,m,s,h;t=t||null;if(this.previousTilesWrapper&&this.previousTilesWrapper.length>0){this.previousTilesWrapper.remove();this.previousTilesWrapper=null}this.removeEle();l=true;if(l){this.oHTML.css({width:this.dimTable.width,height:this.dimTable.height});r=p*this.oInterface.oConfig.tileHeight;m=p*this.oInterface.oConfig.tileWidth;s=(this.oHTML.position().left-i)*p;h=(this.oHTML.position().top-f)*p;this.oHTML.stop().animate({width:m*this.iterTiles.x,height:r*this.iterTiles.y,left:s,top:h},{duration:250,step:function(w,z){var x,v,u,y;for(x=0;x<o.iterTiles.x;x++){for(v=0;v<o.iterTiles.y;v++){if(z.prop=="width"){u=Math.floor((w-o.dimVisCarte.width)/2);o.lstimg[x][v].width(Math.round(w/o.iterTiles.x));o.lstimg[x][v].get(0).style.left=-u+((o.curLeftOffset+x)*(Math.floor(w/o.iterTiles.x)))+"px"}if(z.prop=="height"){y=Math.floor((w-o.dimVisCarte.height)/2);o.lstimg[x][v].height(Math.round(w/o.iterTiles.y));o.lstimg[x][v].get(0).style.top=-y+((o.curTopOffset+v)*(Math.floor(w/o.iterTiles.y)))+"px"}}}},complete:function(){o.afterZooming(q,g,j,t)}}).css("overflow","visible")}else{this.updateDatas()}};b.Carte.prototype.zoomToBoundary=function(j,m){m=m||null;if(!d.isFunction(j.getBounds)||!d.isPlainObject(j.getBounds())){return}if(j.isEmptyBounds()){return}var h=this.getZoomForBoundary(j),g=this.latlongToPixel(j.latmax,j.longmin,h),n=this.latlongToPixel(j.latmin,j.longmax,h),i=new b.point(g.x,g.y),f=new b.point(n.x,n.y),k=i.center(f),l=this.pixelToLatlong(k.E,k.N,h);if(l.latitude==this.centerPoint.latitude&&l.longitude==this.centerPoint.longitude){return}(h==this.niveau)?this.moveToCoords(l.latitude,l.longitude,m):this.zoomAt(l.latitude,l.longitude,h,m)};b.Carte.prototype.getZoomForBoundary=function(m){var l=0,g,f=this.latlongToPixel(m.latmax,m.longmin,0),k=this.latlongToPixel(m.latmin,m.longmax,0),j,h;for(g=0;g<=this.oInterface.oConfig.lastNiv;g++){j=this.latlongToPixel(m.latmax,m.longmin,g);h=this.latlongToPixel(m.latmin,m.longmax,g);if(Math.abs(h.x-j.x)>this.dimVisCarte.width||Math.abs(h.y-j.y)>this.dimVisCarte.height){break}l=g;f=j;k=h}return l};b.Carte.prototype.afterZooming=function(l,i,k,j){j=j||null;var f=this,h=this.niveau,g=this.latlongToPixel(l,i,k);this.niveau=this.clipValue(k,this.oInterface.oConfig.firstNiv,this.oInterface.oConfig.lastNiv);this.letterLevel=this.correspondingOldLevel(this.niveau);this.latitude=l;this.longitude=i;this.setCenterCoord(g.x,g.y);this.oInterface.aL[this.niveau]=this.oInterface.aL[h];this.oInterface.aP=[];this.oInterface.aL[h]=[];this.zooming=true;this.posSlide();this.previousTilesWrapper=this.oHTML.clone().css({position:"absolute"}).removeAttr("id").find("img").unbind("load").removeAttr("id").removeClass("drag").end().insertBefore(this.oHTML);this.previousTilesWrapper.children("div").slice(1).remove();this.oHTML.width(this.dimTable.width);this.oHTML.height(this.dimTable.height);this.updateDatas({callback:j});this.rebindWheel()};b.Carte.prototype.switchMode=function(f){if(this.modeCarte!=f){this.modeCarte=f}else{return}this.oInterface.aP=[];this.oInterface.aL=[];this.updateDatas()};b.Carte.prototype.clicOnLigne=function(g,i){g.stopPropagation();if(d.data(i,"mode")=="T"||this.modeCarte=="ITINERAIRE"){return}var f=d.data(i,"ligne"),h=d("#"+f);if(h.length===0){this.loadLine(f,d.data(i,"mode"))}else{(h.css("display")=="none")?this.showLine(f):this.removeLine(f,d.data(i,"mode"))}};b.Carte.prototype.showLine=function(f){d("#"+f).show();this.highlightLigne(f);if(d.inArray(f,this.oInterface.affLigne)==-1){this.oInterface.affLigne.unshift(f)}return};b.Carte.prototype.loadLine=function(f,h){if(d("#"+f).length>0){this.showLine(f);return}if(d.inArray(f,this.oInterface.affLigne)==-1){this.oInterface.affLigne.unshift(f)}var g="E_px="+this.centerCoord_px.E+"&N_px="+this.centerCoord_px.N+"&E_ref="+this.centerPoint.latitude+"&N_ref="+this.centerPoint.longitude+"&level="+this.niveau+"&L="+this.dimVisCarte.width+"&H="+this.dimVisCarte.height;g+="&singleLine="+f;this.oInterface.sendData(g,this.oInterface.oConfig.rootUrl+"inmap.php",this.oInterface.oConfig.ajaxParams.method);return};b.Carte.prototype.removeLine=function(g,h){if(d("#infoLigne").length>0){d("#infoLigne").remove()}d("#"+g).hide();this.unHighlightLigne(g);if(d.inArray(g,this.oInterface.affLigne)!=-1){this.oInterface.affLigne.splice(d.inArray(g,this.oInterface.affLigne),1)}var f=d.grep(this.oInterface.aL[this.niveau],function(j,i){return j.id===g});return};b.Carte.prototype.highlightLigne=function(f){var i=this,g,j,k,l,h;d("div.divinfo:data(lignes=/.*\\b"+f+"\\b.*/)").each(function(m){if(d(this).css("z-index")!=i.oInterface.oConfig.ZINDEX.HOVER){d(this).css("z-index",i.oInterface.oConfig.ZINDEX.ARRET_LINE_DISPLAYED)}d("img.dispinfo:data(src_on)",this).each(function(n){g=d(this);g.width(d.data(this,"width_on"));g.height(d.data(this,"height_on"));j=d.data(this,"src_on");if(j.indexOf(",",0)==-1){l=0;g.attr("src",j)}else{k=d.data(this.parentNode,"lignes").split(",");l=d.inArray(f,k);h=j.split(",");g.attr("src",h[l])}if(d.data(this,"mode").toString().charAt(0)=="B"||d.data(this,"mode").toString().charAt(0)=="C"){if(g.parent().css("z-index")!=i.oInterface.oConfig.ZINDEX.HOVER){g.parent().css("z-index",i.oInterface.oConfig.ZINDEX.ETAPE)}}});d(this).find("li:data( ligne="+f+")").each(function(n){d(this).addClass("disp")})})};b.Carte.prototype.unHighlightLigne=function(f){var h=this,g;d("div.divinfo:data(lignes=/.*\\b"+f+"\\b.*/)").each(function(i){if(d(this).css("z-index")!=h.oInterface.oConfig.ZINDEX.HOVER){d(this).css("z-index",h.oInterface.oConfig.ZINDEX.ARRET)}d("img.dispinfo:data(src_on)",this).each(function(j){g=d(this);g.width(d.data(this,"defaultwidth"));g.height(d.data(this,"defaultheight"));g.attr("src",d.data(this,"defaultsrc"));if(d.data(this,"mode").toString().charAt(0)=="B"||d.data(this,"mode").toString().charAt(0)=="C"){if(g.parent().css("z-index")!=h.oInterface.oConfig.ZINDEX.HOVER){g.parent().css("z-index",h.oInterface.oConfig.ZINDEX.ARRETBUS)}}});d(this).find("li:data(ligne="+f+")").each(function(j){d(this).removeClass("disp")})})};b.Carte.prototype.removeEle=function(){if(this.oHTML.children().length){d(".divinfo",this.oHTML).each(function(f){d(this).remove()});if(d(".ligne",this.oHTML).length>0){d(".ligne",this.oHTML).each(function(f){d(this).remove()})}if(d(".isochrone",this.oHTML).length>0){d(".isochrone",this.oHTML).each(function(f){d(this).remove()})}}};b.Carte.prototype.createLnkPDF=function(){if(d("#pdfLink").length===0){if(d("#itiActions").length!==0){d("#itiActions").prepend('<a id="pdfLink" class="externe" href="javascript:void(0)" title="'+locales[this.oInterface.lang].exportPDF+'"><img width="27" height="27" src="../images/pdf.png" alt="'+locales[this.oInterface.lang].exportPDF+'"/></a>')}else{d('<div><a id="pdfLink" class="externe" href="javascript:void(0)" title="'+locales[this.oInterface.lang].exportPDF+'">'+locales[this.oInterface.lang].exportPDF+"</a></div>").css({right:this.oMask.position().left+this.oMask.width()-10,top:this.oMask.position().top-10}).hide().appendTo(this.oConteneur.parent())}}return};b.Carte.prototype.createLevelControl=function(k){if(!this.levelControl){var i=this,h,n,f,j,m,g;this.levelControl=d('<ul id="levelControl"></ul>');this.levelControl.css({top:this.oMask.position().top+14});h=d('<li id="derouleur"></li>');n=d('<a class="toup" href="javascript:void(0)" title="'+locales[this.oInterface.lang].fermer+'"></a>');n.click(function(){if(d(this).is(".todown")){d(this).addClass("toup").removeClass("todown").attr("title",locales[i.oInterface.lang].fermer);f=d.data(i.levelControl.get(0),"defaultHeight");i.levelControl.animate({height:f},500)}else{d(this).addClass("todown").removeClass("toup").attr("title",locales[i.oInterface.lang].ouvrir);i.levelControl.css("overflow","hidden");if(!d.data(i.levelControl.get(0),"defaultHeight")){d.data(i.levelControl.get(0),"defaultHeight",i.levelControl.height())}i.levelControl.animate({height:this.offsetHeight},500)}});h.append(n);this.levelControl.append(h);j=d('<li id="zoom-out"></li>');j.click(function(){i.appliZoom(this.id);return false});n=d('<a href="javascript:void(0)" tabindex="-1" title="'+locales[this.oInterface.lang].zoommoins+'"></a>');j.append(n);this.levelControl.append(j);if(this.oInterface.oConfig.levelControl=="normal"){g=d('<li id="zoomslider"></li>');this.levelControl.append(g)}m=d('<li id="zoom-in"></li>');m.click(function(){i.appliZoom(this.id);return false});n=d('<a href="javascript:void(0)" tabindex="-1" title="'+locales[this.oInterface.lang].zoomplus+'"></a>');m.append(n);this.levelControl.append(m);k.append(this.levelControl)}if(this.oInterface.params.levelControl==="none"){this.levelControl.hide()}d("#zoomslider").slider({orientation:"vertical",min:0*100,max:17*100,value:this.oInterface.params.level*100,create:function(l,o){d("#zoomslider").slider("value",i.oInterface.params.level*100)},change:function(l,o){if(l.originalEvent&&l.originalEvent.type=="mouseup"){return}d(o.handle).attr("title",i.getLevel())},stop:function(l,o){i.appliZoom(Math.round(o.value/100))}})};b.Carte.prototype.getLevel=function(){return this.niveau};b.Carte.prototype.createContour=function(f){if(!this.contour){this.contour=d('<div id="navigationControl"><div id="nw"></div><div id="sw"></div><div id="ne"></div><div id="se"></div><div id="west"></div><div id="north"></div><div id="east"></div><div id="south"></div></div>');f.append(this.contour);if(this.oInterface.params.device=="defaults"){d("#nw").hover(function(g){this.style.backgroundPosition="-10px -40px"},function(g){this.style.backgroundPosition="-10px -10px"});d("#sw").hover(function(g){this.style.backgroundPosition="-10px -100px"},function(g){this.style.backgroundPosition="-10px -70px"});d("#ne").hover(function(g){this.style.backgroundPosition="-40px -40px"},function(g){this.style.backgroundPosition="-40px -10px"});d("#se").hover(function(g){this.style.backgroundPosition="-40px -100px"},function(g){this.style.backgroundPosition="-40px -70px"});d("#west").hover(function(g){this.style.backgroundPosition="-100px -10px"},function(g){this.style.backgroundPosition="-80px -10px"});d("#south").hover(function(g){this.style.backgroundPosition="-80px -110px"},function(g){this.style.backgroundPosition="-80px -90px"});d("#north").hover(function(g){this.style.backgroundPosition="-80px -70px"},function(g){this.style.backgroundPosition="-80px -50px"});d("#east").hover(function(g){this.style.backgroundPosition="-140px -10px"},function(g){this.style.backgroundPosition="-120px -10px"})}}};b.Carte.prototype.clickContour=function(f){switch(f.id){case"nw":this.moveCarte(Math.floor(this.dimVisCarte.width/2),Math.floor(this.dimVisCarte.height/2));break;case"sw":this.moveCarte(Math.floor(this.dimVisCarte.width/2),-Math.floor(this.dimVisCarte.height/2));break;case"ne":this.moveCarte(-Math.floor(this.dimVisCarte.width/2),Math.floor(this.dimVisCarte.height/2));break;case"se":this.moveCarte(-Math.floor(this.dimVisCarte.width/2),-Math.floor(this.dimVisCarte.height/2));break;case"west":this.moveCarte(Math.floor(this.dimVisCarte.width/2),0);break;case"south":this.moveCarte(0,-Math.floor(this.dimVisCarte.height/2));break;case"north":this.moveCarte(0,Math.floor(this.dimVisCarte.height/2));break;case"east":this.moveCarte(-Math.floor(this.dimVisCarte.width/2),0);default:break}return};b.Carte.prototype.upDateContour=function(){var g=this.contour.children("div"),f=this.oMask.position(),h;for(h=0;h<g.length;h++){switch(g[h].id){case"nw":g[h].style.top=parseInt(f.top,10)+"px";g[h].style.left=parseInt(f.left,10)+"px";break;case"west":g[h].style.top=(parseInt(f.top,10)+Math.floor(this.oMask.height()/2))-Math.floor(g[h].offsetHeight/2)+"px";g[h].style.left=parseInt(f.left,10)+"px";break;case"sw":g[h].style.top=(parseInt(f.top,10)+this.oMask.height())-g[h].offsetHeight+"px";g[h].style.left=parseInt(f.left,10)+"px";break;case"north":g[h].style.top=parseInt(f.top,10)+"px";g[h].style.left=(parseInt(f.left,10)+Math.floor(this.oMask.width()/2))-Math.floor(g[h].offsetWidth/2)+"px";break;case"ne":g[h].style.top=parseInt(f.top,10)+"px";g[h].style.left=(parseInt(f.left,10)+this.oMask.width())-g[h].offsetWidth+"px";break;case"east":g[h].style.top=(parseInt(f.top,10)+Math.floor(this.oMask.height()/2))-Math.floor(g[h].offsetHeight/2)+"px";g[h].style.left=parseInt(f.left,10)+this.oMask.width()-Math.floor(g[h].offsetWidth)+"px";break;case"south":g[h].style.top=parseInt(f.top,10)+this.oMask.height()-Math.floor(g[h].offsetHeight)+"px";g[h].style.left=(parseInt(f.left,10)+Math.floor(this.oMask.width()/2))-Math.floor(g[h].offsetWidth/2)+"px";break;case"se":g[h].style.left=(parseInt(f.left,10)+this.oMask.width())-g[h].offsetWidth+"px";g[h].style.top=(parseInt(f.top,10)+this.oMask.height())-g[h].offsetHeight+"px";break}}};b.Carte.prototype.moveToCoords=function(k,i,j){var h=this.latlongToPixel(k,i,this.niveau),g=Math.floor(h.x-this.centerCoord_px.E),f=Math.floor(h.y-this.centerCoord_px.N);j=j||null;if(Math.abs(g)<=this.dimVisCarte.width&&Math.abs(f)<=this.dimVisCarte.height){this.moveCarte(-g,-f,j)}else{this.removeEle();this.centerAt(k,i,this.niveau);this.updateDatas({callback:j})}};b.Carte.prototype.moveCarte=function(g,f,k){var h=this,j,i;k=k||null;if(this.niveau===0){return}if(this.previousTilesWrapper&&this.previousTilesWrapper.length>0){this.previousTilesWrapper.remove();this.previousTilesWrapper=null}this.deplace.x=g;this.deplace.y=f;this.parcours=new b.deplacement(0,0);j=parseInt(this.oHTML.css("left"),10)+g;i=parseInt(this.oHTML.css("top"),10)+f;this.oHTML.stop().animate({left:j,top:i},{duration:500,complete:function(){h.onDeplacement(new b.deplacement(g,f));h.dragTiles();h.oInterface.movedAndReload(k)}})};b.Carte.prototype.onDeplacement=function(h){var g=this.centerCoord_px.E-h.x,i=this.centerCoord_px.N-h.y,f=this.pixelToLatlong(g,i,this.niveau);this.latitude=f.latitude;this.longitude=f.longitude;this.setCenterCoord(g,i)};b.Carte.prototype.displayLignes=function(){if(this.oInterface.aL[this.niveau]){var f=this;d.map(this.oInterface.aL[this.niveau],function(g){if(!g.id||g.id.length===0){return}if(d.inArray(g.id,f.oInterface.affLigne)==-1){return}d(".ligne:data(mode=B)",f.oHTML).add(".ligne:data(mode=C)",f.oHTML).each(function(h){if(d.inArray(this.id,f.oInterface.affLigne)!=-1){f.unHighlightLigne(this.id);f.oInterface.affLigne.splice(d.inArray(this.id,f.oInterface.affLigne),1);d(this).remove()}});new b.Path(f,g)});if(this.oInterface.affLigne.length>0){d.map(this.oInterface.affLigne,function(g){f.highlightLigne(g)})}}};b.Carte.prototype.drawPolygon=function(g){var f=this;d.map(g,function(h){new b.Polygon(f,h)})};b.Carte.prototype.zoomWheel=function(h,j){var f=this,g=d("#zoomslider"),j=(j<0)?-1:1,i=Math.round(g.slider("value")/100)+j;i=f.clipValue(i,f.oInterface.oConfig.firstNiv,f.oInterface.oConfig.lastNiv);g.slider("value",i*100);if(this.timeoutWheel){clearTimeout(this.timeoutWheel)}this.timeoutWheel=setTimeout(function(){var l=f.centerCoord_px.E+h.pageX-(f.dimVisCarte.left+Math.floor(f.dimVisCarte.width/2)),m=f.centerCoord_px.N+h.pageY-(f.dimVisCarte.top+Math.floor(f.dimVisCarte.height/2)),k=f.pixelToLatlong(l,m,f.niveau);f.oHTML.unbind("mousewheel");d(c).bind("mousewheel",function(n){return false});f.zoomAt(k.latitude,k.longitude,i)},250)};b.Carte.prototype.rebindWheel=function(){var f=this;d(c).unbind("mousewheel");this.oHTML.unbind("mousewheel").bind("mousewheel",function(i,j,h,g){f.zoomWheel(i,j,h,g);return false})};b.Carte.prototype.zoomin=function(j){this.zooming=true;if(this.dragapproved){this.dragapproved=false;return false}var h=this,m=d(j.target).parent(),l,k,g,i,f;if(m[0].parentNode){l=m.parent();switch(j.type){case"dblclick":if(m.attr("id")==this.oHTML.attr("id")||l.attr("id")==this.oHTML.attr("id")){g=this.centerCoord_px.E+j.pageX-(this.dimVisCarte.left+Math.floor(this.dimVisCarte.width/2));i=this.centerCoord_px.N+j.pageY-(this.dimVisCarte.top+Math.floor(this.dimVisCarte.height/2));f=this.pixelToLatlong(g,i,this.niveau);k=this.prevNiv(this.niveau);this.zoomAt(f.latitude,f.longitude,k)}break;case"rightdblclick":if(m.attr("id")==this.oHTML.attr(" id")||l.attr("id")==this.oHTML.attr("id")){g=this.centerCoord_px.E+j.pageX-(this.dimVisCarte.left+Math.floor(this.dimVisCarte.width/2));i=this.centerCoord_px.N+j.pageY-(this.dimVisCarte.top+Math.floor(this.dimVisCarte.height/2));f=this.pixelToLatlong(g,i,this.niveau);k=this.nextNiv(this.niveau);this.zoomAt(f.latitude,f.longitude,k)}break;case"gesturestart":this.oHTML.bind("gesturechange",function(n){h.zoomin(n)});this.oHTML.bind("gestureend",function(n){h.zoomin(n)});break;case"gesturechange":j.preventDefault();this.oInterface.oConfig.scale=j.originalEvent.scale;break;case"gestureend":this.oHTML.unbind("gesturechange",function(n){h.zoomin(n)});this.oHTML.unbind("gestureend",function(n){h.zoomin(n)});if(this.oInterface.oConfig.scale<1){k=this.prevNiv(this.niveau);this.zoomAt(this.centerPoint.latitude,this.centerPoint.longitude,k)}if(this.oInterface.oConfig.scale>1){k=this.nextNiv(this.niveau);this.zoomAt(this.centerPoint.latitude,this.centerPoint.longitude,k)}break;default:break}}};b.Carte.prototype.dragTiles=function(){var f=this.getCurOffset();while(f.width<-this.paddingLeft/2){this.toRight();this.getCurOffset(f)}while(f.width>this.paddingLeft/2){this.toLeft();this.getCurOffset(f)}while(f.height<-this.paddingTop/2){this.toDown();this.getCurOffset(f)}while(f.height>this.paddingTop/2){this.toUp();this.getCurOffset(f)}};b.Carte.prototype.getCurOffset=function(f){if(!f){f=new b.dimensions(null,null,0,0)}f.width=parseInt(this.oHTML.css("left"),10)+this.curLeftOffset*this.oInterface.oConfig.tileWidth;f.height=parseInt(this.oHTML.css("top"),10)+this.curTopOffset*this.oInterface.oConfig.tileHeight;return f};b.Carte.prototype.menuContextuel=function(i){return;var h=this,g=(i.pageX-this.lstimg[0][0].offset().left)-this.centerCoord_px.E,f=(i.pageY-this.lstimg[0][0].offset().top)-this.centerCoord_px.N,k=parseInt(this.centerPoint.latitude,10)+(g*this.oInterface.oConfig.resolution[this.niveau]),j=parseInt(this.centerPoint.longitude,10)-(f*this.oInterface.oConfig.resolution[this.niveau]);if(!this.contextMenu){this.contextMenu=d('<div id="contextMenu"></div>').data("latitude",k).data("longitude",j);this.contextMenu.append(d('<p class="rcquartier"></p>').append(d('<a href="javascript:void(0)">Voir le quartier</a>').click(function(l){h.zoomAt(d("#contextMenu").data("latitude"),d("#contextMenu").data("longitude"),"A")}))).append(d('<p class="rcdepart"></p>').append(d('<a href="javascript:void(0)">Partir de là</a>').click(function(l){if(!h.itineraire){h.itineraire=new b.Itineraire(h)}var m=["p_origine",k,j,{"street-address":"","postal-code":"",locality:"Choisi par user"},"origine.png:61:88"];h.itineraire.definePoint(m)}))).append(d('<p class="rcarrivee"></p>').append(d('<a href="javascript:void(0)">Arriver ici</a>').click(function(l){if(!h.itineraire){h.itineraire=new b.Itineraire(h)}var m=["p_destination",k,j,{"street-address":"","postal-code":"",locality:"Choisi par user"},"destination.png:61:88"];h.itineraire.definePoint(m)})));this.contextMenu.click(function(){d(this).remove();h.contextMenu=null});this.contextMenu.noContext();this.oConteneur.append(this.contextMenu)}else{this.contextMenu=d("#contextMenu").data("latitude",k).data("longitude",j)}if((i.pageX+this.contextMenu.width())>(this.oMask.position().left+this.dimVisCarte.width)){this.contextMenu.css("left",i.pageX-this.contextMenu.width())}else{this.contextMenu.css("left",i.pageX)}if((i.pageY+this.contextMenu.height())>(this.oMask.position().top+this.dimVisCarte.height)){this.contextMenu.css("top",i.pageY-this.contextMenu.height())}else{this.contextMenu.css("top",i.pageY)}return};b.Carte.prototype.mdw=function(f,g){f.stopPropagation();if(this.timeoutDrag){clearTimeout(this.timeoutDrag)}this.mvswt=true;this.mouseup=false;this.antX=g.position.left;this.antY=g.position.top;if(this.previousTilesWrapper&&this.previousTilesWrapper.length>0){this.previousTilesWrapper.remove();this.previousTilesWrapper=null}return true};b.Carte.prototype.mmv=function(f,g){f.stopPropagation();this.mouseup=false;if(this.mvswt){this.dragapproved=true;this.dragTiles()}return true};b.Carte.prototype.mup=function(f,g){this.onDeplacement(new b.deplacement((this.oHTML.position().left-this.antX),(this.oHTML.position().top-this.antY)));this.oHTML.removeClass("grab");f.stopPropagation();this.removeEtiquettes();this.mvswt=false;this.mouseup=true;if(this.dragapproved){this.oInterface.movedAndReload()}this.dragapproved=false;return true};b.Marker=function(f){this._type="Marker";this.oConteneur=f;this.params=arguments.length==2&&typeof arguments[1]=="object"?arguments[1]:{};this.params.type=this.params.type.toUpperCase();this.params.active=typeof this.params.active=="undefined"?false:this.params.active;this.oInterface=this.oConteneur.oInterface;this.id=this.params.id;this.oHTML=null;this.oHTML_img=null;this.latitude=this.params.latitude;this.longitude=this.params.longitude;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.nomStation=null;this.id_div=null;this.classe="dispinfo";this.divClasse="divinfo";this.dimSelectedPun=new b.dimensions(null,null,0,0);this.zindex=this.oInterface.oConfig.ZINDEX.DEFAULT;this.infosLigne=null;this.createPun()};b.Marker.prototype.setMode=function(){return this.params.ligne[1]};b.Marker.prototype.setSrcImg=function(j){var h=this.oInterface.oConfig.stopPointPath+"_"+this.oConteneur.letterLevel+"/",g,f;if(this.params.type=="POI"){h=this.oInterface.oConfig.poisPointPath+"_"+this.oConteneur.letterLevel+"/"}if(this.params.type=="CENTRE"){this.src=j.url;this.width=parseInt(j.width,10);this.height=parseInt(j.height,10);this.zindex=this.oInterface.oConfig.ZINDEX.CENTER}else{if(this.params.type=="FIXE"||this.params.type=="ETAPE"||this.params.type=="DEFAULT"){if(d.isUrl(j.url)){this.src=j.url}else{if(this.mode&&this.mode[0].charAt(0)=="T"){this.src=h+j.url}else{this.src=this.oInterface.oConfig.stopPointPath+j.url}}this.width=parseInt(j.width,10);this.height=parseInt(j.height,10);if(this.params.type=="ETAPE"){this.zindex=this.oInterface.oConfig.ZINDEX.ETAPE}}else{if(!d.isArray(j)){if(!j.url_on){if(j.url.indexOf("_")!=-1){g=j.url.split("_");if(g[1].indexOf("P",0)!=-1){this.typepole=g[1];this.isPole=true}}this.src=h+j.url}else{this.src=h+j.url;this.src_on=h+j.url_on}if(j.width){this.width=parseInt(j.width,10)}if(j.height){this.height=parseInt(j.height,10)}if(j.width_on){this.dimSelectedPun.width=parseInt(j.width_on,10)}if(j.height_on){this.dimSelectedPun.height=parseInt(j.height_on,10)}}else{this.src_on=[];for(f=0;f<j.length;f++){if(!j[f].url_on){if(j[f].url.indexOf("_")!=-1){g=j[f].url.split("_");if(g[1].indexOf("P",0)!=-1){this.typepole=g[1];this.isPole=true}}this.src=h+j[f].url}else{this.src=h+j[f].url;this.src_on[f]=h+j[f].url_on}}if(j[0].width){this.width=parseInt(j[0].width,10)}if(j[0].height){this.height=parseInt(j[0].height,10)}if(j[0].width_on){this.dimSelectedPun.width=parseInt(j[0].width_on,10)}if(j[0].height_on){this.dimSelectedPun.height=parseInt(j[0].height_on,10)}}}}this.anchor=new b.point(Math.floor(this.width/2),Math.floor(this.height/2))};b.Marker.prototype.getCodeLigne=function(){var f=[],j=this.params.ligne[0],h,g;for(h=0;h<j.length;h++){g=j[h].split(":");f.push(g[0])}return f.join(",")};b.Marker.prototype.createPun=function(){var g,h,i,j,f;if(!this.params.ligne){this.mode=null}else{this.mode=this.setMode();this.zindex=(this.mode[0].charAt(0)=="B")?this.oInterface.oConfig.ZINDEX.ARRETBUS:this.oInterface.oConfig.ZINDEX.ARRET}if(this.params.icon){this.setSrcImg(this.params.icon);this.anchor=(this.params.icon.anchor)?new b.point(this.params.icon.anchor.x,this.params.icon.anchor.y):this.anchor}if(d("#divpun"+this.id).length===0){this.oHTML=d('<div id="divpun'+this.id+'"></div>');this.id_div=this.oHTML.attr("id");if(this.params.nature){d.data(this.oHTML.get(0),"nature",this.params.nature);this.zindex=this.oInterface.oConfig.ZINDEX.POI}if(this.params.ligne){g=this.getCodeLigne();d.data(this.oHTML.get(0),"lignes",g);d.data(this.oHTML.get(0),"type","Desserte")}this.oHTML.addClass(this.divClasse).css("z-index",this.zindex);this.oHTML_img=d('<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"});i=this.oHTML_img.get(0);if(this.params.type=="ARRET"){if(this.params.inPTU!="0"&&d.inArray("C",this.mode)>-1&&d.inArray("B",this.mode)==-1&&!this.isPole){this.oHTML_img.css("opacity",0.3)}d.data(i,"mode",this.mode.join(","));if(this.oInterface.modeSel&&this.oInterface.doCheck&&d.inArray(this.mode[0].charAt(0),this.oInterface.modeSel)==-1){this.oHTML_img.css("visibility","hidden")}if(this.src_on){d.data(i,"defaultsrc",this.src);d.data(i,"defaultwidth",this.width);d.data(i,"defaultheight",this.height);h=(d.isArray(this.src_on))?this.src_on.join(","):this.src_on;d.data(i,"src_on",h);d.data(i,"width_on",this.dimSelectedPun.width);d.data(i,"height_on",this.dimSelectedPun.height)}}d.data(i,"latitude",this.latitude);d.data(i,"longitude",this.longitude);d.data(i,"type",this.params.type);d.data(i,"Motif",this.params.terminus);if(this.params.classname){this.oHTML_img.addClass(this.params.classname)}if(this.params.type=="ETAPE"&&d.isPlainObject(this.params.vcard)){for(classe in this.params.vcard){d.data(i,classe,this.params.vcard[classe])}}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"){j=this.oHTML.clone(true);j.attr("id","_"+this.oHTML.attr("id")+"_").css("z-index",parseInt(this.oHTML.css("z-index"),10)+1);this.oHTML.after(j);f=j.children(0);f.attr({id:"_"+this.oHTML_img.attr("id")+"_",src:this.oInterface.oConfig.imagesPath+"spacer.gif"}).height(25).width(25);if(is_ie===6){f.css("filter","");if(d.data(f.get(0),"realsrc")){f.removeData("realsrc")}}f.addClass("fake");this.oHTML_img.css("cursor","default");this.setPosition(f,25,25)}}else{this.oHTML=d("#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()}if(this.params.active){this.openStation()}};b.Marker.prototype.setPosition=function(k,g,h){this.anchor=(g&&h)?new b.point(Math.floor(g/2),Math.floor(h/2)):this.anchor;k=k||this.oHTML_img;var l,j,i,f;l=(/;+/.test(this.latitude))?this.barycenter(this.latitude.split(";")):this.latitude;j=(/;+/.test(this.longitude))?this.barycenter(this.longitude.split(";")):this.longitude;i=this.oConteneur.latlongToPixel(l,j,this.oConteneur.niveau);f=this.oConteneur.pixelToPosition(i.x,i.y);k.css({left:f.left-this.anchor.E,top:f.top-this.anchor.N});if(this.params.minzoom&&this.oConteneur.niveau<this.params.minzoom){k.css({visibility:"hidden"})}else{if(this.params.maxzoom&&this.oConteneur.niveau>this.params.maxzoom){k.css({visibility:"hidden"})}else{k.css({visibility:"visible"})}}};b.Marker.prototype.barycenter=function(f,g){var h=0,l=0,k=f.length,j;g=g||d.array_fill(0,k,1);for(j=0;j<k;j++){h+=parseInt(f[j],10);l+=parseInt(g[j],10)}return Math.round(h/l)};b.Marker.prototype.posPunAtCenter=function(){var f=d("#"+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;f.parent().css({left:this.E_px-Math.floor(this.width/2),top:this.N_px-Math.floor(this.height/2)});f.css({"z-index":this.zindex,visibility:"visible"})};b.Marker.prototype.setCoords=function(g,f){this.latitude=g;this.longitude=f;d.data(this.oHTML_img.get(0),"latitude",this.latitude);d.data(this.oHTML_img.get(0),"longitude",this.longitude)};b.Marker.prototype.setTxtInfo=function(){var h=arguments.length==1&&typeof arguments[0]=="object"?arguments[0]:{},n=this,l,j,g,m,o,f,s,r,p,q,u,k;h.type=typeof h.type=="undefined"?null:h.type;h.classe=typeof h.classe=="undefined"?null:h.classe;h.text=typeof h.text=="undefined"?null:h.text;h.attributes=typeof h.attributes=="undefined"?{}:h.attributes;if(h.type=="bulle"){this.nomStation.css({"z-index":this.oInterface.oConfig.ZINDEX.INFOBOX_DEFAULT,visibility:"hidden"}).addClass(h.type).data("Motif",this.params.terminus).append(d("<h4>"+locales[this.oInterface.lang][this.id]+"</h4>"));if(d.isPlainObject(this.params.vcard)){u=this.createVCard(this.params.vcard)}if(u){this.nomStation.append(u)}if(this.oConteneur.niveau!=this.oInterface.oConfig.firstNiv){g=d("<p></p>").append(d('<a href="javascript:void(0)">'+locales[this.oInterface.lang].zoomIn+"</a>").click(function(i){i.preventDefault();i.stopPropagation();n.oConteneur.zoomInPun(i,n.oHTML_img)}));this.nomStation.append(g)}}else{m=this.params.ligne[0];o=d("<ul></ul>");for(k=0;k<m.length;k++){if(m[k]!==""){switch(this.mode[k]){case"T":ligne=m[k];f=m[k];break;default:s=m[k].split(":");ligne=s[1];f=s[0];if(this.mode[k]=="Bt"){ligne+=" Terminus"}break}j=d("<li>"+ligne+"</li>");j.css("margin",0);if(h.classe){j.addClass(h.classe)}if(h.classe=="affInfo"&&this.mode){if(this.oConteneur.modeCarte!="ITINERAIRE"){j.mousedown(function(i){n.oConteneur.clicOnLigne(i,this)})}j.addClass(this.oInterface.oConfig.classeNom[this.mode[k].charAt(0)].substring(5));this.overOut(j,this.mode[k].charAt(0));d.data(j.get(0),"mode",this.mode[k].charAt(0));d.data(j.get(0),"ligne",f);if(this.mode[k]!="T"&&this.oInterface.oConfig.iconInfoLine){j.prepend(d('<img class="infoimg" alt="Informations sur la ligne" src="'+this.oInterface.oConfig.imagesPath+'infol.png"/>'))}}o.append(j)}}this.nomStation.next().append(o);if(this.oConteneur.lastDisplayed&&this.oHTML_img.attr("id")==this.oConteneur.lastDisplayed[1]){l=o.find("li:data(ligne="+this.oConteneur.lastDisplayed[0]+")").get(0);r=l.offsetTop+"px";p=l.offsetLeft+l.offsetWidth+"px";q=d('<div id="infoLigne" class="'+d.data(l,"mode")+'"><img src="'+this.oInterface.oConfig.imagesPath+'ld.gif" width="16" height="16" alt=""/></div>').css({position:"absolute",top:r,left:p}).html(this.oConteneur.lastDisplayed[2]);q.insertAfter(d(l))}}};b.Marker.prototype.retrieveInfosHandler=function(){var g=arguments.length==1&&typeof arguments[0]=="object"?arguments[0]:{},f=this;g.action=typeof g.action=="undefined"?null:g.action;if(this.oConteneur.oInterface.timeOutLigne){clearTimeout(this.oConteneur.oInterface.timeOutLigne)}this.oConteneur.oInterface.timeOutLigne=setTimeout(function(){if(typeof f[g.action]==="function"){f[g.action](g)}},250)};b.Marker.prototype.retrieveInfos=function(){if(this.oInterface.timeOutLigne){clearTimeout(this.oInterface.timeOutLigne)}var l=arguments.length==1&&typeof arguments[0]=="object"?arguments[0]:{},i=this,h,f,g,m,j,k;l.obj=typeof l.obj=="undefined"?null:l.obj;l.ligne=typeof l.ligne=="undefined"?null:l.ligne;l.mode=typeof l.mode=="undefined"?null:l.mode;l.stationname=typeof l.stationname=="undefined"?null:l.stationname;this.oConteneur.lastDisplayed=[l.ligne,this.oHTML_img.attr("id")];h=this.oConteneur.lastDisplayed.join();if(d("#infoLigne").length>0){if((d.data(d("#infoLigne").get(0),"ligneAndId")==h)){return}d("#infoLigne").remove()}jObj=d(l.obj);f=jObj.position().top-17+"px";g=jObj.position().left+jObj.outerWidth()+"px";m=d('<div id="infoLigne" class="'+l.mode+'"><img src="'+this.oInterface.oConfig.imagesPath+'ld.gif" width="16" height="16" alt=""/></div>').css({position:"absolute",top:f,left:g});d.data(m.get(0),"ligneAndId",h);m.appendTo(d(l.obj.parentNode)).hide();j=d(l.obj).closest("div.infobox").siblings("div.station").children("p").text();k="infosligne="+l.ligne+"&lang="+this.oInterface.lang+"&level="+this.oConteneur.niveau+"&nomStation="+j;this.oConteneur.oInterface.sendData(k,this.oConteneur.oInterface.oConfig.rootUrl+"traitement.php",this.oConteneur.oInterface.oConfig.ajaxParams.method,m,function(){d('<button class="close" type="button"><img src="'+i.oInterface.oConfig.imagesPath+'close.gif" alt="Close"/></button>').bind("click",function(){d("#infoLigne").remove()}).appendTo(m);i.oConteneur.lastDisplayed.push(m.html());var n,p,q,o;n=parseInt(m.find("ul").css("width"),10);p=m.first().height();m.animate({width:n,height:p},"normal","swing",function(){m.show();q=m.offset().left+n;o=m.offset().top+p;if(q>i.oConteneur.dimVisCarte.right&&o>i.oConteneur.dimVisCarte.bottom){i.oConteneur.moveCarte(i.oConteneur.dimVisCarte.right-q-20,i.oConteneur.dimVisCarte.bottom-o-20)}else{if(q>i.oConteneur.dimVisCarte.right){i.oConteneur.moveCarte(i.oConteneur.dimVisCarte.right-q-20,0)}else{if(o>i.oConteneur.dimVisCarte.bottom){i.oConteneur.moveCarte(0,i.oConteneur.dimVisCarte.bottom-o-20)}}}})});return};b.Marker.prototype.removeInfos=function(g){g.stopPropagation();var h=g.target,f;if(!d(h).is("li.affInfo")){return}f=g.relatedTarget;while(f!=h&&d(f).is("#infoLigne")&&!d(f).is("BODY")){f=f.parentNode}if(f==h||d(f).is("#infoLigne")){return}if(d("#infoLigne").length>0){d("#infoLigne").remove()}};b.Marker.prototype.getCurrentIndex=function(){var h=this.oInterface.aP[this.oConteneur.niveau].length,f,g;for(f=0;f<h;f++){if(d.inArray(this.id,this.oInterface.aP[this.oConteneur.niveau][f])!=-1){g=f;break}}return g};b.Marker.prototype.createVCard=function(i){var h=d('<div class="vcard"><span class="fn" style="display:none;">&nbsp;</span></div>'),g=d('<div class="adr"></div>'),f;for(f in i){if(i[f].length===0){continue}g.append(d('<p class="'+f+'">'+d.stripslashes(i[f])+"</p>"))}h.append(g);return h};b.Marker.prototype.setPositionStation=function(m,j){var i=j.css("left"),p=j.css("top"),o=j.width(),k=j.height(),q=this.nomStation,n,g,f;if(m=="bulle"){if(this.longitude<this.oConteneur.centerPoint.longitude){if(this.latitude<this.oConteneur.centerPoint.latitude){n=d('<div class="bulle_gb"></div>').appendTo(q);q.addClass("above");q.css({left:parseInt(i,10)+Math.floor(parseInt(o,10)/2),top:parseInt(p,10)+Math.floor(parseInt(k,10)/2)-q.height()-n.height()});if(q.offset().top<this.oConteneur.oMask.offset().top){q.addClass("bulle_gh");n.removeClass("bulle_gb");n.addClass("bulle_bottom");q.css({left:parseInt(i,10)+Math.floor(parseInt(o,10)/2),top:parseInt(p,10)+Math.floor(parseInt(k,10)/2)})}}else{n=d('<div class="bulle_gh"></div>').prependTo(q);q.addClass("below");q.css({left:parseInt(i,10)+Math.floor(parseInt(o,10)/2),top:parseInt(p,10)+Math.floor(parseInt(k,10)/2)+n.height()});if((q.offset().top+q.height())>(this.oConteneur.oMask.offset().top+Math.floor(this.oConteneur.dimVisCarte.height))){q.removeClass("bulle_gh");n.removeClass("bulle_bottom");n.addClass("bulle_gb");q.css({left:parseInt(i,10)+Math.floor(parseInt(o,10)/2),top:parseInt(p,10)+Math.floor(parseInt(k,10)/2)-q.height()})}}}else{if(this.latitude<this.oConteneur.centerPoint.latitude){n=d('<div class="bulle_db"></div>').appendTo(q);q.addClass("above");q.css({left:parseInt(i,10)+Math.floor(parseInt(o,10)/2)-q.width(),top:parseInt(p,10)+Math.floor(parseInt(k,10)/2)-q.height()-n.height()});if(q.offset().top<this.oConteneur.oMask.offset().top){q.addClass("bulle_dh");n.removeClass("bulle_db");n.addClass("bulle_bottom");q.css({left:parseInt(i,10)+Math.floor(parseInt(o,10)/2)-q.width(),top:parseInt(p,10)+Math.floor(parseInt(k,10)/2)})}}else{n=d('<div class="bulle_dh"></div>').prependTo(q);q.addClass("below");q.css({left:parseInt(i,10)+Math.floor(parseInt(o,10)/2)-q.width(),top:parseInt(p,10)+Math.floor(parseInt(k,10)/2)+n.height()});if((q.offset().top+q.height())>(this.oConteneur.oMask.offset().top+Math.floor(this.oConteneur.dimVisCarte.height))){q.removeClass("bulle_dh");n.removeClass("bulle_bottom");n.addClass("bulle_db");q.css({left:parseInt(i,10)+Math.floor(parseInt(o,10)/2)-q.width(),top:parseInt(p,10)+Math.floor(parseInt(k,10)/2)-q.height()})}}}}else{if(this.oConteneur.niveau!==0){g=j.offset().left+parseInt(o,10)+q.width();f=(j.offset().top-Math.floor(q.height()/4))+q.next().height()+q.height();if(g>this.oConteneur.dimVisCarte.right){q.css("left",parseInt(i,10)-q.width())}else{q.css("left",parseInt(i,10)+parseInt(o,10))}if(f>this.oConteneur.dimVisCarte.bottom){q.css("top",parseInt(p,10)-(q.height()+q.next().height()-parseInt(k,10)))}else{if(f<this.oConteneur.oMask.offset().top){q.css("top",parseInt(p,10)+Math.floor(q.height()/4))}else{q.css("top",parseInt(p,10)-Math.floor(q.height()/4))}}}else{q.css({left:parseInt(i,10),top:parseInt(p,10)+parseInt(k,10)})}}};b.Marker.prototype.getLinesList=function(){var l=arguments.length==1&&typeof arguments[0]=="object"?arguments[0]:{},f=this.params.ligne[0],j,k=f.length,h,g;l.classe=typeof l.classe=="undefined"?"affInfo":l.classe;h=d("<ul></ul>");for(j=0;j<k;j++){if(f[j]!==""){switch(this.mode[j]){case"T":ligne=f[j];codeligne=f[j];break;default:ligne=f[j].split(":")[1];codeligne=f[j].split(":")[0];if(this.mode[j]=="Bt"){ligne+=" Terminus"}break}g=typeof l.classe=="undefined"?d("<li>"+ligne+"</li>"):d('<li class="'+l.classe+'">'+ligne+"</li>");g.addClass(this.oInterface.oConfig.classeNom[this.mode[j].charAt(0)].substring(5));d.data(g.get(0),"mode",this.mode[j].charAt(0));d.data(g.get(0),"ligne",codeligne);if(this.mode[j]!="T"&&this.oInterface.oConfig.iconInfoLine){g.prepend(d('<img class="infoimg" alt="Informations sur la ligne" src="'+this.oInterface.oConfig.imagesPath+'infol.png"/>'))}h.append(g)}}this.nomStation.next().append(h);if(this.oConteneur.lastDisplayed&&this.oHTML_img.attr("id")==this.oConteneur.lastDisplayed[1]){obj=h.find("li:data(ligne="+this.oConteneur.lastDisplayed[0]+")").get(0);topDiv=obj.offsetTop-17+"px";leftDiv=obj.offsetLeft+obj.offsetWidth+"px";infosLigne=d('<div id="infoLigne" class="'+d.data(obj,"mode")+'"><img src="'+this.oInterface.oConfig.imagesPath+'ld.gif" width="16" height="16" alt=""/></div>').css({position:"absolute",top:topDiv,left:leftDiv}).html(this.oConteneur.lastDisplayed[2]);infosLigne.insertAfter(d(obj))}};b.Marker.prototype.setHTMLContent=function(){if(typeof this.params.content==="string"){this.nomStation.append(this.params.content)}switch(this.params.type){case"ARRET":this.getLinesList();break;case"ETAPE":var i,g,h=/it-stage-([0-9]+)/,f,j;if(d.isPlainObject(this.params.vcard)){i=this.createVCard(this.params.vcard)}if(i){this.nomStation.append(i)}if(h.test(this.id)){f=Number(this.id.replace(h,"$1"));if(d("#it-roadmap-stage-"+f).next().is("img")){if(d("h4",this.nomStation).length>0){d("h4",this.nomStation).eq(0).css({"padding-left":"35px",background:"url("+d("#it-roadmap-stage-"+f).next().attr("src")+") 0 0 no-repeat",height:"25px"})}else{d("<h4></h4>").css({"padding-left":"35px",background:"url("+d("#it-roadmap-stage-"+f).next().attr("src")+") 0 0 no-repeat",height:"25px"}).insertBefore(d(".action-list",this.nomStation).eq(0))}}j=d("#it-roadmap-stage-"+f).parent().find(".it-stage-content").map(function(){return"<p>"+d(this).text()+"</p>"});if(j.get().join("").length>0){d(j.get().join("")).insertBefore(d(".action-list",this.nomStation).eq(0))}}break;case"POI":if(!d.isEmptyObject(this.params.attributes)){g='<ul class="'+this.params.img_info.split(":")[1]+'">';for(classe in this.params.attributes){if(this.params.attributes[classe].length>0){g+=!d.isUrl(this.params.attributes[classe])?'<li class="affInfo '+classe+'">'+locales[this.oInterface.lang].pois[classe]+" "+this.params.attributes[classe]+"</li>":'<li class="affInfo '+classe+'">'+locales[this.oInterface.lang].pois[classe]+' <a class="externe" href="'+this.params.attributes[classe]+'">'+this.params.attributes[classe].substring(7)+"</a></li>"}}g+="</ul>"}this.nomStation.next().append(g);break;default:if(this.oInterface.oConfig.actionsOnMarkers&&this.oConteneur.niveau!=this.oInterface.oConfig.firstNiv){if(d("ul.action-list",this.nomStation).length==0){g='<ul class="action-list">';g+='<li class="zoomInPun"><a href="javascript:void(0)">'+locales[this.oInterface.lang].voir_plan+"</a></li>";g+="</ul>";this.nomStation.append(g)}}break}};b.Marker.prototype.creeEtiquette=function(h){var i,f,g=this,j="";if(this.params.type=="DEFAULT"){if(d("div.bulle",d("#"+this.id_div)).length>0){d("div.bulle",d("#"+this.id_div)).remove()}this.nomStation=d('<div class="bulle"></div>').css({"z-index":this.oInterface.oConfig.ZINDEX.DEFAULT});d("#"+this.id_div).append(this.nomStation.append(d('<button  class="close"><img width="13" height="13" src="'+this.oInterface.oConfig.imagesPath+'close.gif" alt="Close"/></button>').bind("click",function(k){g.closeStation(k)})));this.setHTMLContent();i=this.oHTML_img;this.setPositionStation("bulle",i);return}if(this.params.type=="ETAPE"){if(d("div.bulle",d("#"+this.id_div)).length>0){d("div.bulle",d("#"+this.id_div)).remove()}this.nomStation=d('<div id="bulle'+this.id+'" class="bulle"></div>').css({"z-index":this.oInterface.oConfig.ZINDEX.INFOBOX_DEFAULT});if(typeof locales[this.oInterface.lang][this.id]!=="undefined"){this.nomStation.append(d("<h4>"+locales[this.oInterface.lang][this.id]+"</h4>"))}d("#"+this.id_div).append(this.nomStation.append(d('<button  class="close"><img width="13" height="13" src="'+this.oInterface.oConfig.imagesPath+'close.gif" alt="Close"/></button>').bind("click",function(k){g.closeStation(k)})));this.setHTMLContent();i=this.oHTML_img;this.setPositionStation("bulle",i)}if(this.params.type=="POI"){f=this.params.img_info.split(":")[1];j="<p>"+this.params.label+"</p>";if(this.oInterface.oConfig.actionsOnMarkers){j+='<ul class="action-list">';j+='<li class="starthere"><a href="javascript:void(0)">'+locales[this.oInterface.lang].starthere+"</a></li>";j+='<li class="endhere"><a href="javascript:void(0)">'+locales[this.oInterface.lang].endhere+"</a></li>";j+='<li class="zoomInPun"><a href="javascript:void(0)">'+locales[this.oInterface.lang].voir_plan+"</a></li>";j+='<li class="centerhere"><a href="javascript:void(0)">'+locales[this.oInterface.lang].centerhere+"</a></li>";j+="</ul>"}this.nomStation=d('<div id="poi'+this.id+'" class="heading poi '+f+'">'+j+"</div>").css({"z-index":this.oInterface.oConfig.ZINDEX.INFOBOX_POI,visibility:"hidden"});d("#"+this.id_div).append(this.nomStation.append(d('<button  class="close"><img width="13" height="13" src="'+this.oInterface.oConfig.imagesPath+'close.gif" alt="Close"/></button>').bind("click",function(k){g.closeStation(k)}))).append('<div id="divinfo'+this.id+'" class="infobox"></div>');this.setHTMLContent();i=this.oHTML_img;this.setPositionStation("poi",i)}else{if(d.data(this.oHTML_img.parent().get(0),"type")){f=this.oInterface.oConfig.classeNom[this.mode[0].charAt(0)];if(this.isPole){f=(this.typepole=="P")?this.oInterface.oConfig.classeNom.P:this.oInterface.oConfig.classeNom[this.typepole.substr(1,1)]}j="<p>"+this.params.label.replace(/\.+$/,"")+"</p>";if(this.oInterface.oConfig.actionsOnMarkers){j+='<ul class="action-list">';j+='<li class="starthere"><a href="javascript:void(0)">'+locales[this.oInterface.lang].starthere+"</a></li>";j+='<li class="endhere"><a href="javascript:void(0)">'+locales[this.oInterface.lang].endhere+"</a></li>";j+='<li class="zoomInPun"><a href="javascript:void(0)">'+locales[this.oInterface.lang].voir_plan+"</a></li>";j+='<li class="centerhere"><a href="javascript:void(0)">'+locales[this.oInterface.lang].centerhere+"</a></li>";j+="</ul>"}this.nomStation=d('<div id="station'+this.id+'" class="heading station '+f+'">'+j+"</div>").css({"z-index":this.oInterface.oConfig.ZINDEX.INFOBOX_ARRET,visibility:"hidden"}).data("Motif",this.params.terminus);d("#"+this.id_div).append(this.nomStation.append(d('<button  class="close"><img width="13" height="13" src="'+this.oInterface.oConfig.imagesPath+'close.gif" alt="Close"/></button>').bind("click",function(k){g.closeStation(k)}))).append('<div id="divinfo'+this.id+'" class="infobox"></div>');this.setHTMLContent();if(this.oHTML_img.parent().next().length>0&&this.oHTML_img.parent().next().children(":first").hasClass("fake")){i=this.oHTML_img.parent().next().children(":first")}else{i=this.oHTML_img}this.setPositionStation("station",i)}}return true};b.Marker.prototype.displayEtiquette=function(g){if(!this.nomStation){this.creeEtiquette()}this.oHTML_img.next().css("visibility","visible");if(g){this.openLignes(this.oHTML_img.next())}var f=this.oHTML_img.get(0);if(d.data(f,"src_on")){this.oHTML_img.width(d.data(f,"width_on"));this.oHTML_img.height(d.data(f,"height_on"));this.oHTML_img.attr("src",d.data(f,"src_on"))}if(this.params.type!=="ARRET"){return}this.oHTML_img.parent().css("z-index",this.oInterface.oConfig.ZINDEX.ARRET_LINE_DISPLAYED)};b.Marker.prototype.openStationHandler=function(){var f=this;if(this.oConteneur.oInterface.timeOutId){clearTimeout(this.oConteneur.oInterface.timeOutId)}this.oConteneur.oInterface.timeOutId=setTimeout(function(){f.openStation()},250)};b.Marker.prototype.openStation=function(){var i=this,k,g,h,l=this.oHTML_img,f,j;if(this.oConteneur.oInterface.timeOutId){clearTimeout(this.oConteneur.oInterface.timeOutId)}if(this.params.type=="ETAPE"){j=/default-stage-(\d+)\.png/;if(j.test(l.attr("src"))){l.attr("src",l.attr("src").replace(j,"active-stage-$1.png"));f=l.attr("id").replace(/it-stage-(\d+)/,function(m,o){return"it-roadmap-stage-"+Number(o)});d("#"+f).trigger("active")}}if(!this.nomStation){this.creeEtiquette()}d("div[id^=divpun] div li.affInfo").each(function(){k=d(this).parents("div[id^=divpun]").eq(0);if(d.data(k.get(0),"type")=="Desserte"){g=d.data(k.get(0).firstChild,"mode").toString();h=(g.charAt(0)=="B")?i.oInterface.oConfig.ZINDEX.ARRETBUS:i.oInterface.oConfig.ZINDEX.ARRET;k.css("z-index",h);if(i.oInterface.affLigne.length>0){if(d.inArray(d.data(this,"ligne"),i.oInterface.affLigne)!=-1){d(this).addClass("disp");k.css("z-index",i.oInterface.oConfig.ZINDEX.ARRET_LINE_DISPLAYED)}}}if(typeof d.data(k.get(0),"nature")!=="undefined"){k.css("z-index",i.oInterface.oConfig.ZINDEX.POI)}});d("div[id^=station]").each(function(m){d(this).find("button.close").trigger("click")});d("div[id^=poi]").each(function(m){d(this).find("button.close").trigger("click")});d("div[id^=divinfo]").each(function(m){d(this).find("button.close").trigger("click")});d("div.bulle").each(function(m){d(this).find("button.close").trigger("click")});this.params.active=true;l.next().css("visibility","visible");l.parent().css("z-index",i.oInterface.oConfig.ZINDEX.HOVER);if(this.params.type=="ETAPE"||this.params.type=="DEFAULT"){return}if(l.parent().next().length>0&&l.parent().next().attr("id").indexOf("_",0)!=-1){l.parent().next().css("z-index",i.oInterface.oConfig.ZINDEX.FAKE_HOVER)}this.openLignes(l.next())};b.Marker.prototype.zoomInStage=function(h){if(d("#itiroadmap").length===0){return false}var g=moviLib.findObj("itiroadmap"),f=this.id.substring(2),i;if(isNaN(f)){if(f=="origine"){moviLib.removeClassFromBrothers(g.firstChild,"onit");moviLib.addClass(g.firstChild,"onit");handleDetails(h,g.firstChild);return}if(f=="destination"){moviLib.removeClassFromBrothers(g.firstChild,"onit");moviLib.addClass(g.firstChild,"onit");handleDetails(h,g.lastChild);return}return false}else{i=2*parseInt(f,10);moviLib.removeClassFromBrothers(g.childNodes[i],"onit");moviLib.addClass(g.childNodes[i],"onit");handleDetails(h,g.childNodes[i]);return}};b.Marker.prototype.openLignes=function(f){f.next().css({left:parseInt(f.css("left"),10),top:parseInt(f.css("top"),10)+f.outerHeight(),visibility:"visible"})};b.Marker.prototype.closeStation=function(f){f.stopPropagation();this.nomStation.css("visibility","hidden");this.nomStation.next().css("visibility","hidden");if(this.nomStation.parent().css("z-index")==this.oInterface.oConfig.ZINDEX.HOVER){switch(this.params.type){case"ARRET":(d.data(this.nomStation.prev().get(0),"mode").toString().charAt(0)=="B")?this.nomStation.prev().parent("z-index",95):this.nomStation.parent().css("z-index",96);break;case"ETAPE":regexp=/active-stage-(\d+)\.png/;if(regexp.test(this.oHTML_img.attr("src"))){this.oHTML_img.attr("src",this.oHTML_img.attr("src").replace(regexp,"default-stage-$1.png"))}default:this.nomStation.parent().css("z-index",this.oInterface.oConfig.ZINDEX[this.params.type]);break}}this.params.active=false};b.Polygon=function(f){this.oConteneur=f;this.params=arguments.length==2&&typeof arguments[1]=="object"?arguments[1]:{};this.oInterface=this.oConteneur.oInterface;this.id="iso"+this.params.id;this.classe="isochrone";this.latitude=this.params.boundary.latmax;this.longitude=this.params.boundary.longmin;this.width=null;this.height=null;this.left=null;this.top=null;this.marge="100";this.setDimensions();this.controlPoints=[];this.pointsSVG=this.convertCoords(this.params.d)||null;this.createPolygon()};b.Polygon.prototype.setDimensions=function(){var f=this.oConteneur.latlongToPixel(this.latitude,this.longitude,this.oConteneur.niveau),g=this.oConteneur.latlongToPixel(this.params.boundary.latmin,this.params.boundary.longmax,this.oConteneur.niveau);this.width=Math.abs(g.x-f.x)+2*this.marge;this.height=Math.abs(g.y-f.y)+2*this.marge;return};b.Polygon.prototype.convertCoords=function(f){var g=this;return d.map(f.split(" "),function(k,j){var i,m,l,h;if(isNaN(k.charAt(0))&&k.charAt(0)!="-"){i=k.charAt(0);m=k.substr(1).split(",")}else{i="";m=k.split(",")}if(isNaN(m[0])||isNaN(m[1])){return k}switch(i.toUpperCase()){case"M":default:l=g.oConteneur.latlongToPixel(m[0],m[1],g.oConteneur.niveau);h=g.oConteneur.pixelToPosition(l.x,l.y);break}if(j%3==1||j%3==2){g.controlPoints.push(h.left+","+h.top)}return i+h.left+","+h.top}).join(" ")};b.Polygon.prototype.createPolygon=function(r){var m,q,o,n,x;if(d("#"+this.id).length>0){m=d("#"+this.id)}else{m=d('<div id="'+this.id+'" class="'+this.classe+'"></div>').css("z-index",this.zindex);m.data("type","Polygon");this.oConteneur.oHTML.append(m)}if(this.pointsSVG){n=this.oConteneur.latlongToPixel(this.latitude,this.longitude,this.oConteneur.niveau);x=this.oConteneur.pixelToPosition(n.x,n.y);q=x.left;o=x.top;if(is_ie<9){if(typeof a.namespaces.v=="undefined"){a.namespaces.add("v","urn:schemas-microsoft-com:vml")}var h=(a.styleSheets.length>0)?a.styleSheets[0]:a.createStyleSheet(),s=["shape","fill","stroke"],v=s.length,w=d.trim(this.pointsSVG),g,f,l=75,u;s=["shape","fill","stroke"];for(u=0;u<v;u++){h.addRule("v\\:"+s[u],"behavior: url(#default#VML); ")}w=w.replace(/M(-?[0-9]+\.?[0-9]+,-?[0-9]+\.?[0-9]+)/g,"m $1");w=w.replace(/C(-?[0-9]+\.?[0-9]+,-?[0-9]+\.?[0-9]+)/g,"c $1");g='<v:shape style="position:absolute;left:'+(q-this.marge)+"px;top:"+(o-this.marge)+"px;";g+=" z-index:"+l+";width:"+this.width+"px;height:"+this.height+'px;" filled="false;" coordorigin="'+parseInt(q-this.marge,10)+","+parseInt(o-this.marge,10)+'"';g+=' coordsize="'+this.width+","+this.height+'" strokecolor="'+this.oInterface.oConfig.isochronesColor[this.id]+'" strokeweight="6px"';g+=' path="'+w+' e">';g+="</v:shape>";f='<v:shape style="position:absolute;left:'+(q-this.marge)+"px;top:"+(o-this.marge)+"px;";f+=" z-index:"+(l-1)+";width:"+this.width+"px;height:"+this.height+'px;" filled="false;" coordorigin="'+parseInt(q-this.marge,10)+","+parseInt(o-this.marge,10)+'"';f+=' coordsize="'+this.width+","+this.height+'" strokecolor="#fff" strokeweight="8px"';f+=' path="'+w+' e">';f+="</v:shape>";m.append(g+f)}else{var k="http://www.w3.org/2000/svg",p=a.createElementNS(k,"svg"),j=a.createElementNS(k,"path"),t=a.createElementNS(k,"path");p.setAttribute("version","1.1");p.setAttribute("overflow","visible");p.style.position="absolute";p.style.left=q-this.marge+"px";p.style.top=o-this.marge+"px";p.style.zIndex=75;p.setAttribute("width",this.width+"px");p.setAttribute("height",this.height+"px");p.setAttribute("viewBox",(q-this.marge)+" "+(o-this.marge)+" "+this.width+" "+this.height);j.setAttribute("style","stroke:#fff;");j.setAttribute("stroke-width","8");j.setAttribute("d",this.pointsSVG);p.appendChild(j);t.setAttribute("style","stroke:"+this.oInterface.oConfig.isochronesColor[this.id]+";");t.setAttribute("stroke-width","6");t.setAttribute("d",this.pointsSVG);p.appendChild(t);m.append(p)}return}return};b.Path=function(f){this._type="Path";this.oConteneur=f;this.params=arguments.length==2&&typeof arguments[1]=="object"?arguments[1]:{};this.oInterface=this.oConteneur.oInterface;this.id_div=this.params.id;this.classe=this.params.classe||"ligne";this.latitude=this.params.boundary.latmax;this.longitude=this.params.boundary.longmin;this.width=null;this.height=null;this.left=null;this.top=null;this.visible=false;this.mode=typeof this.params.mode=="undefined"?"no":this.params.mode;this.border=typeof this.params.border=="undefined"?true:this.params.border;this.marge=10;(this.mode=="B")?this.zindex=94:this.zindex=90;this.setDimensions();this.path=this.convertCoords(this.params.d)||null;this.draw()};b.Path.prototype.setDimensions=function(f,i,h,k){f=f||this.params.boundary.latmin;i=i||this.params.boundary.latmax;h=h||this.params.boundary.longmin;k=k||this.params.boundary.longmax;var g=this.oConteneur.latlongToPixel(i,h,this.oConteneur.niveau),j=this.oConteneur.latlongToPixel(f,k,this.oConteneur.niveau);this.width=Math.abs(j.x-g.x)+2*this.marge;this.height=Math.abs(j.y-g.y)+2*this.marge;return};b.Path.prototype.convertCoords=function(g){var f=this;return d.map(g.split(" "),function(j){var i,l,k,h;if(isNaN(j.charAt(0))&&j.charAt(0)!="-"){i=j.charAt(0);l=j.substr(1).split(",")}else{i="";l=j.split(",")}if(isNaN(l[0])||isNaN(l[1])){return j}switch(i.toUpperCase()){case"M":default:k=f.oConteneur.latlongToPixel(l[0],l[1],f.oConteneur.niveau);h=f.oConteneur.pixelToPosition(k.x,k.y);break}return i+h.left+","+h.top}).join(" ")};b.Path.prototype.draw=function(z){var p,y,w,J=(this.oConteneur.niveau<this.oInterface.oConfig.vectorThickMinLevel)?"normal":"thick",C,K,E=true,r,M,I=new b.bounds(this.params.boundary.latmin,this.params.boundary.latmax,this.params.boundary.longmin,this.params.boundary.longmax),s=this.oConteneur.getGeoViewbox();if(d("#"+this.id_div,this.oConteneur.oHTML).length>0){p=d("#"+this.id_div,this.oConteneur.oHTML)}else{p=d('<div id="'+this.id_div+'" class="'+this.classe+'"></div>').css("z-index",this.zindex);d.data(p.get(0),"type","Ligne");d.data(p.get(0),"mode",this.mode);this.oConteneur.oHTML.append(p)}if(this.path&&I.intersects(s)){r=this.oConteneur.latlongToPixel(this.latitude,this.longitude,this.oConteneur.niveau);M=this.oConteneur.pixelToPosition(r.x,r.y);y=M.left;w=M.top;switch(this.mode){case"W":C="2px";K="6px";break;case"PEDESTRIAN":case"BIKE":case"DRIVING":case"MAP":C="0px";K="6px";break;case"PEDESTRIAND":case"BIKED":case"DRIVINGD":case"MAPD":C="0px";K="10px";break;default:C=this.oInterface.oConfig.vectorLineWidth[J]+"px";K=this.oInterface.oConfig.vectorBorderWidth[J]+"px";break}if(d.inArray(this.mode,d.keys(this.oInterface.oConfig.levelMax))!=-1){if(this.oConteneur.niveau<this.oInterface.oConfig.levelMax[this.mode]){E=false}}if(d.inArray(this.mode,d.keys(this.oInterface.oConfig.levelMin))!=-1){if(this.oConteneur.niveau>this.oInterface.oConfig.levelMin[this.mode]){E=false}}if(is_ie<9){if(typeof a.namespaces.v=="undefined"){a.namespaces.add("v","urn:schemas-microsoft-com:vml")}var j=(a.styleSheets.length>0)?a.styleSheets[0]:a.createStyleSheet(),A=["shape","stroke","fill"],H=A.length,L=d.trim(this.path),g,f,D,o=80,F;for(F=0;F<H;F++){j.addRule("v\\:"+A[F],"behavior: url(#default#VML);")}L=L.replace(/L/g," ");L=L.replace(/M(-?[0-9]+,-?[0-9]+)/g,"m $1 l");g='<v:shape style="position:absolute;left:'+(y-this.marge)+"px;top:"+(w-this.marge)+"px;";if(!E||this.mode.substr(-1)=="D"){g+=" display:none;"}if(d.inArray(this.mode,this.oInterface.oConfig.nonTCModes)!=-1||d.inArray(this.mode.substring(0,this.mode.length-1),this.oInterface.oConfig.nonTCModes)!=-1){o=87}g+=" z-index:"+o+";width:"+this.width+"px;height:"+this.height+'px;" filled="false;" coordorigin="'+parseInt(y-this.marge,10)+","+parseInt(w-this.marge,10)+'"';D=(typeof this.params.color!="undefined"&&this.mode!="W")?this.params.color:this.oInterface.oConfig.vectorLineColor[this.mode];g+=' coordsize="'+this.width+","+this.height+'" strokecolor="'+D+'" strokeweight="'+C+'"';g+=' path="'+L+' e">';if(this.mode.substr(-1)=="D"){g+='<v:stroke dashStyle="1 1" endcap="round" ></v:stroke>'}else{if(d.inArray(this.mode,this.oInterface.oConfig.nonTCModes)!=-1){g+='<v:stroke opacity="0.5" ></v:stroke>'}}if(typeof this.params.opacity!="undefined"){g+='<v:stroke opacity="'+this.params.opacity+'" ></v:stroke>'}g+="</v:shape>";if(this.border){f='<v:shape style="position:absolute;left:'+(y-this.marge)+"px;top:"+(w-this.marge)+"px;";if(!E){f+=" display:none;"}f+=" z-index:"+(o-1)+";width:"+this.width+"px;height:"+this.height+'px;" filled="false;" coordorigin="'+parseInt(y-this.marge,10)+","+parseInt(w-this.marge,10)+'"';D=(typeof this.params.color!="undefined"&&this.mode=="W")?this.params.color:this.oInterface.oConfig.vectorBorderColor[this.mode];f+=' coordsize="'+this.width+","+this.height+'" strokecolor="'+D+'" strokeweight="'+K+'"';f+=' path="'+L+' e">';if(this.mode.substr(-1)=="D"){f+='<v:stroke dashStyle="1 1" endcap="round" ></v:stroke>'}else{if(d.inArray(this.mode,this.oInterface.oConfig.nonTCModes)!=-1){f+='<v:stroke opacity="0.5" ></v:stroke>'}}if(typeof this.params.opacity!="undefined"){f+='<v:stroke opacity="'+this.params.opacity+'" ></v:stroke>'}f+="</v:shape>"}p.append(g+f)}else{if(d.support.svg){var n="http://www.w3.org/2000/svg",x=a.createElementNS(n,"svg"),m=a.createElementNS(n,"path"),u=a.createElementNS(n,"path");x.setAttribute("version","1.1");x.setAttribute("overflow","visible");x.style.position="absolute";x.style.left=y-this.marge+"px";x.style.top=w-this.marge+"px";x.style.zIndex=80;x.setAttribute("width",this.width+"px");x.setAttribute("height",this.height+"px");x.setAttribute("viewBox",(y-this.marge)+" "+(w-this.marge)+" "+this.width+" "+this.height);if(!E){x.style.display="none"}if(this.border){m.setAttribute("stroke-width",K);m.setAttribute("class",this.mode.toLowerCase()+"Border");if(typeof this.params.color!="undefined"&&this.mode=="W"){m.setAttribute("style","stroke:"+this.params.color)}if(typeof this.params.opacity!="undefined"){u.setAttribute("opacity",this.params.opacity)}m.setAttribute("d",this.path);x.appendChild(m)}u.setAttribute("stroke-width",C);u.setAttribute("class",this.mode.toLowerCase()+"Stroke");if(typeof this.params.color!="undefined"&&this.mode!="W"){u.setAttribute("style","stroke:"+this.params.color)}if(typeof this.params.opacity!="undefined"){u.setAttribute("opacity",this.params.opacity)}u.setAttribute("d",this.path);x.appendChild(u);p.append(x)}else{if(d.support.canvas){var l=a.createElement("canvas"),k=l.getContext("2d"),G=d.trim(this.path),q,F,B,h,v;if(this.width>2*this.oConteneur.dimVisCarte.width||this.height>2*this.oConteneur.dimVisCarte.height){v=I.getIntersect(s);this.setDimensions(v.latmin,v.latmax,v.longmin,v.longmax);r=this.oConteneur.latlongToPixel(v.latmax,v.longmin,this.oConteneur.niveau);M=this.oConteneur.pixelToPosition(r.x,r.y);y=M.left;w=M.top}l.style.position="absolute";l.style.left=y-this.marge+"px";l.style.top=w-this.marge+"px";l.style.zIndex=80;l.setAttribute("width",this.width);l.setAttribute("height",this.height);p.append(l);G=G.split(" ");q=G.length;if(this.border){k.strokeStyle=(typeof this.params.color!="undefined"&&this.mode=="W")?this.params.color:this.oInterface.oConfig.vectorBorderColor[this.mode];k.lineWidth=parseInt(K,10);k.lineCap="round";k.lineJoin="round";k.beginPath();for(F=0;F<q;F++){h=G[F];if(isNaN(h.charAt(0))&&h.charAt(0)!="-"){B=h.charAt(0);coords=h.substr(1).split(",")}else{B="";coords=h.split(",")}if(isNaN(coords[0])||isNaN(coords[1])){continue}switch(B.toUpperCase()){case"M":k.moveTo(coords[0]-(y-this.marge),coords[1]-(w-this.marge));break;default:k.lineTo(coords[0]-(y-this.marge),coords[1]-(w-this.marge));break}}k.stroke()}k.strokeStyle=(typeof this.params.color!="undefined"&&this.mode!="W")?this.params.color:this.oInterface.oConfig.vectorLineColor[this.mode],k.lineWidth=parseInt(C,10);k.lineCap="round";k.lineJoin="round";k.beginPath();for(F=0;F<q;F++){h=G[F];if(isNaN(h.charAt(0))&&h.charAt(0)!="-"){B=h.charAt(0);coords=h.substr(1).split(",")}else{B="";coords=h.split(",")}if(isNaN(coords[0])||isNaN(coords[1])){continue}switch(B.toUpperCase()){case"M":k.moveTo(coords[0]-(y-this.marge),coords[1]-(w-this.marge));break;default:k.lineTo(coords[0]-(y-this.marge),coords[1]-(w-this.marge));break}}k.stroke()}}}return}return};b.Itineraire=function(f){this.oConteneur=f;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()};b.Itineraire.prototype.init=function(){this.modeSwitcher();return};b.Itineraire.prototype.modeSwitcher=function(){if(this.oConteneur.oInterface.params.modeSwitcher===false){return}if(this.oConteneur.niveau<this.oConteneur.oInterface.oConfig.maxPointsLevel){if(d("#modeswitcher").length!==0){d("#modeswitcher").remove()}return}if(d("#modeswitcher").length!==0){this.modeswitcher.css({top:parseInt(this.oConteneur.oMask.css("top"),10)+5,left:parseInt(this.oConteneur.oMask.css("left"),10)+35});return}var f=this;this.modeswitcher=d('<div id="modeswitcher"></div>').hover(function(){d(this).css("background-position","0 -30px")},function(){d(this).css("background-position","0 0")}).css({top:parseInt(this.oConteneur.oMask.css("top"),10)+5,left:parseInt(this.oConteneur.oMask.css("left"),10)+35}).click(function(){d(this).remove();f.oConteneur.switchMode("POINTDARRET")});this.oConteneur.oInterface.oHTML.append(this.modeswitcher)};b.Itineraire.prototype.setOrigineDestination=function(){var g=d("#p_origine").get(0)||null,f=d("#p_destination").get(0)||null;if(d.isEmptyObject(g)||d.isEmptyObject(f)){return}this.origine={id:g.id,latitude:d.data(g,"latitude"),longitude:d.data(g,"longitude"),"street-address":d.data(g,"street-address"),locality:d.data(g,"locality"),"postal-code":d.data(g,"postal-code")}||null;this.destination={id:f.id,latitude:d.data(f,"latitude"),longitude:d.data(f,"longitude"),"street-address":d.data(f,"street-address"),locality:d.data(f,"locality"),"postal-code":d.data(f,"postal-code")}||null};b.Itineraire.prototype.definePoint=function(g){this.oConteneur.oInterface.aP[this.oConteneur.niveau]=[];if(this.origine&&g[0]==this.origine.id){d("#"+this.origine.id).parent().remove()}if(this.destination&&g[0]==this.destination.id){d("#"+this.destination.id).parent().remove()}this.oConteneur.oInterface.aP[this.oConteneur.niveau].push(g);this.oConteneur.n[g[0]]=new b.Marker(this.oConteneur,g[1],g[2],g[0]);this.oConteneur.n[g[0]].createPun({type:"ETAPE",icon:element[4]});this.oConteneur.n[g[0]].displayEtiquette(false);this.setOrigineDestination();if(this.origine&&this.destination){var f=this,h="E_origine="+this.origine.latitude+"&N_origine="+this.origine.longitude;h+="&E_destination="+this.destination.latitude+"&N_destination="+this.destination.longitude;h+="&userChoice=yes&lang="+this.oConteneur.oInterface.lang;d("#menugauche").empty();this.oConteneur.oInterface.sendData(h,this.oConteneur.oInterface.oConfig.rootUrl+"itineraire.php",this.oConteneur.oInterface.oConfig.ajaxParams.method,d("#menugauche"),function(){f.init();f.oConteneur.modeCarte="ITINERAIRE";f.oConteneur.zoomAt(d("#itioverview").attr("xcenter"),d("#itioverview").attr("ycenter"),d("#itioverview").attr("level"));if(!f.listeResume){return false}for(var j=0;j<f.listeResume.length;j++){if(f.listeResume[j].nodeName=="UL"&&moviLib.hasClass(f.listeResume[j],"onit")){f.listeResume[j].firstChild.onclick()}}})}};b.Itineraire.prototype.handleDetails=function(n,j){if(this.oConteneur.oInterface.aL[this.oConteneur.niveau]){var h=d(j),m=h.parents(this.oConteneur.oInterface.params.segmentTag+"[segmentid]").eq(0),o=h.attr("id").replace(/roadmap-/,""),l=this.oConteneur.oInterface.aL[this.oConteneur.niveau].length,k,f=new b.bounds(),g;if(d(n.target).hasClass("it-step")||d(n.target).parents(".it-step").length>0){g=(d(n.target).hasClass("it-step"))?d(n.target):d(n.target).parents(".it-step").eq(0),indexStep=d(".it-step",g.parent()).index(g),stepsStack=d.grep(this.oConteneur.oInterface.aL[this.oConteneur.niveau],function(p,i){return p.id===m.attr("segmentid")});if(stepsStack.length>0){f.addBounds(new b.bounds(stepsStack[indexStep].boundary.latmin,stepsStack[indexStep].boundary.latmax,stepsStack[indexStep].boundary.longmin,stepsStack[indexStep].boundary.longmax))}}else{for(k=0;k<l;k++){if(this.oConteneur.oInterface.aL[this.oConteneur.niveau][k].id===m.attr("segmentid")){f.addBounds(new b.bounds(this.oConteneur.oInterface.aL[this.oConteneur.niveau][k].boundary.latmin,this.oConteneur.oInterface.aL[this.oConteneur.niveau][k].boundary.latmax,this.oConteneur.oInterface.aL[this.oConteneur.niveau][k].boundary.longmin,this.oConteneur.oInterface.aL[this.oConteneur.niveau][k].boundary.longmax))}else{}}}g=d("#"+o);this.oConteneur.layer[g.data("type")][g.attr("id")].openStation();this.oConteneur.zoomToBoundary(f)}return};b.Itineraire.prototype.setHeight=function(f){f=f||this.oConteneur;this.listeDetails=d("#itiroadmap");if(this.listeDetails.length===0){return}this.listeDetails.height(f.oInterface.pageSize.height-this.listeDetails.position().top-d("#"+f.oInterface.oConfig.footer).height());return};b.Itineraire.prototype.getFromTo=function(g){if(d("#"+g).length===0){return}var f=this;this.details=[];d("td.parcours .from, td.parcours .to",d("li[level="+this.oConteneur.niveau+"]",d("#"+g)).filter(".onit").filter(":not(.pieton)")).each(function(h){f.details.push(this.id.replace(/^_/,""))});return};c.itMaps=b})(jQuery,this,this.document);
