function button(D,C,A,B){this.id=D;this.urlImage=C;this.urlImageSelected=A;this.action=B;this.urlImageOver=null;this.setUrlImageOver=function(E){this.urlImageOver=E}}function buttonManager(){var isSelected=null;
var buttonList=new Array();var defaultActionMode=null;this.setDefaultActionMode=function(value){defaultActionMode=value};this.addNew=function(button){var tmpIndex=buttonList.push(button);var tmpButton=document.getElementById(button.id);
tmpButton.style.background=button.urlImage;tmpButton.index=(tmpIndex-1);tmpButton.onmouseover=buttonOver;tmpButton.onmouseout=buttonOut;tmpButton.onclick=buttonClick};this.deSelected=function(){isSelected==null
};this.setSelected=function(id){var tmpObj=document.getElementById(id);var isButtonSelectedSwitch=false;setSelectedButton(tmpObj,isButtonSelectedSwitch)};function setSelectedButton(obj,isButtonSelectedSwitch){if(isSelected==null||!isButtonSelectedSwitch||isSelected!=obj.index){if(isSelected!=null){var tmpButton=document.getElementById(buttonList[isSelected].id);
tmpButton.style.background=buttonList[isSelected].urlImage}isSelected=obj.index;obj.style.background=buttonList[isSelected].urlImageSelected;eval(buttonList[isSelected].action)}else{obj.style.background=buttonList[obj.index].urlImage;
isSelected=null;if(!isNull(defaultActionMode)){eval(defaultActionMode)}}}function buttonOver(e){var tmpTarget=getTarget(e);if(buttonList[tmpTarget.index].urlImageOver!=null){tmpTarget.style.background=buttonList[tmpTarget.index].urlImageOver
}}function buttonOut(e){var tmpTarget=getTarget(e);if(isSelected!=tmpTarget.index){tmpTarget.style.background=buttonList[tmpTarget.index].urlImage}}function buttonClick(e){var tmpTarget=getTarget(e);var isButtonSelectedSwitch=true;
setSelectedButton(tmpTarget,isButtonSelectedSwitch)}}var navigationAction={recenter:0,zoomIn:1,recenterAndZoomIn:2,zoomOut:3};var crossOverWindow={no:0,yes:1};var mouseButton={left:1,middle:2,right:3};
var mouseCursor={hand:0,sticker:1,line:2,polyline:3};var mapEventMode={edition:0,pinpoint:1,geocod:2,drag:3,freeze:4};var toolBarPosition={vertical:0,horizontal:1};var imageFormat={png:0,gif:1,jpg:2};var popupType={bestDisplayOnMouseOver:0,centeredDisplayOnMouseClick:1};
var popupLookandFeel={blank:0,bubble:1};var popupPointerEvent={enabled:0,disabled:1};var popupPosition={HD:8,HG:2,BD:9,BG:3,HM:4,BM:5};var metaDataType={field:0,criteria:1,photo:2};var _DEBUG=new CityneoDEBUG();
function CityneoDEBUG(){this.obj=null;this.TBL=new Array();this.max=50;this.p=0;this.setRef=function(A){this.obj=document.getElementById(A)};this.debug=function(A){if(this.obj==null){return }var D;var B;
var C;this.TBL[this.p]=A;this.p++;if(this.p>=this.max){this.p=0}D=null;for(C=this.p;C<this.max;C++){if(this.TBL[C]!=null){B=this.TBL[C];if(D!=null){D=B+"<br/>"+D}else{D=B}}}for(C=0;C<this.p;C++){if(this.TBL[C]!=null){B=this.TBL[C];
if(D!=null){D=B+"<br/>"+D}else{D=B}}}this.obj.style.fontSize="9px";this.obj.innerHTML=D}}var _NAVIGATOR;_NAVIGATOR=new function(){this.Nom=navigator.appName;this.ns=(this.Nom=="Netscape")?true:false;this.ie=(this.Nom=="Microsoft Internet Explorer")?true:false;
this.opera=(this.Nom=="Opera")?true:false;this.includeLOADINGasBackground=(this.ns||this.ie)?true:false;this.cancelBubbleType=(document.all&&document.getElementById)?1:2;this.fadeInType=(document.all&&document.getElementById)?1:2;
this.customCursorType=(this.ns||this.opera)?1:2;this.customKeyCodeType=(this.ns||this.opera)?1:2;this.clickGauche=1;this.clickDroit=(this.ie)?2:3};function calculateOPTIMALPopupPosition(E,J,H,K,G,L,F){var M=E.offsetLeft+J;
var C=E.offsetTop+H;var I=0;var B=2;var A=0;var D;if((M+K+I)<L){D="A DROITE";B=8}else{if((M-K-I)>0){D="A GAUCHE";B=2}else{D="CENTRE";B=4}}if((C-G)>I){A=0}else{if((C+G)<(F-I)){A=1}else{if(C<F/2){A=1}else{A=0
}}}return B+A}function CityneoPOPUPbubble(M,g,D,b,a,c,k){var M=M;var g=g;var D=D;var I=D.offsetWidth;var E=D.offsetHeight;var b=b;var a=a;var c=c;var k=k;var Z=M+"pictoMain/popup/close.gif";var O="fred1";
var Y=600;var f=600;var X=12;var W=12;var V=12;var U=12;var T=12;var S=12;var Q=20;var P=65;var J=38;var R=16;var C=null;var L=0;var F=0;var H=0;var G=0;var m=0;var l=0;var K=0;var N=0;var e=0;var d=0;
this.setPosition=function(h){var n=O+"_";if(h==popupPosition.HD||h==popupPosition.HM||h==popupPosition.HG){n=n+"bas_";F=parseInt(a-(E+Q+P-k/2));l=Q;G=parseInt(k/2-(E+Q+P)/2);N=0;d=Q-R}else{if(h==popupPosition.BD||h==popupPosition.BM||h==popupPosition.BG){n=n+"haut_";
F=parseInt(a-k/2);l=P;G=parseInt(-k/2+(E+Q+P)/2);N=1;d=P-R}}if(h==popupPosition.HD||h==popupPosition.BD){n=n+"droit.gif";L=parseInt(b-c/2);m=V;H=parseInt(-c/2+(I+V+U)/2);K=parseInt(c/2-T/2);e=V+I+U-J}else{if(h==popupPosition.HG||h==popupPosition.BG){n=n+"gauche.gif";
L=parseInt(b+c/2-(V+I+U));m=V;H=parseInt(c/2-(I+V+U)/2);K=I+V+U-T-c/2;e=V+I+U-J}else{if(h==popupPosition.HM||h==popupPosition.BM){n=n+"droit.gif";L=parseInt(b-(V+I+U)/2);m=V;H=0;K=(I+V+U-T-S)/2;e=V+I+U-J
}}}C="url("+M+"pictoMain/popup/"+n+")"};this.getNEWIrecentrageX=function(){return H};this.getNEWIrecentrageY=function(){return G};this.getNEWIleft=function(){return L};this.getNEWItop=function(){return F
};this.getN1left=function(){return m};this.getN1top=function(){return l};this.getNEWIwidth=function(){return I+V+U};this.getNEWIheight=function(){return E+Q+P};function B(r,s){var v=createContourForPopup(r,"CHG",0,0,X,Q,g,C,0,0);
var t=createContourForPopup(r,"CHM",X,0,I+V+U-X-W,Q,g,C,-X,0);var n=createContourForPopup(r,"CHD",I+V+U-W,0,W,Q,g,C,-Y+W,0);var o=createContourForPopup(r,"CMG",0,Q,V,E,g,C,0,-Q);var p=createContourForPopup(r,"CMD",V+I,Q,U,E,g,C,-Y+U,-Q);
var h=createContourForPopup(r,"CBG",0,Q+E,T,P,g,C,0,-f+P);var u=createContourForPopup(r,"CBM",T,Q+E,I+V+U-T-S,P,g,C,parseInt(-Y/2+K),-f+P);var q=createContourForPopup(r,"CHD",I+V+U-S,Q+E,S,P,g,C,-Y+S,-f+P)
}function A(r,s){var v=createContourForPopup(r,"CHG",0,0,T,P,g,C,0,0);var t=createContourForPopup(r,"CHM",T,0,I+V+U-T-S,P,g,C,parseInt(-Y/2+K),0);var n=createContourForPopup(r,"CHD",I+V+U-S,0,S,P,g,C,-Y+S,0);
var o=createContourForPopup(r,"CMG",0,P,V,E,g,C,0,-P);var p=createContourForPopup(r,"CMD",V+I,P,U,E,g,C,-Y+U,-P);var h=createContourForPopup(r,"CBG",0,P+E,X,Q,g,C,0,-f+Q);var u=createContourForPopup(r,"CBM",X,P+E,I+V+U-X-W,Q,g,C,-X,-f+Q);
var q=createContourForPopup(r,"CBD",I+V+U-W,P+E,W,Q,g,C,-Y+W,-f+Q)}this.setPosition(popupPosition.HD);this.build=function(p,n){if(N==0){B(p,n)}else{if(N==1){A(p,n)}}if(n!=null){var o=document.createElement("div");
o.id=p+"_NCORNER";o.style.position="absolute";o.style.left=parseInt(e)+"px";o.style.top=parseInt(d)+"px";o.style.width=J+"px";o.style.height=R+"px";o.style.zIndex="230";var h="<a href='javascript:"+n+"'><img src='"+Z+"'/></a>";
o.innerHTML=h;g.appendChild(o)}}}function CityneoPOPUPblank(C,D,K,H,G,J,N){var D=D;var K=K;var L=K.offsetWidth;var M=K.offsetHeight;var H=H;var G=G;var J=J;var N=N;var I=C+"pictoMain/close.gif";var E=parseInt(H-J/2);
var F=parseInt(G-(M+N/2));var B=0;var A=parseInt(M);var Q=parseInt(-J/2+L/2);var P=parseInt(N/2-M/2);var O=0;var R=0;this.setPosition=function(S){if(S==popupPosition.HD||S==popupPosition.HM||S==popupPosition.HG){F=parseInt(G-(M+N/2));
R=0;A=parseInt(M);P=parseInt(N/2-M/2)}else{if(S==popupPosition.BD||S==popupPosition.BM||S==popupPosition.BG){F=parseInt(G-N/2);R=N;A=0;P=parseInt(-N/2+M/2)}}if(S==popupPosition.HD||S==popupPosition.BD){E=parseInt(H-J/2);
O=0;B=0;Q=parseInt(-J/2+L/2)}else{if(S==popupPosition.HG||S==popupPosition.BG){E=parseInt(H+J/2-L);O=0;B=parseInt(L-J);Q=parseInt(J/2-L/2)}else{if(S==popupPosition.HM||S==popupPosition.BM){E=parseInt(H-L/2);
O=0;B=parseInt(L/2-J/2);Q=0}}}};this.getNEWIrecentrageX=function(){return Q};this.getNEWIrecentrageY=function(){return P};this.getNEWIwidth=function(){return L};this.getNEWIheight=function(){return M+N
};this.getNEWIleft=function(){return E};this.getNEWItop=function(){return F};this.getN1left=function(){return O};this.getN1top=function(){return R};this.build=function(W,T){var U=document.createElement("div");
U.id=W+"_N3";U.style.zIndex="230";U.style.position="absolute";U.style.top=A+"px";U.style.left=B+"px";U.style.width=J+"px";U.style.height=N+"px";setBorder(U,DEFAULT_WINDOW_BORDER);D.appendChild(U);if(T!=null){var V=document.createElement("div");
V.id=W+"_NCORNER";V.style.position="absolute";V.style.left=parseInt(O+L-18)+"px";V.style.top=parseInt(R+2)+"px";V.style.width="10px";V.style.height="10px";V.style.zIndex="230";var S="<a href='javascript:"+T+"'><img src='"+I+"'/></a>";
V.innerHTML=S;D.appendChild(V)}}}function createContourForPopup(A,J,H,G,I,B,F,C,E,D){var K=document.createElement("div");K.id=A+"_"+J;K.style.position="absolute";K.style.left=H+"px";K.style.top=G+"px";
K.style.width=I+"px";K.style.height=B+"px";if(C!=null){K.style.backgroundImage=C;K.style.backgroundPosition=E+"px "+D+"px"}F.appendChild(K);return K}var DEFAULT_WINDOW_BORDER=new Border("2px","solid","#6E8D82");
function Border(){this.width;this.style;this.color}function Border(C,B,A){this.width=C;this.style=B;this.color=A}function setBorder(B,A){B.style.borderWidth=A.width;B.style.borderStyle=A.style;B.style.borderColor=A.color
}function firefoxContains(B,A){while(A&&(B!=A)&&(A!=null)){A=A.parentNode}return B==A}function createXMLDoc(B){if(window.ActiveXObject){var A=new ActiveXObject("Microsoft.XMLDOM");A.async="false";A.loadXML(B)
}else{var C=new DOMParser();var A=C.parseFromString(B,"text/xml")}return A.documentElement}function addXML(A,B){return"<"+A+">"+B+"</"+A+">"}function xmlReadField(A,C){try{return A.getElementsByTagName(C)[0].firstChild.data
}catch(B){return null}}function fadeIn(B,A){if(_NAVIGATOR.fadeInType==1){B.style.filter="alpha(opacity="+A+")"}else{if(_NAVIGATOR.fadeInType==2){B.style.MozOpacity=A/100}}}function getLeft(A){if(A.offsetParent){return(A.offsetLeft+getLeft(A.offsetParent))
}else{return(A.offsetLeft)}}function getTop(A){if(A.offsetParent){return(A.offsetTop+getTop(A.offsetParent))}else{return(A.offsetTop)}}function getCustomKeyCode(B){var A=null;if(_NAVIGATOR.customKeyCodeType==1){A=B.charCode?B.charCode:B.keyCode
}else{if(_NAVIGATOR.customKeyCodeType==2){A=window.event.keyCode}else{alert("getCustomKeyCode not used with your navigator.")}}return A}function getCustomClientRelatifX(C,B){var A;if(_NAVIGATOR.customCursorType==1){A=C.pageX-B.offsetLeft
}else{if(_NAVIGATOR.customCursorType==2){A=event.x+document.body.scrollLeft}else{alert("getCustomClientRelatifX not used with your navigator.")}}return A}function getCustomClientRelatifY(B,A){var C;if(_NAVIGATOR.customCursorType==1){C=B.pageY-A.offsetTop
}else{if(_NAVIGATOR.customCursorType==2){C=event.y+document.body.scrollTop}else{alert("getCustomClientRelatifY not used with your navigator.")}}return C}function getCustomCursorX(B){var A;if(_NAVIGATOR.customCursorType==1){A=B.pageX
}else{if(_NAVIGATOR.customCursorType==2){A=event.x+document.body.scrollLeft}else{alert("getCustomCursorX not used with your navigator.")}}return A}function getCustomCursorY(A){var B;if(_NAVIGATOR.customCursorType==1){B=A.pageY
}else{if(_NAVIGATOR.customCursorType==2){B=event.y+document.body.scrollTop}else{alert("getCustomCursorY not used with your navigator.")}}return B}function universalCancelBubble(A){if(_NAVIGATOR.cancelBubbleType==1){window.event.cancelBubble=true
}else{if(_NAVIGATOR.cancelBubbleType==2){A.stopPropagation()}else{alert("universalCancelBubble not used with your navigator.")}}}function setPreventDefault(A){if(window.event){window.event.returnValue=false
}else{A.preventDefault()}}function setOpacity(C,B){var A=parseInt(B);C.style.opacity=A>=100?1:"."+A;C.style.filter="alpha(opacity="+A+")"}function getTarget(A){return window.event?event.srcElement:A?A.target:null
}function getClientX(B){var A=window.event?window.event:B;return A.clientX}function getClientY(B){var A=window.event?window.event:B;return A.clientY}function getImageX(A){return window.event?event.offsetX:A?A.layerX:null
}function getImageY(A){return window.event?event.offsetY:A?A.layerY:null}function Pixel(A,B){this.x=A;this.y=B}function Position(B,A){this.left=B;this.top=A}function Size(B,A){this.width=B;this.height=A
}function isNull(A){return A==null||A==undefined?true:false}function isEmpty(A){return A.length==0?true:false}function isExist(A){return !isNull(A)&&!isEmpty(A)?true:false}function addEventListener(C,A,B){if(C.addEventListener){C.addEventListener(A,B,false)
}else{if(C.attachEvent){C.attachEvent("on"+A,B)}}}function removeEventListener(C,A,B){if(C.removeEventListener){C.removeEventListener(A,B,false)}else{if(C.detachEvent){C.detachEvent("on"+A,B)}}}function getMouseButton(B){var A=null;
if(!isNull(B)&&isExist(B.which)){switch(B.which){case 1:A=mouseButton.left;break;case 2:A=mouseButton.middle;break;case 3:A=mouseButton.right;break}}else{if(!isNull(window.event)&&isExist(event.button)){switch(event.button){case 1:A=mouseButton.left;
break;case 2:A=mouseButton.right;break}}}return A}function metaDataSandBox(){var A=new Array();this.editPOIFromMapCallBack=null;this.isEditPOIFromMapButtonUpdate=null;this.isEditPOIFromMapButtonCancel=null;
this.isEditPOIFromMapButtonDelete=null;this.setEditPOIFromMap=function(D,C,E,B){this.editPOIFromMapCallBack=D;this.isEditPOIFromMapButtonUpdate=C;this.isEditPOIFromMapButtonCancel=E;this.isEditPOIFromMapButtonDelete=B
};this.addMetaData=function(B){A.push(B)};this.getMetaDataList=function(){return A}}function metaData(D,C,A,B){this.metaDataType=D;this.name=C;this.isTitle=A;this.isDetail=B}var _CONFIG=new _CONFIG_GEO1();
_CONFIG.toDebug=false;_CONFIG.proxyName="proxy";function _CONFIG_RELATIF(){this.urlMAINcontent="/cityneo/CGS/GetContent";this.urlMAINmapDisplay="/cityneo/CGS/CGSMapdisplay";this.urlMAINproxy="/cityneo/CGS/CGSProxy";
this.urlMAINmgt="/cityneo/CGS/CGSMgtPOI";this.urlMAINgeocode="/cityneo/CGS/CGSGeocode"}function _CONFIG_LOCAL1(){this.urlMAINcontent="http://palinux03:8080/cityneo/CGS/GetContent";this.urlMAINmapDisplay="http://palinux03:8080/cityneo/CGS/CGSMapdisplay";
this.urlMAINproxy="http://palinux03:8080/cityneo/CGS/CGSProxy";this.urlMAINmgt="http://palinux03:8080/cityneo/CGS/CGSMgtPOI";this.urlMAINgeocode="http://palinux03:8080/cityneo/CGS/CGSGeocode"}function _CONFIG_LOCAL2(){this.urlMAINcontent="http://localhost:8080/cityneo/CGS/GetContent";
this.urlMAINmapDisplay="http://localhost:8080/cityneo/CGS/CGSMapdisplay";this.urlMAINproxy="http://localhost:8080/cityneo/CGS/CGSProxy";this.urlMAINmgt="http://localhost:8080/cityneo/CGS/CGSMgtPOI";this.urlMAINgeocode="http://localhost:8080/cityneo/CGS/CGSGeocode"
}function _CONFIG_GEO1(){this.urlMAINcontent="http://geo1.cityneo.com/cityneo/CGS/GetContent";this.urlMAINmapDisplay="http://geo1.cityneo.com/cityneo/CGS/CGSMapdisplay";this.urlMAINproxy="http://geo1.cityneo.com/cityneo/CGS/CGSProxy";
this.urlMAINmgt="http://geo1.cityneo.com/cityneo/CGS/CGSMgtPOI";this.urlMAINgeocode="http://geo1.cityneo.com/cityneo/CGS/CGSGeocode"}function _CONFIG_GEO1_8080(){this.urlMAINcontent="http://geo1.cityneo.com:8080/cityneo/CGS/GetContent";
this.urlMAINmapDisplay="http://geo1.cityneo.com:8080/cityneo/CGS/CGSMapdisplay";this.urlMAINproxy="http://geo1.cityneo.com:8080/cityneo/CGS/CGSProxy";this.urlMAINmgt="http://geo1.cityneo.com:8080/cityneo/CGS/CGSMgtPOI";
this.urlMAINgeocode="http://geo1.cityneo.com:8080/cityneo/CGS/CGSGeocode"}function _CONFIG_GEO4(){this.urlMAINcontent="http://geo4.cityneo.com/cityneo/CGS/GetContent";this.urlMAINmapDisplay="http://geo4.cityneo.com/cityneo/CGS/CGSMapdisplay";
this.urlMAINproxy="http://geo4.cityneo.com/cityneo/CGS/CGSProxy";this.urlMAINmgt="http://geo4.cityneo.com/cityneo/CGS/CGSMgtPOI";this.urlMAINgeocode="http://geo4.cityneo.com/cityneo/CGS/CGSGeocode"}function AJAX_XMLCGS(url,param,funcOK,nbEchec,funcKO,funcValid){var url=url;
var param=param;var funcOK=funcOK;var nbEchec=nbEchec;var funcKO=funcKO;var funcValid=funcValid;this.execute=function(){var xmlHttp;var useProxy=false;if(window.XMLHttpRequest){xmlHttp=new XMLHttpRequest();
useProxy=true}else{if(window.ActiveXObject){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){alert("Echec création AJAX "+e.toString())
}}}else{alert("AJAX non pris en charge !!")}}xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4){if(_CONFIG.toDebug){_DEBUG.debug("Retour AJAX "+xmlHttp.readyState)}var xmlDoc=null;var status;
var httpStatus=xmlHttp.status;if(httpStatus==200){try{xmlDoc=xmlHttp.responseXML;var statusParent=xmlDoc.getElementsByTagName("STATUS")[0];status=statusParent.getElementsByTagName("STATUS")[0].firstChild.data
}catch(e){status="ERR"}}else{status="HTTP-"+xmlHttp.status}if(!(status=="OK")){nbEchec=nbEchec-1;if(nbEchec>0){var isVALIDE=true;if(funcValid!=null){eval("isVALIDE="+funcValid)}if(isVALIDE){var AJAX_=new AJAX_XMLCGS(url,param,funcOK,nbEchec,funcKO,funcValid);
AJAX_.execute()}}else{eval(funcKO+"(httpStatus,status,xmlDoc,url,param)")}}else{eval(funcOK+"(xmlDoc);")}}};useProxy=true;if(useProxy){if(url.substring(0,4).toLowerCase()=="http"){var src_url="http://"+location.host.toLowerCase();
var n=src_url.length;if(src_url==url.toLowerCase().substring(0,n)){useProxy=false}else{useProxy=true}}else{useProxy=false}}var U;if(useProxy){U=_CONFIG.proxyName+"?PROXY_URL="+url+"&"+param}else{U=url+"?"+param
}if(_CONFIG.toDebug){_DEBUG.debug(U)}xmlHttp.open("GET",U);xmlHttp.send(null)}}function CityneoCONTENTLIST(){var K=true;var X;var T=null;var M;this.contentListPanel;this.contentList=null;var H;var C=null;
var I=null;var W=null;var P=null;var Y=null;var L=null;var a=null;var F=null;var E=null;var A=null;var V=new CityneoJukeboxPagination();var Q=3;var Z=5;var S=1;var B=null;var N=null;var G=null;var J=1;
var O=null;var D=null;this.serviceNonAvailable=function(d,b,e,c,f){alert("CityneoCONTENTLIST.serviceNonAvailable :"+d+","+b+":"+c+" "+f)};function U(g,k,h,f,e,d,c,b){this.isGrouped=g;this.left=k;this.top=h;
this.ref=f;this.content1=e;this.content2=d;this.content3=c;this.bestCoordinate=b}this.setPoiSelectedCursor=function(b){P=b};this.setLink=function(c,d,e,b){a=c;F=d;E=e;L=b};this.restitueContent=function(c,b){this.contentList=null;
this.contentList=new Array();W=new Array();this.updateContentList(b);this.contentListPanel=null;this.contentListPanel=new PanelManager();this.contentListPanel.setLength(this.contentList.length);V=null;
V=new CityneoJukeboxPagination();if(!V.init(T,B,N,this.contentList.length)){alert("error");return -1}this.displayContentList()};this.updateContentList=function(b){for(i=0;i<b.length;i++){i_x=parseInt(xmlReadField(b[i],"CX"));
i_y=parseInt(xmlReadField(b[i],"CY"));isGrouped=parseInt(xmlReadField(b[i],"ISGROUPED"));i_ref=xmlReadField(b[i],"REF");i_contenu1=xmlReadField(b[i],"CONTENT1");i_contenu2=xmlReadField(b[i],"CONTENT2");
i_contenu3=xmlReadField(b[i],"CONTENT3");tmpLScale=xmlReadField(b[i],"BEST_LSCALE");tmpPixelX=xmlReadField(b[i],"BEST_PIXEL_X");tmpPixelY=xmlReadField(b[i],"BEST_PIXEL_Y");this.contentList.push(new U(isGrouped==1?true:false,i_x,i_y,i_ref,i_contenu1,i_contenu2,i_contenu3,new coordinate(tmpPixelX,tmpPixelY,tmpLScale)))
}};this.displayContentList=function(){var c="";c+='<table cellpadding="0" cellspacing="0" border="0">';for(i=V.getStartPagination();i<V.getEndPagination();i++){if(isNull(this.contentList[i].content2)){var d=new RegExp(",K,","g");
var b=this.contentList[i].ref.split(d);c+='<tr><td><div id="'+T+"_"+i+'" >'+this.contentList[i].content1+"</div></td></tr>";if(a||F||E){c+='<tr><td align="right"><table cellspacing="0" cellpadding="0"><tr>';
if(!this.contentList[i].isGrouped){if(a){c+='<td>&#160;<a href="#" onclick="javascript:window.open(\'/'+L+"/web,iframe,3,"+b[1]+"', 'map', 'width=530,height=550,left=0,top=0,scrollbars=1,resizable=1');\">Plan</a>&#160;</td>"
}if(F){c+='<td>&#160;<a href="#" onclick="javascript:window.open(\'/jsp/route.jsp?action=drivemeTo&#38;c='+L+"&#38;poiId="+b[1]+"&#38;sessionId="+X+"', 'drivemeTo', 'width=530,height=450,left=0,top=0,scrollbars=1,resizable=1');\">S'y rendre</a>&#160;</td>"
}if(E){c+='<td>&#160;<a href="#" onclick="javascript:window.open(\'/jsp/route.jsp?action=drivemeFrom&#38;c='+L+"&#38;poiId="+b[1]+"&#38;sessionId="+X+"', 'drivemeFrom', 'width=530,height=450,left=0,top=0,scrollbars=1,resizable=1');\">En partir</a>&#160;</td>"
}}else{if(a){c+='<td><a href="#" onclick="javascript:'+A.getOName()+".setLScaleAndPixelXY("+this.contentList[i].bestCoordinate.lScale+","+this.contentList[i].bestCoordinate.longitude+","+this.contentList[i].bestCoordinate.latitude+');">Voir la liste</a></td>'
}}c+="</tr></td></table></td></tr>"}}else{W.push(i);c+='<tr><td><div ondblclick="javascript:'+T+".contentListPanel.displayPanel("+i+');" onclick="javascript:'+T+".contentListPanel.displayPanel("+i+');">'+this.contentList[i].content1+"</div></td></tr>";
c+='<tr id="panelCL_'+i+'"><td>'+this.contentList[i].content2+"</td></tr>"}}c+=V.displayPagination();c+="</table>";M.innerHTML=c;this.displayPagination(c)};this.previous=function(){V.previous();this.displayContentList()
};this.next=function(){V.next();this.displayContentList()};this.startPage=function(){V.startPage();this.displayContentList()};this.endPage=function(){V.endPage();this.displayContentList()};this.forward=function(){V.forward();
this.displayContentList()};this.backward=function(){V.backward();this.displayContentList()};this.displayPagination=function(c){for(i=0;i<W.length;i++){this.contentListPanel.addNew(W[i],"panelCL_"+W[i],false)
}var b=null;for(i=V.getStartPagination();i<V.getEndPagination();i++){b=document.getElementById(T+"_"+i);b.indexContener=i}if(P){var e;var d;for(i=V.getStartPagination();i<V.getEndPagination();i++){e=document.getElementById("Picto_"+i);
d=document.createElement("div");d.style.position="relative";d.style.width="10px";d.style.height="19px";d.style.left="-5px";d.style.background="url(/images/iproxi/poiSelectedCursor.gif)";d.style.display="none";
e.appendChild(d);e=document.getElementById(T+"_"+i);e.onmouseover=function(h){var g=getTarget(h);while(isNull(g.indexContener)&&g.isParent!=true){g=g.parentNode}g.style.background="#EEEEEE";var f=document.getElementById("Picto_"+g.indexContener);
f.style.zIndex=2;f.childNodes[0].style.display=""};e.onmouseout=function(h){var g=getTarget(h);while(isNull(g.indexContener)&&g.isParent!=true){g=g.parentNode}g.style.background="transparent";var f=document.getElementById("Picto_"+g.indexContener);
f.style.zIndex=1;f.childNodes[0].style.display="none"}}}};this.init=function(e,d,c,b){X=e;T=d;M=document.getElementById(c);A=b;this.contentListPanel=new PanelManager();B=Q;N=Z;G=S;this.contentList=new Array()
};this.setNbItem=function(b){V.setNbItem(b)};this.setPage=function(b){V.setPage(b);this.displayContentList()};var R=false;this.start=function(){this.isStarted=true}}function CityneoSANDBOX(C,I,G,K,B,E,H,D,F,A,L,J){this.id=C;
this.sandbox=I;this.fields=G;this.activeMap=K;this.activeList=B;this.maxelements=E;this.i_w=H;this.i_h=D;this.contentFunctionPROXY_picto=F;this.contentFunctionPROXY_contenu1=A;this.contentFunctionPROXY_contenu2=L;
this.contentFunctionPROXY_contenu3=J;this.simplificationObj=null;this.setSimplification=function(R,Q,O,T,N,S,P,M,V,U){this.simplificationObj=new Object();this.simplificationObj.pas=R;this.simplificationObj.maxAvantRegroupement=Q;
this.simplificationObj.W=O;this.simplificationObj.H=T;this.simplificationObj.bordureW=N;this.simplificationObj.bordureH=S;this.simplificationObj.groupPROXY_picto=P;this.simplificationObj.groupPROXY_contenu1=M;
this.simplificationObj.groupPROXY_contenu2=V;this.simplificationObj.groupPROXY_contenu3=U};this.copyFrom=function(M){this.sandbox=M.sandbox;this.fields=M.fields;this.activeMap=M.activeMap;this.activeList=M.activeList;
this.maxelements=M.maxelements;this.contentFunctionPROXY_picto=M.contentFunctionPROXY_picto;this.contentFunctionPROXY_contenu1=M.contentFunctionPROXY_contenu1;this.contentFunctionPROXY_contenu2=M.contentFunctionPROXY_contenu2;
this.contentFunctionPROXY_contenu3=M.contentFunctionPROXY_contenu3;this.simplificationObj=M.simplificationObj}}function CityneoCONTENTManager(){var toDEBUG=true;var defaultLSCALE=5;var sessionId;var oName;
var MAP;var CONTENTLIST;var contenuLocal=new Array();var added=0;var removePOIactionWhenFinished=null;var prefixContentLocal="lc";var prefixContentProxy="px";var actionSimplification=true;this.disabledSimplification=function(){actionSimplification=false
};var contenuSandbox=new Array();this.serviceNonAvailable=function(httpStatus,status,xmlDoc,url,param){alert("CityneoCONTENTManager.serviceNonAvailable :"+httpStatus+","+status+":"+url+" "+param)};var zoomToFitForLocal_pcenter=-1;
var zoomToFitForLocal_marge=0;var zoomToFitForLocal_todo=false;this.zoomToFitForLocal=function(pcenter,marge){zoomToFitForLocal_todo=true;zoomToFitForLocal_pcenter=pcenter;zoomToFitForLocal_marge=marge;
if(added<=0){var AUTOZoom=this.getCurrentXXXScaleForLocal(pcenter,marge);zoomToFitForLocal_todo=false;if(AUTOZoom!=null){MAP.setLScaleandCoord(AUTOZoom.lscale,AUTOZoom.x,AUTOZoom.y)}}};this.getCurrentXXXScaleForLocal=function(pcenter,marge){var w=MAP.getImageWidth();
var h=MAP.getImageHeight();var I=-1;var maxI=contenuLocal.length-1;var s;var maxX=-99999999999;var minX=-maxX;var maxY=maxX;var minY=-maxX;var maxX_=-99999999999;var minX_=-maxX_;var maxY_=maxX_;var minY_=-maxX_;
var nbREEL=0;while(I<maxI){I=I+1;s=contenuLocal[I];if(s.dxyvalide==1){nbREEL++;maxX=Math.max(maxX,s.dx);minX=Math.min(minX,s.dx);maxY=Math.max(maxY,s.dy);minY=Math.min(minY,s.dy);maxX_=Math.max(maxX_,s.cx);
minX_=Math.min(minX_,s.cx);maxY_=Math.max(maxY_,s.cy);minY_=Math.min(minY_,s.cy)}}var resu=new Object();if(nbREEL<1){return null}else{if(nbREEL==1){resu.x=maxX_;resu.y=maxY_;resu.pscale=defaultLSCALE}else{maxX=maxX+marge;
minX=minX-marge;maxY=maxY+marge;minY=minY-marge;var ratioX;var ratioY;if(pcenter==-1){resu.x=(maxX_+minX_)/2;resu.y=(maxY_+minY_)/2;ratioX=(maxX-minX)/w;ratioY=(maxY-minY)/h}else{s=contenuLocal[pcenter];
resu.x=s.cx;resu.y=s.cy;ratioX=2*Math.max(Math.abs(maxX-s.dx),Math.abs(minX-s.dx))/w;ratioY=2*Math.max(Math.abs(maxY-s.dy),Math.abs(minY-s.dy))/h}resu.pscale=Math.max(ratioX,ratioY)}}resu.lscale=MAP.getLScaleFromPScale(resu.pscale);
return resu};this.init=function(sessionId_,oName_,MAP_,CONTENTLIST_){sessionId=sessionId_;oName=oName_;MAP=MAP_;CONTENTLIST=CONTENTLIST_};this.isStarted=false;this.start=function(){this.isStarted=true};
this.stop=function(){this.isStarted=false};this.removeSandboxContent=function(id){if(toDEBUG){_DEBUG.debug("CityneoCONTENTManager.removeSandboxContent '"+id+"'")}alert("NON IMPLEMENTE")};this.addSandboxContent=function(sandbox){if(toDEBUG){_DEBUG.debug("CityneoCONTENTManager.addSandboxContent '"+sandbox.id+"'")
}var tmp=searchArrayByID(sandbox.id,contenuSandbox);if(tmp==null){contenuSandbox.push(sandbox)}else{tmp.copyFrom(sandbox)}if(MAP.isStarted){MAP.updateContent(false)}};this.removeLocalContent=function(id){var tmp=searchArrayByID(id,contenuLocal);
if(tmp!=null){if(tmp.dxyvalide!=-1){tmp.dxyvalide=-1;if(MAP.isStarted){MAP.updateContent(false)}}}};this.getLocalContentLength=function(){return contenuLocal.length};this.addLocalContent=function(local){if(toDEBUG){_DEBUG.debug("CityneoCONTENTManager.addLocalContent '"+local.id+"' = "+local.cx+" , "+local.cy)
}var tmp=searchArrayByID(local.id,contenuLocal);if(tmp==null){local.dxyvalide=0;contenuLocal.push(local)}else{tmp.cx=local.cx;tmp.cy=local.cy;tmp.dxyvalide=0}added=added+1;var AJAX=new AJAX_XMLCGS(_CONFIG.urlMAINmapDisplay,"sessionid="+sessionId+"&action=convert&ref="+local.id+"&cx="+local.cx+"&cy="+local.cy+"&ps=1&pt=2",oName+".CityneoCONTENTManager_traiteXML_Coordonnee",5,oName+".serviceNonAvailable",null);
AJAX.execute();return };this.editSBContent=function(i_ref,cx,cy){alert("Edition content="+i_ref)};this.geocod=function(i_ref,callback,cx,cy){var reg=new RegExp(",K,","g");var ref_=i_ref.split(reg);var sandbox=ref_[0];
var ref=ref_[1];if(toDEBUG){_DEBUG.debug("CityneoCONTENTManager.geocod cx = "+cx+" : cy = "+cy)}var AJAX=new AJAX_XMLCGS(_CONFIG.urlMAINmgt,"sessionid="+sessionId+"&ref="+callback+"&action=geocodeok&sandbox="+sandbox+"&id="+ref+"&cx="+cx+"&cy="+cy,oName+".CityneoCONTENTManager_traiteXML_geocod",5,oName+".serviceNonAvailable",null);
AJAX.execute()};this.CityneoCONTENTManager_traiteXML_geocod=function(xmlDoc){var statusParent=xmlDoc.getElementsByTagName("STATUS")[0];var ref=xmlReadField(statusParent,"REF");var content=xmlDoc.getElementsByTagName("CONTENT")[0];
if(MAP.isStarted){MAP.updateContent(false)}setTimeout(ref,0)};this.updateXY_POIfromSandBox=function(i_ref,dx,dy){var reg=new RegExp(",K,","g");var ref_=i_ref.split(reg);var sandbox=ref_[0];var ref=ref_[1];
if(toDEBUG){_DEBUG.debug("CityneoCONTENTManager.updateXY_POIfromSandBox dx = "+dx+" : dy = "+dy)}var AJAX=new AJAX_XMLCGS(_CONFIG.urlMAINmgt,"sessionid="+sessionId+"&action=movepoi&sandbox="+sandbox+"&id="+ref+"&dx="+dx+"&dy="+dy,oName+".CityneoCONTENTManager_traiteXML_updateXY_POIfromSandBox",5,oName+".serviceNonAvailable",null);
AJAX.execute()};this.removePOI=function(i_ref,_removePOIactionWhenFinished){removePOIactionWhenFinished=_removePOIactionWhenFinished;var reg=new RegExp(",K,","g");var ref_=i_ref.split(reg);var sandbox=ref_[0];
var ref=ref_[1];if(toDEBUG){_DEBUG.debug("CityneoCONTENTManager.removePOI sandbox = "+sandbox+" : ref = "+ref)}var AJAX=new AJAX_XMLCGS(_CONFIG.urlMAINmgt,"sessionid="+sessionId+"&action=remove&sandbox="+sandbox+"&id="+ref,oName+".CityneoCONTENTManager_traiteXML_removePOI",5,oName+".serviceNonAvailable",null);
AJAX.execute()};this.CityneoCONTENTManager_traiteXML_removePOI=function(xmlDoc){var nodeSTATUS=xmlDoc.getElementsByTagName("STATUS")[0];var statusCODE=nodeSTATUS.getElementsByTagName("STATUS")[0].firstChild.data;
var statusMSG=nodeSTATUS.getElementsByTagName("STATUS.MSG")[0].firstChild.data;if(statusCODE!="OK"){alert(statusMSG)}else{alert("Item deleted");setTimeout(removePOIactionWhenFinished,0)}};this.CityneoCONTENTManager_traiteXML_updateXY_POIfromSandBox=function(xmlDoc){var statusParent=xmlDoc.getElementsByTagName("STATUS")[0];
var ref=xmlReadField(statusParent,"REF");var content=xmlDoc.getElementsByTagName("CONTENT")[0];if(MAP.isStarted){MAP.updateContent(false)}};this.extractContent=function(dalleID,i_dx,i_dy,d0x,d0y,dalleZoom,LG,realBoundx1_,realBoundy1_,realBoundx2_,realBoundy2_){var realBoundx1=Math.ceil(realBoundx1_);
var realBoundx2=Math.ceil(realBoundx2_);var realBoundy1=Math.ceil(realBoundy1_);var realBoundy2=Math.ceil(realBoundy2_);if(toDEBUG){_DEBUG.debug("CityneoCONTENTManager.extractContent "+realBoundx1+","+realBoundy1+" "+realBoundx2+","+realBoundy2)
}var ctx=searchArrayLocalByBOUND(realBoundx1,realBoundy1,realBoundx2,realBoundy2,contenuLocal);if(ctx.length>0){if(toDEBUG){_DEBUG.debug("CityneoCONTENTManager.extractContent '"+dalleID+"' - LOCAL - "+ctx.length+" elements")
}var O="";var O1="";var i;for(i=0;i<ctx.length;i++){var tmp=ctx[i];O1=createXMLObj(null,i,null,tmp.id,tmp.picto,tmp.contenu1,tmp.contenu2,tmp.contenu3,tmp.w,tmp.h,tmp.dx,tmp.dy,d0x,d0y,dalleZoom,null,null,null);
if(i==0){O=O1}else{O=O+O1}}var text=addXML("DOC",O);var x=createXMLDoc(text);var cOBJ=x.getElementsByTagName("OBJ");if(MAP!=null&&MAP.isStarted){MAP.restitueContent(prefixContentLocal,dalleID,cOBJ,i_dx,i_dy)
}}for(i=0;i<contenuSandbox.length;i++){SB=contenuSandbox[i];if(SB==null){continue}if(toDEBUG){_DEBUG.debug("CityneoCONTENTManager.extractContent '"+dalleID+"' - PROXY '"+SB.id+"'")}var AJAX=new AJAX_XMLCGS(_CONFIG.urlMAINproxy,"sessionid="+sessionId+"&action=extractdalle&ref="+dalleID+","+i_dx+","+i_dy+","+d0x+","+d0y+","+dalleZoom+","+LG+","+SB.id+","+realBoundx1+","+realBoundx2+","+realBoundy1+","+realBoundy2+"&x1="+realBoundx1+"&y1="+realBoundy1+"&x2="+realBoundx2+"&y2="+realBoundy2+"&max="+SB.maxelements+"&sandbox="+SB.sandbox+"&class=null&fields="+SB.fields,oName+".CityneoCONTENTManager_traiteXML_ChargeProxy",5,oName+".serviceNonAvailable",null);
AJAX.execute()}};function calculateXML(OBJ,SB,sessionId,ref_,d0x,d0y,dalleZoom){var O="";var O1=null;for(i=0;i<OBJ.length;i++){if(OBJ[i]==null){continue}var picto=null;var contenu1=null;var contenu2=null;
var contenu3=null;var interact=null;var bestCoordinate_longitude=null;var bestCoordinate_latitude=null;var bestCoordinate_lScale=null;if(OBJ[i].isGrouped){if(SB.simplificationObj.groupPROXY_picto!=null){eval("picto="+SB.simplificationObj.groupPROXY_picto+"(sessionId,ref_[6],OBJ[i],i);")
}if(SB.simplificationObj.groupPROXY_contenu1!=null){eval("contenu1="+SB.simplificationObj.groupPROXY_contenu1+"(sessionId,ref_[6],OBJ[i],i);")}if(SB.simplificationObj.groupPROXY_contenu2!=null){eval("contenu2="+SB.simplificationObj.groupPROXY_contenu2+"(sessionId,ref_[6],OBJ[i],i);")
}if(SB.simplificationObj.groupPROXY_contenu3!=null){eval("contenu3="+SB.simplificationObj.groupPROXY_contenu3+"(sessionId,ref_[6],OBJ[i],i);")}interact=null;bestCoordinate_longitude=OBJ[i].bestCoordinate.longitude;
bestCoordinate_latitude=OBJ[i].bestCoordinate.latitude;bestCoordinate_lScale=OBJ[i].bestCoordinate.lScale}else{if(SB.contentFunctionPROXY_picto!=null){eval("picto="+SB.contentFunctionPROXY_picto+"(sessionId,ref_[6],OBJ[i],i);")
}if(SB.contentFunctionPROXY_contenu1!=null){eval("contenu1="+SB.contentFunctionPROXY_contenu1+"(sessionId,ref_[6],OBJ[i],i);")}if(SB.contentFunctionPROXY_contenu2!=null){eval("contenu2="+SB.contentFunctionPROXY_contenu2+"(sessionId,ref_[6],OBJ[i],i);")
}if(SB.contentFunctionPROXY_contenu3!=null){eval("contenu3="+SB.contentFunctionPROXY_contenu3+"(sessionId,ref_[6],OBJ[i],i);")}interact=oName;bestCoordinate_longitude=null;bestCoordinate_latitude=null;
bestCoordinate_lScale=null}O1=createXMLObj(interact,i,OBJ[i].isGrouped,OBJ[i].i_ref,picto,contenu1,contenu2,contenu3,OBJ[i].i_w,OBJ[i].i_h,OBJ[i].target_x,OBJ[i].target_y,d0x,d0y,dalleZoom,bestCoordinate_longitude,bestCoordinate_latitude,bestCoordinate_lScale);
if(i==0){O=O1}else{O=O+O1}}return O}this.CityneoCONTENTManager_traiteXML_ChargeProxy=function(xmlDoc){var statusParent=xmlDoc.getElementsByTagName("STATUS")[0];var ref=xmlReadField(statusParent,"REF");
var reg=new RegExp(",","g");var ref_=ref.split(reg);var i_dx=parseInt(ref_[1]);var i_dy=parseInt(ref_[2]);var d0x=parseInt(ref_[3]);var d0y=parseInt(ref_[4]);var dalleZoom=parseFloat(ref_[5]);var content=xmlDoc.getElementsByTagName("CONTENT")[0];
var cInteract=content.getElementsByTagName("D.INTERACT")[0];var cOBJ=cInteract.getElementsByTagName("OBJ");var SB=searchArrayByID(ref_[7],contenuSandbox);if(SB==null){return }var i_w=SB.i_w;var i_h=SB.i_h;
var realBoundx1=parseInt(ref_[8]);var realBoundx2=parseInt(ref_[9]);var realBoundy1=parseInt(ref_[10]);var realBoundy2=parseInt(ref_[11]);var BRUT=new Array();var i_x=null;var i_y=null;var i_ref=null;var cFLD=null;
var DATA=null;for(i=0;i<cOBJ.length;i++){i_x=parseInt(xmlReadField(cOBJ[i],"CX"));i_y=parseInt(xmlReadField(cOBJ[i],"CY"));i_ref=xmlReadField(cOBJ[i],"REF");cFLD=cOBJ[i].getElementsByTagName("FLD");DATA=new objGenericXXX();
for(j=0;j<cFLD.length;j++){fldName=xmlReadField(cFLD[j],"FLD.NAME");fldValue=xmlReadField(cFLD[j],"FLD.VALUE");DATA.addProperty(fldName,fldValue)}BRUT.push(new objBRUT(MAP.getOName(),i_ref,i_w,i_h,i_x,i_y,DATA,null))
}var OBJ_simplifie=BRUT;var OBJ_non_simplifie=BRUT;var OBJ_diff=false;if(SB.simplificationObj!=null&&actionSimplification){var pas=dalleZoom*SB.simplificationObj.pas;OBJ_simplifie=simplification(BRUT,realBoundx1,realBoundx2,realBoundy1,realBoundy2,pas,SB.simplificationObj.maxAvantRegroupement,dalleZoom,SB.simplificationObj.W,SB.simplificationObj.H,SB.simplificationObj.bordureW,SB.simplificationObj.bordureH);
OBJ_diff=true}actionSimplification=true;var O_simplifie=calculateXML(OBJ_simplifie,SB,sessionId,ref_,d0x,d0y,dalleZoom);var text_simplifie=addXML("DOC",O_simplifie);var x_simplifie=createXMLDoc(text_simplifie);
var cOBJnew_simplifie=x_simplifie.getElementsByTagName("OBJ");var O_non_simplifie=O_simplifie;var text_non_simplifie=text_simplifie;var x_non_simplifie=x_simplifie;var cOBJnew_non_simplifie=cOBJnew_simplifie;
if(OBJ_diff){O_non_simplifie=calculateXML(OBJ_non_simplifie,SB,sessionId,ref_,d0x,d0y,dalleZoom);text_non_simplifie=addXML("DOC",O_non_simplifie);x_non_simplifie=createXMLDoc(text_non_simplifie);cOBJnew_non_simplifie=x_non_simplifie.getElementsByTagName("OBJ")
}if(MAP!=null&&MAP.isStarted&&SB.activeMap){MAP.restitueContent(prefixContentLocal+SB.id,ref_[0],cOBJnew_simplifie,i_dx,i_dy)}if(CONTENTLIST!=null&&CONTENTLIST.isStarted&&SB.activeList){CONTENTLIST.restitueContent(prefixContentLocal+SB.id,cOBJnew_simplifie)
}};this.CityneoCONTENTManager_traiteXML_Coordonnee=function(xmlDoc){var statusParent=xmlDoc.getElementsByTagName("STATUS")[0];var ref=xmlReadField(statusParent,"REF");var content=xmlDoc.getElementsByTagName("CONTENT")[0];
var cx=parseFloat(xmlReadField(content,"C.X"));var cy=parseFloat(xmlReadField(content,"C.Y"));var tmp=searchArrayByID(ref,contenuLocal);if(tmp!=null){tmp.dx=cx;tmp.dy=cy;tmp.dxyvalide=1}added=added-1;if(added<=0){added=0;
if(zoomToFitForLocal_todo){this.zoomToFitForLocal(zoomToFitForLocal_pcenter,zoomToFitForLocal_marge)}if(MAP.isStarted){MAP.updateContent(false)}}};function simplification(BRUT,realBoundx1,realBoundx2,realBoundy1,realBoundy2,pas,maxAvantRegroupement,dalleZoom,W,H,bordureW,bordureH){var result=null;
var accrocheXmin=Math.floor(realBoundx1/pas);var accrocheYmin=Math.floor(realBoundy1/pas);var nbX=Math.floor(realBoundx2/pas+1)-accrocheXmin;var nbY=Math.floor(realBoundy2/pas+1)-accrocheYmin;accrocheXmin=accrocheXmin*pas;
accrocheYmin=accrocheYmin*pas;var grille=new Array();var pX=0;var pY=0;var pXY=0;var e;var besoinPass2=false;for(i=0;i<BRUT.length;i++){BRUT[i].isGrouped=false;pX=Math.floor((BRUT[i].src_x-accrocheXmin)/pas);
pY=Math.floor((BRUT[i].src_y-accrocheYmin)/pas);pXY=pY*nbX+pX;if(grille[pXY]==null){grille[pXY]=new Object();grille[pXY].pois=new Array()}grille[pXY].pois.push(BRUT[i]);if(grille[pXY].pois.length>=maxAvantRegroupement){besoinPass2=true
}}if(besoinPass2){result=new Array();for(x=0;x<nbX;x++){for(y=0;y<nbY;y++){pXY=y*nbX+x;if(grille[pXY]==null){continue}if(grille[pXY].pois.length<maxAvantRegroupement){result.push(grille[pXY].pois[0])}else{var newDATA=new Array();
var newREF=null;var cpt=0;var newBoundingRect=new boundingRect(grille[pXY].pois[cpt].src_x,grille[pXY].pois[cpt].src_y,grille[pXY].pois[cpt].src_x,grille[pXY].pois[cpt].src_y);var newLScale=null;var newLongitudePointX=null;
var newLatitudePointY=null;if(newREF==null){newREF=grille[pXY].pois[cpt].i_ref}else{newREF=newREF+","+grille[pXY].pois[cpt].i_ref}newDATA.push(grille[pXY].pois[cpt].DATA);grille[pXY].pois[cpt].toSuppr=true;
cpt++;for(;cpt<grille[pXY].pois.length;cpt++){if(grille[pXY].pois[cpt].src_x<newBoundingRect.minX){newBoundingRect.minX=grille[pXY].pois[cpt].src_x}if(grille[pXY].pois[cpt].src_y<newBoundingRect.minY){newBoundingRect.minY=grille[pXY].pois[cpt].src_y
}if(grille[pXY].pois[cpt].src_x>newBoundingRect.maxX){newBoundingRect.maxX=grille[pXY].pois[cpt].src_x}if(grille[pXY].pois[cpt].src_y>newBoundingRect.maxY){newBoundingRect.maxY=grille[pXY].pois[cpt].src_y
}if(newREF==null){newREF=grille[pXY].pois[cpt].i_ref}else{newREF=newREF+","+grille[pXY].pois[cpt].i_ref}newDATA.push(grille[pXY].pois[cpt].DATA);grille[pXY].pois[cpt].toSuppr=true}var deltaX=newBoundingRect.maxX-newBoundingRect.minX;
var deltaY=newBoundingRect.maxY-newBoundingRect.minY;newLongitudePointX=parseInt((newBoundingRect.maxX+newBoundingRect.minX)/2);newLatitudePointY=parseInt((newBoundingRect.maxY+newBoundingRect.minY)/2);
var deltaMaxXY=Math.max(deltaX,deltaY);var pScaleInMeterWished=deltaMaxXY/Math.min(MAP.getImageWidth(),MAP.getImageHeight());newLScale=MAP.getLScaleFromPScale(pScaleInMeterWished);var N=new objBRUT(MAP.getOName(),newREF,W,H,newLongitudePointX,newLatitudePointY,newDATA,new coordinate(newLongitudePointX,newLatitudePointY,newLScale));
N.isGrouped=true;result.push(N)}}}}else{result=BRUT}return result}}function objBRUT(F,H,E,G,D,A,C,B){this.oMapName=F;this.i_ref=H;this.i_w=E;this.i_h=G;this.src_x=D;this.src_y=A;this.target_x=D;this.target_y=A;
this.DATA=C;this.bestCoordinate=B}function coordinate(A,C,B){this.longitude=A;this.latitude=C;this.lScale=B}function boundingRect(A,D,C,B){this.minX=A;this.minY=D;this.maxX=C;this.maxY=B}function objGenericFLDXXX(B,A){this.id=B;
this.value=A}function objGenericXXX(){var B=new Array();var A=new Array();this.addProperty=function(C,D){var E=searchArrayByID(C,B);if(E==null){B.push(new objGenericFLDXXX(C,D));A.push(C)}else{E.value=D
}};this.getProperty=function(C){var D=searchArrayByID(C,B);if(D==null){return null}else{return D.value}};this.getListFields=function(){return A}}function searchArrayByID(F,D){var A=D.length-1;var B=-1;
var E=false;var C;while((B<A)&&(!(E))){B=B+1;C=D[B];E=(F==C.id)}if(E){return D[B]}else{return null}}function searchArrayLocalByBOUND(C,F,A,D,H){var G=-1;var E=H.length-1;var J;var B=new Array();while(G<E){G=G+1;
J=H[G];if(J.dxyvalide==1){if(J.dx>=C&&J.dx<=A&&J.dy>=F&&J.dy<=D){B.push(J)}}}return B}function createXMLObj(C,I,M,G,O,F,E,D,L,Q,R,P,B,A,J,K,H,N){var S=addXML("INDEX",I);S=S+addXML("CX",(R-B)/J)+addXML("CY",(A-P)/J);
S=S+addXML("W",L)+addXML("H",Q);if(C){S=S+addXML("INTERACT",C)}if(M!=null){S=S+addXML("ISGROUPED",M?1:0)}if(G!=null){S=S+addXML("REF",G)}if(O!=null){S=S+addXML("PICTO","<![CDATA["+O+"]]>")}if(F!=null){S=S+addXML("CONTENT1","<![CDATA["+F+"]]>")
}if(E!=null){S=S+addXML("CONTENT2","<![CDATA["+E+"]]>")}if(D!=null){S=S+addXML("CONTENT3","<![CDATA["+D+"]]>")}if(K!=null){S=S+addXML("BEST_PIXEL_X",K)}if(H!=null){S=S+addXML("BEST_PIXEL_Y",H)}if(N!=null){S=S+addXML("BEST_LSCALE",N)
}return addXML("OBJ",S)}function localContent(A,E,C,J,F,D,B,I,H,G){this.id=A;this.cx=E;this.cy=C;this.w=J;this.h=F;this.classe=D;this.picto=B;this.contenu1=I;this.contenu2=H;this.contenu3=G;this.dx=0;this.dy=0;
this.dxyvalide=0}function DataTransform(){var A=null;var E=null;var D=null;var C=null;var B=null;this.setObjXML=function(F){A=!isNull(F.getProperty("NUM"))?F.getProperty("NUM"):"";E=!isNull(F.getProperty("RUE"))?F.getProperty("RUE"):"";
D=!isNull(F.getProperty("VILLE"))?F.getProperty("VILLE"):"";C=!isNull(F.getProperty("ZIP"))?F.getProperty("ZIP"):"";B=!isNull(F.getProperty("PAYS"))?F.getProperty("PAYS"):""};this.getNum=function(){return A
};this.getStreet=function(){return E};this.getCity=function(){return D};this.getZipcode=function(){return C};this.getCountrycode=function(){return B}}function CityneoJukeboxPagination(){var J=5;var B=4;
var H=1;var K=null;var E=null;var A=null;var F=null;var C=1;var G=null;var L=null;var N=null;var I=null;var D=null;var M=null;this.init=function(P,O,R,Q){E=isExist(O)?O:J;A=isExist(R)?R:B;if(!isExist(P)){return false
}K=P;if(!isExist(Q)){return false}D=Q;M=Math.ceil(D/E);F=1;N=0;I=E<D?E:D;G=1;L=M>A?A:M;return true};this.getStartPagination=function(){return N};this.getEndPagination=function(){return I};this.setNbItem=function(O){E=O
};this.setPage=function(P){var O=P-F;F=P;this.computePagination();if(O>0){if(L+O<=M){L+=(O-1);G+=(O-1)}else{L=M;G=M-(A-1)>C?M-(A-1):C}}else{if(G+O>C){O=Math.abs(O);G-=(O-1);L-=(O-1)}else{G=C;L=C+(A-1)<M?C+(A-1):M
}}};this.displayPagination=function(){var O="";O+="<table><tr><td>Page </td>";if(G-C>=2){O+='<td><a href="javascript:'+K+'.startPage();"><em><<</em></a>&#160;</td>'}else{O+="<td><<&#160;</td>"}if(G-C>=1){O+='<td><a href="javascript:'+K+'.backward();"><em><</em></a>&#160;</td>'
}else{O+="<td><&#160;</td>"}for(i=G;i<=L;i++){if(i!=F){O+='<td><a href="javascript:'+K+".setPage("+i+');">'+i+"</td>"}else{O+="<td>"+i+"</td>"}}if(M-L>=1){O+='<td>&#160;<a href="javascript:'+K+'.forward();"><em>></em></a></td>'
}else{O+="<td>&#160;></td>"}if(M-L>=2){O+='<td>&#160;<a href="javascript:'+K+'.endPage();"><strong><em>>></em></strong></a></td>'}else{O+="<td>&#160;>></td>"}O+="</tr></table>";return O};this.computePagination=function(){N=(F-1)*E;
I=F*E>D?D:F*E};this.previous=function(){F--};this.next=function(){F++};this.startPage=function(){F=C;G=C;L=A;this.computePagination()};this.endPage=function(){F=M;G=M-A+1;L=M;this.computePagination()};
this.backward=function(){if(G-A>C){G-=A;L-=A;F=L}else{F=G-1;G=C;L=C+(A-1)}this.computePagination()};this.forward=function(){if(L+A<=M){L+=A;G+=A;F=G}else{F=L+1;L=M;G=M-(A-1)}this.computePagination()}}function geocodingList(_sessionId,_oName,_objRef,_sandbox,_metaDataList,_objMap,_objParse,_actionWhenGeocodFinished){var sessionId=_sessionId;
var oName=_oName;var objRef=_objRef;var sandbox=_sandbox;var metaDataList=_metaDataList;var objMap=_objMap;var objParse=_objParse;var actionWhenGeocodFinished=_actionWhenGeocodFinished;var url=_CONFIG.urlMAINmgt;
var dataTransform=new DataTransform();var address=null;this.geocodingListPanel=null;var idGeocodButton=null;var idParseButton=null;var geocodButtonAction=null;var parseButtonAction=null;var defaultActionMode='_MAP.setMapEventMode( new function() {this.eventMode = mapEventMode.drag;this.cursorHand = "pointer";this.cursorMove = "move";});';
var myGeocodingListButtonManager=null;var geocodParam=new CityneoBUTTONTypeSticker(mapEventMode.geocod,"crosshair","/images/popup/cityneo.png",-8,-35,sandbox,"stickerForm",281,330);var objDetailSelected=null;
var cOBJ=null;var pagination=null;this.start=function(){this.geocodingListPanel=new PanelManager();myGeocodingListButtonManager=new buttonManager();myGeocodingListButtonManager.setDefaultActionMode(defaultActionMode);
address=new Array();var param="sessionid="+sessionId+"&action=geocode&sandbox="+sandbox+"&fields=";if(metaDataList.length>0){i=0;param+=metaDataList[i].name;i++;while(i<metaDataList.length){param+=",";
param+=metaDataList[i].name;i++}}var funcOK=oName+".geocodingListResultXML";var nbEchec=0;var funcKO=oName+".geocodingListResultXMLKO";var funcVALIDE=null;(new AJAX_XMLCGS(url,param,funcOK,nbEchec,funcKO,funcVALIDE)).execute()
};this.setGeocod=function(i,id){var param=new Object();param.id=sandbox+",K,"+id;param.callback=oName+".refresh()";var tmpIdGeocodButton="geocodButton_"+i;var tmpObjGeocod=document.getElementById(tmpIdGeocodButton);
var tmpObjDetail=tmpObjGeocod.parentNode;if(objDetailSelected!=null&&objDetailSelected!=tmpObjDetail){objDetailSelected.style.background="transparent"}if(objDetailSelected!=tmpObjDetail){tmpObjDetail.style.background="#00FFFF";
objDetailSelected=tmpObjDetail}objMap.setMapEventMode(geocodParam,param)};this.parse=function(i,id){dataTransform.setObjXML(address[i]);objParse.updateForm(dataTransform.getNum(),dataTransform.getStreet(),dataTransform.getCity(),dataTransform.getZipcode(),dataTransform.getCountrycode());
objParse.geocodeCurrent(true);var tmpIdGeocodButton="geocodButton_"+i;myGeocodingListButtonManager.setSelected(tmpIdGeocodButton)};this.refresh=function(){var root=document.getElementById(objRef);root.innerHTML="";
this.start();myGeocodingListButtonManager.deSelected();objDetailSelected=null;eval(actionWhenGeocodFinished)};this.geocodingListResultXMLKO=function(httpStatus,status,xmlDoc,url,param){alert("geocodingListResultXMLKO="+status+" :"+url+" "+param)
};this.geocodingListResultXML=function(xmlDoc){var statusParent=xmlDoc.getElementsByTagName("STATUS")[0];var status=xmlReadField(statusParent,"STATUS");if(!(status=="OK")){alert("!! ERROR TYPE MANAGEMENT :: geocodingListResultXML ="+status+" !!");
return }var content=xmlDoc.getElementsByTagName("CONTENT")[0];cOBJ=content.getElementsByTagName("OBJ");pagination=null;pagination=new CityneoJukeboxPagination();pagination.init(oName,4,4,cOBJ.length);this.geocodingListPanel.setLength(cOBJ.length);
this.displayContentToGeocod()};this.displayContentToGeocod=function(){var oMAIN=document.getElementById(objRef);oMAIN.innerHTML="";var oDivTitle;var title;var divTitle;var divDetail;var detail;var fldNodeXML;
var target;var geocodButton=null;var parseButton=null;var itemListToGeocod="";for(i=pagination.getStartPagination();i<pagination.getEndPagination();i++){fldNodeXML=cOBJ[i].getElementsByTagName("FLD");target=new objGenericXXX();
for(j=0;j<fldNodeXML.length;j++){target.addProperty(xmlReadField(fldNodeXML[j],"FLD.NAME"),xmlReadField(fldNodeXML[j],"FLD.VALUE"))}target.addProperty("ID",xmlReadField(cOBJ[i],"ID"));title=getTitle(target);
detail=getDetail(i,target);address.push(target);itemListToGeocod+='<table cellpadding="0" cellspacing="0" >';itemListToGeocod+='<tr><td bgcolor="';itemListToGeocod+=i%2==0?'#B1DAFA"':'#73BFFA"';itemListToGeocod+='><div ondblclick="javascript:'+oName+".geocodingListPanel.displayPanel("+i+');" onclick="javascript:'+oName+".geocodingListPanel.displayPanel("+i+');">'+title+"</div></td></tr>";
itemListToGeocod+='<tr id="panelTG_'+i+'"><td>'+detail+"</td></tr>";itemListToGeocod+="</table>"}itemListToGeocod+=pagination.displayPagination();oMAIN.innerHTML+=itemListToGeocod;for(i=pagination.getStartPagination();
i<pagination.getEndPagination();i++){idGeocodButton="geocodButton_"+i;idParseButton="parseButton_"+i;geocodButtonAction=oName+".setGeocod("+i+",'"+address[i-pagination.getStartPagination()].getProperty("ID")+"')";
parseButtonAction=oName+".parse("+i+",'"+address[i-pagination.getStartPagination()].getProperty("ID")+"')";geocodButton=new button(idGeocodButton,"url(/images/toolbar/pinpoint.png)","url(/images/toolbar/pinpointOver.png)",geocodButtonAction);
parseButton=new button(idParseButton,"url(/images/toolbar/geocod.png)","url(/images/toolbar/geocodOver.png)",parseButtonAction);myGeocodingListButtonManager.addNew(geocodButton);myGeocodingListButtonManager.addNew(parseButton);
this.geocodingListPanel.addNew(i,"panelTG_"+i,false)}};function getTitle(target){var result="";for(j=0;j<metaDataList.length;j++){if(metaDataList[j].isTitle){var value=target.getProperty(metaDataList[j].name);
result+="<div>"+value+"</div>"}}return result}function getDetail(i,target){var result="";for(j=0;j<metaDataList.length;j++){if(metaDataList[j].isDetail){var value=target.getProperty(metaDataList[j].name);
result+="<div>"+metaDataList[j].name+" = "+value+"</div>"}}idGeocodButton="geocodButton_"+i;idParseButton="parseButton_"+i;result+='<div style="width:70px;height:52px;float:left;" id="'+idGeocodButton+'"></div>';
result+='<div style="width:70px;height:52px;float:left;" id="'+idParseButton+'"></div>';return result}function onmouseover(e){var tmpTarget=getTarget(e);tmpTarget.style.cursor="pointer"}function onmousedown(e){var tmpTarget=getTarget(e);
if(tmpTarget.id.indexOf("Object_TITLE_")==-1){return }var oDetail=document.getElementById(tmpTarget.id+"_detail");oDetail.style.display=oDetail.style.display=="none"?"block":"none"}this.setPage=function(value){pagination.setPage(value);
this.displayContentToGeocod()};this.previous=function(){pagination.previous();this.displayContentToGeocod()};this.next=function(){pagination.next();this.displayContentToGeocod()};this.startPage=function(){pagination.startPage();
this.displayContentToGeocod()};this.endPage=function(){pagination.endPage();this.displayContentToGeocod()};this.backward=function(){pagination.backward();this.displayContentToGeocod()};this.forward=function(){pagination.forward();
this.displayContentToGeocod()}}var _internal_shared_v1_forsticker="";var _internal_shared_v2_forsticker="";var _internal_shared_v3_forsticker="";var _internal_shared_v4_forsticker="";var _internal_shared_v5_forsticker="";
var _internal_shared_v6_forsticker="";function CityneoMAP(){var OBJMAP=this;var toDEBUG=true;var debugDallage=false;var sessionId;var oName;var pathMain;var contentMGT;var NAV;var bg;var loadingLogo;var cx;
var cy;var format;var lg;var lscale;var imageWidth;var imageHeight;var mapRef;var mapObj;var callbackCoordFunction;var oMap;var oLayerMainCurrent;var oLayerMainTarget;var zoomRange;var poiPopupType=popupType.bestDisplayOnMouseOver;
var poiPopupPointerEvent=popupPointerEvent.enabled;var poiPopupLookandFeel=popupLookandFeel.blank;var notCleanContentLMAIN_Type=null;var jeton=1;var dalle0Jeton=0;var dalle0JetonCurrent=0;var dalle0Param;
var recalculLMainJeton=0;var updateLMainJeton=0;var updateLMainLightJeton=0;var chargeDallePile=new Array();var startX;var startY;var isLeftDoubleClick=false;var leftMouseButtonPress;var leftMouseButtonTime=0;
var isRightDoubleClick=false;var rightMouseButtonPress;var rightMouseButtonTime=0;var layerMainPosition=new Pixel(0,0);var layerMatrixMapCurrentPosition=new Pixel(0,0);var lastLeftMouseButtonPress=0;var lastMouseUp=0;
var targetdecallageXToAdd;var targetdecallageYToAdd;var currentdecallageXToAdd;var currentdecallageYToAdd;var decallageXToAddpas;var decallageYToAddpas;var decallageYXPos;var targetrecalcul;var isDalle0loaded=false;
var decallageXpixel;var decallageYpixel;var decallageXToAddpixel;var decallageYToAddpixel;var dalleZoom;var dalleWidth;var dalleHeight;var dalleLG;var x0;var y0;var currentMinMax;var popupname="popup1_XYR";
var layermainprefix="lmain";var divmap="map";var dalleprefix="lCTX";var cursorInteractif="CCCC";var threadStartedLSCALE=false;var threadStartedCOORD=false;var threadStarted=false;var currentMapEventMode=null;
var currentMapEventParam=null;var mapEvent_geocod_id=null;var mapEvent_geocod_callback=null;var DEFAULT_DOUBLE_CLICK_TIME=500;var DEFAULT_SMOOTH_MOUSE=8;var DEFAULT_NAVIGATION_ACTION=navigationAction.recenterAndZoomIn;
var DEFAULT_CROSS_OVER_WINDOW=crossOverWindow.yes;var DEFAULT_MAP_EVENT_MODE=mapEventMode.drag;var DEFAULT_MAP_EVENT_PARAM=function(){this.cursorHand="pointer";this.cursorMove="move"};var metaDataList=null;
var metaDataSandBox=null;this.isStarted=false;this.serviceNonAvailable=function(httpStatus,status,xmlDoc,url,param){alert("CityneoMAP.serviceNonAvailable :"+httpStatus+","+status+":"+url+" "+param)};this.init=function(sessionId_,oName_,pathMain_,format_,lg_,imageWidth_,imageHeight_,bg_,mapRef_,callbackCoordFunction_,contentMGT_,NAV_){sessionId=sessionId_;
oName=oName_;pathMain=pathMain_;format=format_;lg=lg_;imageWidth=imageWidth_;imageHeight=imageHeight_;bg=bg_;mapRef=mapRef_;callbackCoordFunction=callbackCoordFunction_;contentMGT=contentMGT_;NAV=NAV_;
loadingLogo=pathMain+"pictoMain/loading.gif";threadStartedLSCALE=false;threadStarted=false;leftMouseButtonPress=false;currentMapEventMode=DEFAULT_MAP_EVENT_MODE;currentMapEventParam=DEFAULT_MAP_EVENT_PARAM;
chargeZoomRange()};this.start=function(){this.isStarted=true;mapObj=document.getElementById(mapRef);var map=document.createElement("div");map.id=divmap;map.style.position="relative";map.style.left="0px";
map.style.top="0px";map.style.width=imageWidth+"px";map.style.height=imageHeight+"px";map.style.overflow="hidden";if(bg!=null){if(bg.color!=null){map.style.backgroundColor=bg.color}if(bg.image!=null){map.style.backgroundImage="url("+bg.image+")"
}if(bg.position!=null){map.style.backgroundPosition=bg.position}if(bg.repeat!=null){map.style.backgroundRepeat=bg.repeat}}mapObj.appendChild(map);oMap=document.getElementById(divmap);var layerMainCurrent=document.createElement("div");
layerMainCurrent.id=layermainprefix+"1";layerMainCurrent.style.position="absolute";layerMainCurrent.style.left="0px";layerMainCurrent.style.top="0px";layerMainCurrent.style.zIndex=11;oMap.appendChild(layerMainCurrent);
oLayerMainCurrent=document.getElementById(layermainprefix+"1");var layerMainTarget=document.createElement("div");layerMainTarget.id=layermainprefix+"2";layerMainTarget.style.position="absolute";layerMainTarget.style.left="0px";
layerMainTarget.style.top="0px";layerMainTarget.style.zIndex=10;oMap.appendChild(layerMainTarget);oLayerMainTarget=document.getElementById(layermainprefix+"2");addEventListener(oMap,"mousedown",mouseDownXXX);
addEventListener(document,"mousemove",mouseMoveXXX);addEventListener(document,"mouseup",mouseUpXXX);document.oncontextmenu=function(){return false};if(threadStartedLSCALE&&threadStartedCOORD&&!threadStarted){threadStarted=true;
refreshDalle0(0,0)}setTimeout(threadLoading,0)};this.getSessionId=function(){return sessionId};this.stopEventListener=function(){if(poiPopupPointerEvent==popupPointerEvent.disabled){removeEventListener(oMap,"mousedown",mouseDownXXX);
removeEventListener(document,"mousemove",mouseMoveXXX);removeEventListener(document,"mouseup",mouseUpXXX)}};this.playEventListener=function(){if(poiPopupPointerEvent==popupPointerEvent.disabled){addEventListener(oMap,"mousedown",mouseDownXXX);
addEventListener(document,"mousemove",mouseMoveXXX);addEventListener(document,"mouseup",mouseUpXXX)}};this.setMetaDataSandBox=function(_metaDataSandBox){metaDataSandBox=_metaDataSandBox;metaDataList=metaDataSandBox.getMetaDataList()
};this.setMapEventMode=function(param,optionalParam){if(isNull(optionalParam)&&param.eventMode==mapEventMode.geocod){return false}if(currentMapEventMode==mapEventMode.pinpoint||currentMapEventMode==mapEventMode.geocod){try{var oCursorInteractif=document.getElementById(cursorInteractif);
oCursorInteractif.parentNode.removeChild(oCursorInteractif)}catch(e){}}mapEvent_geocod_id=null;mapEvent_geocod_callback=null;if(param.eventMode==mapEventMode.geocod){mapEvent_geocod_id=optionalParam.id;
mapEvent_geocod_callback=optionalParam.callback;if(isNull(mapEvent_geocod_id)){return false}}else{if(param.eventMode==mapEventMode.pinpoint){if(isNull(param.sandbox)){return false}}}currentMapEventMode=param.eventMode;
currentMapEventParam=param;switch(currentMapEventMode){case mapEventMode.drag:case mapEventMode.edition:oMap.style.cursor=param.cursorHand;break;case mapEventMode.pinpoint:case mapEventMode.geocod:oMap.style.cursor=currentMapEventParam.cursor;
var contenerStickerCursor=document.createElement("div");contenerStickerCursor.id=cursorInteractif;contenerStickerCursor.type="cursorPinpoint";contenerStickerCursor.style.position="absolute";contenerStickerCursor.style.width="10px";
contenerStickerCursor.style.height="10px";contenerStickerCursor.style.zIndex=100;var imageStickerCursor=document.createElement("img");imageStickerCursor.src=currentMapEventParam.image;contenerStickerCursor.appendChild(imageStickerCursor);
oLayerMainCurrent.appendChild(contenerStickerCursor);notCleanContentLMAIN_Type=contenerStickerCursor.type;modePinpointIsPinpointing=false;break}this.refreshMain();return true};function threadLoading(){var delay=100;
try{delay=threadLoadingRun()}catch(e){delay=500}setTimeout(threadLoading,delay)}function threadLoadingRun(){if(dalle0Jeton>0&&dalle0JetonCurrent!=dalle0Jeton){recalculLMainJeton=0;updateLMainJeton=0;updateLMainLightJeton=0;
dalle0JetonCurrent=dalle0Jeton;refreshDalle0_run(dalle0Param);return 50}else{if(recalculLMainJeton>0){cleanContentLMAIN(oLayerMainCurrent,notCleanContentLMAIN_Type,null,null);recalculLMainJeton=0;updateLMainJeton=jeton++;
updateLMainLightJeton=0;return 100}else{if(updateLMainJeton>0){updateLMainJeton=0;updateLMainLightJeton=0;updateDallageFenetre(true);return 10}else{if(updateLMainLightJeton>0){updateLMainLightJeton=0;updateDallageFenetre(false);
return 10}else{if(chargeDallePile.length>0){var toLOOP=true;while(toLOOP){var d=chargeDallePile.pop();if(d.jeton<dalle0JetonCurrent){if(chargeDallePile.length<=0){toLOOP=false}}else{chargeDalleXY_run(d);
toLOOP=false}}return 10}else{if(jeton>10000&&chargeDallePile.length<=0){if(dalle0JetonCurrent>0){dalle0JetonCurrent=1;jeton=2}else{jeton=1}}return 100}}}}}}this.getOMap=function(){return oMap};this.getOName=function(){return oName
};this.getImageWidth=function(){return imageWidth};this.getImageHeight=function(){return imageHeight};this.getLScale=function(){return lscale};this.getLG=function(){return lg};this.setPopupType=function(popupType_){poiPopupType=popupType_;
this.updateContent(false)};this.setPopupLookandFeel=function(popupLookandFeel_){poiPopupLookandFeel=popupLookandFeel_;this.updateContent(false)};this.setPopupPointerEvent=function(popupPointerEvent_){poiPopupPointerEvent=popupPointerEvent_
};this.getLScaleFromPScale=function(pscale){for(var i=0;i<zoomRange.length;i++){if(zoomRange[i]>=pscale){return i}}return zoomRange.length};this.setLScale=function(lscale_){if(lscale!=lscale_){threadStartedLSCALE=true;
NAV.setLScale(lscale_);lscale=lscale_;if(threadStartedLSCALE&&threadStartedCOORD&&this.isStarted){if(toDEBUG){_DEBUG.debug("CityneoMAP.setLScale - START")}threadStarted=true;refreshDalle0(0,0)}}};this.setCoord=function(cx_,cy_){if(toDEBUG){_DEBUG.debug("CityneoMAP.setCoord "+cx_+"x"+cy_)
}cx=cx_;cy=cy_;if(callbackCoordFunction!=null){setTimeout(callbackCoordFunction+"("+cx+","+cy+")",0)}threadStartedCOORD=true;if(threadStartedLSCALE&&threadStartedCOORD&&this.isStarted){if(toDEBUG){_DEBUG.debug("CityneoMAP.setCoord - START")
}threadStarted=true;refreshDalle0(0,0)}};this.setLScaleandCoord=function(lscale_,cx_,cy_){if(toDEBUG){_DEBUG.debug("CityneoMAP.setLScaleandCoord "+lscale_+" "+cx_+"x"+cy_)}threadStartedCOORD=true;threadStartedLSCALE=true;
cx=cx_;cy=cy_;if(callbackCoordFunction!=null){setTimeout(callbackCoordFunction+"("+cx+","+cy+")",0)}lscale=lscale_;NAV.setLScale(lscale_);if(threadStartedLSCALE&&threadStartedCOORD&&this.isStarted){if(toDEBUG){_DEBUG.debug("CityneoMAP.setLScaleandCoord - START")
}threadStarted=true;refreshDalle0(0,0)}};var lScaleWished=null;this.setLScaleAndPixelXY=function(lScale,pixelX,pixelY){lScaleWished=lScale;if(toDEBUG){_DEBUG.debug("CityneoMAP.setLScaleandPixelXY "+lScaleWished+" "+pixelX+"x"+pixelY)
}if(lScaleWished<lscale){recalculCoordonnee(pixelX,pixelY,".CityneoMAP_traiteXML_FromLScaleAndPixelXY")}else{}};this.CityneoMAP_traiteXML_FromLScaleAndPixelXY=function(xmlDoc){var tmpContent=xmlDoc.getElementsByTagName("CONTENT")[0];
var tmpLongitude=parseFloat(xmlReadField(tmpContent,"C.X"));var tmpLatitude=parseFloat(xmlReadField(tmpContent,"C.Y"));if(toDEBUG){_DEBUG.debug("CityneoMAP.CityneoMAP_traiteXML_FromLScaleAndPixelXY "+tmpLongitude+"x"+tmpLatitude)
}this.setLScaleandCoord(lScaleWished,tmpLongitude,tmpLatitude)};function refreshDalle0(dx,dy){dalle0Param=new Object();dalle0Param.dx=dx;dalle0Param.dy=dy;dalle0Param.jeton=jeton;dalle0Jeton=jeton++}function refreshDalle0_run(param){if(toDEBUG){_DEBUG.debug("CityneoMAP_refreshDalle0 "+cx+" x "+cy+" : "+param.dx+" x "+param.dy)
}var AJAX=new AJAX_XMLCGS(_CONFIG.urlMAINmapDisplay,"sessionid="+sessionId+"&ref="+param.jeton+"&action=dalle0&zrp="+lscale+"&dex="+param.dx+"&dey="+param.dy+"&cx="+cx+"&cy="+cy+"&w="+imageWidth+"&h="+imageHeight,oName+".CityneoMAP_traiteXML_Dalle0",5,oName+".serviceNonAvailable",null);
AJAX.execute();dalleLG=1;currentMinMax=null;decallageXToAddpixel=0;decallageYToAddpixel=0}this.CityneoMAP_traiteXML_Dalle0=function(xmlDoc){if(toDEBUG){_DEBUG.debug("CityneoMAP_traiteXML_Dalle0 "+cx+" x "+cy)
}var statusParent=xmlDoc.getElementsByTagName("STATUS")[0];var ref=xmlReadField(statusParent,"REF");var content=xmlDoc.getElementsByTagName("CONTENT")[0];cx=parseFloat(xmlReadField(content,"D0.XX"));cy=parseFloat(xmlReadField(content,"D0.YY"));
dalleZoom=parseFloat(xmlReadField(content,"D0.E"));decallageXpixel=Math.round(parseInt(xmlReadField(content,"D0.dX"))/dalleZoom);decallageXToAddpixel=0;decallageYpixel=Math.round(parseInt(xmlReadField(content,"D0.dY"))/dalleZoom);
decallageYToAddpixel=0;x0=parseFloat(xmlReadField(content,"D0.X0"));y0=parseFloat(xmlReadField(content,"D0.Y0"));dalleWidth=parseInt(xmlReadField(content,"D0.W"));dalleHeight=parseInt(xmlReadField(content,"D0.H"));
oLayerMainCurrent.style.left=(decallageXpixel+decallageXToAddpixel)+"px";oLayerMainCurrent.style.top=(decallageYpixel+decallageYToAddpixel)+"px";isDalle0loaded=true;if(dalle0Jeton==ref){dalle0Jeton=0;if(callbackCoordFunction!=null){setTimeout(callbackCoordFunction+"("+cx+","+cy+")",0)
}recalculLMainJeton=jeton++}};function editForm(_e,_mouseCursorPosition,i_ref){if(toDEBUG){_DEBUG.debug("CityneoMAP_traiteXML_EditForm")}var e=_e;var mouseCursorPosition=_mouseCursorPosition;_internal_shared_v3_forsticker=metaDataList;
var contenuDetails="";if(!isNull(metaDataSandBox.editPOIFromMapCallBack)){eval("contenuDetails="+metaDataSandBox.editPOIFromMapCallBack+"(_internal_shared_v3_forsticker);")}var contenu='<table border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="0"><tr><td><form method="post" id="formEDITION" enctype="multipart/form-data"><table border="0"><tr><td colspan="3">'+contenuDetails+'<input type="hidden" name="sessionid" id="sessionid" value="'+sessionId+'"></input><input type="hidden" name="action" id="action" value="update"></input><input type="hidden" name="sandbox" id="sandbox" value="'+currentMapEventParam.sandbox+'"></input><input type="hidden" name="i_ref" id="i_ref" value="'+i_ref+'"></input></td></tr><tr>';
if(metaDataSandBox.isEditPOIFromMapButtonCancel){contenu+='<td><input type="button" id="cancelButton" value="Cancel"></input></td>'}if(metaDataSandBox.isEditPOIFromMapButtonDelete){contenu+='<td><input type="button" id="deleteButton" value="Delete"></input></td>'
}if(metaDataSandBox.isEditPOIFromMapButtonUpdate){contenu+='<td><input type="button" id="submitButton" value="Ok"></input></td>'}"</tr></table></form></td></tr></table>";var newPOI=new genericPOI();newPOI.init(sessionId,mouseCursorPosition.x,mouseCursorPosition.y,20,20,imageWidth,imageHeight,lg,"NA",contenu,oLayerMainCurrent,"popup_creation",popupType.centeredDisplayOnMouseClick,popupLookandFeel.bubble,false,OBJMAP,pathMain);
newPOI.activate(e);var onSubmitButtonClick=function(e){var uploadHandler={upload:function(o){var xmlDoc=o.responseXML;var nodeSTATUS=xmlDoc.getElementsByTagName("STATUS")[0];var statusCODE=nodeSTATUS.getElementsByTagName("STATUS")[0].firstChild.data;
var statusMSG=nodeSTATUS.getElementsByTagName("STATUS.MSG")[0].firstChild.data;if(statusCODE=="KO"){alert(STATUS.MSG)}else{if(statusCODE=="INVALID"){alert("Session not valid, try to refresh your navigator.")
}}OBJMAP.finishPinpoint(e,newPOI.getDecalXwhenUnactivate(),newPOI.getDecalYwhenUnactivate());newPOI.unactivate(e,true);OBJMAP.updateContent(true)}};var url=_CONFIG.urlMAINmgt;var src_url="http://"+location.host.toLowerCase();
var isURLvalid=true;if(url.substring(0,4).toLowerCase()=="http"){var n=src_url.length;if(src_url==url.toLowerCase().substring(0,n)){isURLvalid=true}else{isURLvalid=false}}else{isURLvalid=true}YAHOO.util.Connect.asyncRequest("POST",url,uploadHandler);
YAHOO.util.Connect.setForm("formEDITION",true)};var onCancelButtonClick=function(e){OBJMAP.finishPinpoint(e,newPOI.getDecalXwhenUnactivate(),newPOI.getDecalYwhenUnactivate());newPOI.closeWindow(e,false)
};var onDeleteButtonClick=function(e){var tmpi_ref=document.getElementById("i_ref");var actionWhenFinished=oName+".updateContent(true)";contentMGT.removePOI(tmpi_ref.value,actionWhenFinished);OBJMAP.finishPinpoint(e,newPOI.getDecalXwhenUnactivate(),newPOI.getDecalYwhenUnactivate());
newPOI.closeWindow(e,false)};if(metaDataSandBox.isEditPOIFromMapButtonCancel){YAHOO.util.Event.on("cancelButton","click",onCancelButtonClick)}if(metaDataSandBox.isEditPOIFromMapButtonDelete){YAHOO.util.Event.on("deleteButton","click",onDeleteButtonClick)
}if(metaDataSandBox.isEditPOIFromMapButtonUpdate){YAHOO.util.Event.on("submitButton","click",onSubmitButtonClick)}}this.CityneoMAP_traiteXML_Dalle0light_1=function(xmlDoc){if(toDEBUG){_DEBUG.debug("CityneoMAP_traiteXML_Dalle0light_1")
}var statusParent=xmlDoc.getElementsByTagName("STATUS")[0];var ref=xmlReadField(statusParent,"REF");var content=xmlDoc.getElementsByTagName("CONTENT")[0];var newCX=parseFloat(xmlReadField(content,"D0.XX"));
var newCY=parseFloat(xmlReadField(content,"D0.YY"));var e=_internal_shared_v1_forsticker;var mouseCursorPosition=_internal_shared_v2_forsticker;_internal_shared_v3_forsticker=metaDataList;var contenuDetails=null;
eval("contenuDetails="+currentMapEventParam.callBackFunction+"(_internal_shared_v3_forsticker);");var contenu='<table border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="0"><tr><td><form method="post" id="formEDITION" enctype="multipart/form-data"><table border="0"><tr><td colspan="2">'+contenuDetails+'<input type="hidden" name="sessionid" id="sessionid" value="'+sessionId+'"></input><input type="hidden" name="action" id="action" value="insert"></input><input type="hidden" name="sandbox" id="sandbox" value="'+currentMapEventParam.sandbox+'"></input><input type="hidden" name="status" id="status" value="2"></input><input type="hidden" name="cx" id="cx" value="'+newCX+'"></input><input type="hidden" name="cy" id="cy" value="'+newCY+'"></input></td></tr><tr><td><input type="button" id="cancelButton" value="Cancel"></input></td><td><input type="button" id="uploadButton" value="Upload"></input></td></tr></table></form></td></tr></table>';
var newPOI=new genericPOI();newPOI.init(sessionId,mouseCursorPosition.x,mouseCursorPosition.y,20,20,imageWidth,imageHeight,lg,"NA",contenu,oLayerMainCurrent,"popup_creation",popupType.centeredDisplayOnMouseClick,popupLookandFeel.bubble,false,this,pathMain);
newPOI.activate(e);var onUploadButtonClick=function(e){YAHOO.util.Connect.setForm("formEDITION",true);var uploadHandler={upload:function(o){var xmlDoc=o.responseXML;var nodeSTATUS=xmlDoc.getElementsByTagName("STATUS")[0];
var statusCODE=nodeSTATUS.getElementsByTagName("STATUS")[0].firstChild.data;var statusMSG=nodeSTATUS.getElementsByTagName("STATUS.MSG")[0].firstChild.data;if(statusCODE=="KO"){alert("Unknown file format.")
}else{if(statusCODE=="INVALID"){alert("Session not valid, try to refresh your navigator.")}}OBJMAP.finishPinpoint(e,newPOI.getDecalXwhenUnactivate(),newPOI.getDecalYwhenUnactivate());newPOI.unactivate(e,true);
OBJMAP.updateContent(true)}};var url=_CONFIG.urlMAINmgt;var src_url="http://"+location.host.toLowerCase();var isURLvalid=true;if(url.substring(0,4).toLowerCase()=="http"){var n=src_url.length;if(src_url==url.toLowerCase().substring(0,n)){isURLvalid=true
}else{isURLvalid=false}}else{isURLvalid=true}YAHOO.util.Connect.asyncRequest("POST",url,uploadHandler)};var onCancelButtonClick=function(e){OBJMAP.finishPinpoint(e,newPOI.getDecalXwhenUnactivate(),newPOI.getDecalYwhenUnactivate());
newPOI.closeWindow(e,false)};YAHOO.util.Event.on("uploadButton","click",onUploadButtonClick);YAHOO.util.Event.on("cancelButton","click",onCancelButtonClick)};this.CityneoMAP_traiteXML_Dalle0light_2=function(xmlDoc){if(toDEBUG){_DEBUG.debug("CityneoMAP_traiteXML_Dalle0light_2")
}var statusParent=xmlDoc.getElementsByTagName("STATUS")[0];var ref=xmlReadField(statusParent,"REF");var content=xmlDoc.getElementsByTagName("CONTENT")[0];var newcx=parseFloat(xmlReadField(content,"D0.XX"));
var newcy=parseFloat(xmlReadField(content,"D0.YY"));decallageXpixel+=decallageXToAddpixel;decallageYpixel+=decallageYToAddpixel;decallageXToAddpixel=0;decallageYToAddpixel=0;var actualX_=x0-decallageXpixel*dalleZoom;
var actualY_=y0+(dalleHeight*dalleZoom)+decallageYpixel*dalleZoom;recalculCoordonnee(actualX_,actualY_,".CityneoMAP_traiteXML_Coordonnee");contentMGT.geocod(mapEvent_geocod_id,mapEvent_geocod_callback,newcx,newcy)
};function chargeDalleXY_run(param){var dalleX=x0+param.dalleX*dalleWidth*dalleZoom;var dalleY=y0-param.dalleY*dalleHeight*dalleZoom;var AJAX=new AJAX_XMLCGS(_CONFIG.urlMAINmapDisplay,"sessionid="+sessionId+"&action=dalle&e="+dalleZoom+"&h="+dalleHeight+"&w="+dalleWidth+"&dx="+dalleX+"&dy="+dalleY+"&f="+format+"&lg="+lg+"&ref="+param.ctid,oName+".CityneoMAP_traiteXML_DalleXXX",5,oName+".serviceNonAvailable",null);
AJAX.execute()}this.CityneoMAP_traiteXML_DalleXXX=function(xmlDoc){var statusParent=xmlDoc.getElementsByTagName("STATUS")[0];var ref=xmlReadField(statusParent,"REF");var content=xmlDoc.getElementsByTagName("CONTENT")[0];
var ctid=xmlReadField(content,"D.CONTENT.ID");var oDalle=document.getElementById(ref);if(oDalle==null){return }var cInteract=content.getElementsByTagName("D.INTERACT")[0];var cOBJ=cInteract.getElementsByTagName("OBJ");
var newimage_=_CONFIG.urlMAINcontent+"?sessionid="+sessionId+"&class=map&contentid="+ctid;var newIMAGE=new Image(dalleWidth,dalleHeight);newIMAGE.ref=ref;newIMAGE.onload=function(){var oImg=document.getElementById(newIMAGE.ref+"_img");
if(oImg==null){return }oImg.src=this.src;oImg.style.left="0px";oImg.style.top="0px";oImg.style.width=dalleWidth+"px";oImg.style.height=dalleHeight+"px"};newIMAGE.src=newimage_;var i_dx=oDalle.offsetLeft;
var i_dy=oDalle.offsetTop;internalRestitueContent("i",ref,cOBJ,i_dx,i_dy)};function recalculCoordonnee(x,y,callBackFunction){if(toDEBUG){_DEBUG.debug("recalculCoordonnee xy : "+x+"x"+y)}var AJAX=new AJAX_XMLCGS(_CONFIG.urlMAINmapDisplay,"sessionid="+sessionId+"&action=convert&cx="+x+"&cy="+y+"&ps=2&pt=1",oName+callBackFunction,5,oName+".serviceNonAvailable",null);
AJAX.execute()}this.CityneoMAP_traiteXML_Coordonnee=function(xmlDoc){var content=xmlDoc.getElementsByTagName("CONTENT")[0];cx=parseFloat(xmlReadField(content,"C.X"));cy=parseFloat(xmlReadField(content,"C.Y"));
if(callbackCoordFunction!=null){setTimeout(callbackCoordFunction+"("+cx+","+cy+")",0)}};function chargeZoomRange(){var AJAX=new AJAX_XMLCGS(_CONFIG.urlMAINmapDisplay,"sessionid="+sessionId+"&action=zoomrange",oName+".CityneoMAP_traiteXML_ZoomRange",5,oName+".serviceNonAvailable",null);
AJAX.execute()}this.CityneoMAP_traiteXML_ZoomRange=function(xmlDoc){var content=xmlDoc.getElementsByTagName("CONTENT")[0];var cInteract=content.getElementsByTagName("ZR.VALUE")[0];var cOBJ=cInteract.getElementsByTagName("OBJ");
var i_position;var i_zoom;zoomRange=new Array(cOBJ.length);for(var ii=0;ii<cOBJ.length;ii++){i_position=parseInt(xmlReadField(cOBJ[ii],"POSITION"));i_zoom=parseFloat(xmlReadField(cOBJ[ii],"E"));zoomRange[i_position]=i_zoom
}};this.getZoomRange=function(){return zoomRange};function updateDallageFenetre(includeContent){var decalXpixel=decallageXpixel+decallageXToAddpixel;var decalYpixel=decallageYpixel+decallageYToAddpixel;
var newMinMax=new calculateMinMax(decalXpixel,decalYpixel,imageWidth,imageHeight,dalleWidth,dalleHeight);if(!(newMinMax.isEgal(currentMinMax))){var xMire=imageWidth/2;var yMire=imageHeight/2;var targetID=null;
var oDalle=null;var oImage=null;for(x=newMinMax.nbXMIN;x<=newMinMax.nbXMAX;x++){for(y=newMinMax.nbYMIN;y<=newMinMax.nbYMAX;y++){targetID=dalleprefix+"_"+x+"x"+y;updateDALLE=false;oDalle=document.getElementById(targetID);
if(oDalle==null){var newDalle=document.createElement("div");newDalle.style.position="absolute";newDalle.id=targetID;newDalle.type="DALLE";newDalle.dalleID="NA";newDalle.dallePrefix="NA";var xx=parseInt(xMire+dalleWidth*x);
var yy=parseInt(yMire+dalleHeight*y);newDalle.style.width=dalleWidth+"px";newDalle.style.height=dalleHeight+"px";newDalle.style.left=xx+"px";newDalle.style.top=yy+"px";if(debugDallage){setBorder(newDalle,DEFAULT_WINDOW_BORDER);
newDalle.innerHTML="<p>"+x+"x"+y+"</p>"}oImage=document.getElementById(targetID+"_img");if(oImage!=null){try{oImage.parentNode.removeChild(oImage)}catch(e){}}oImage=document.createElement("img");oImage.style.position="absolute";
oImage.id=targetID+"_img";oImage.galleryimg="no";oImage.src=loadingLogo;oImage.style.width="32px";oImage.style.height="32px";oImage.style.left=parseInt((dalleWidth-oImage.width)/2)+"px";oImage.style.top=parseInt((dalleHeight-oImage.height)/2)+"px";
newDalle.appendChild(oImage);newDalle.jeton=jeton;var param=new extractDalle(x,y,newDalle.id);param.jeton=jeton++;chargeDallePile.push(param);oLayerMainCurrent.appendChild(newDalle)}else{if(oDalle.jeton<dalle0JetonCurrent){try{oDalle.parentNode.removeChild(oDalle)
}catch(e){}}}}}currentMinMax=newMinMax}if(includeContent){contentMGT_GO()}}this.restitueContent=function(prefix,dalleID,cOBJ,i_dx,i_dy){internalRestitueContent(prefix,dalleID,cOBJ,i_dx,i_dy)};this.updateContent=function(force){if(toDEBUG){_DEBUG.debug("CityneoMAP.updateContent")
}if(!isDalle0loaded&&!force){return }contentMGT_GO()};function contentMGT_GO(){if(contentMGT.isStarted){if(lscale==0){contentMGT.disabledSimplification()}var xMire=imageWidth/2;var yMire=imageHeight/2;
var decalXpixel=decallageXpixel+decallageXToAddpixel;var decalYpixel=decallageYpixel+decallageYToAddpixel;var actualX_=x0-decalXpixel*dalleZoom;var actualY_=y0+(dalleHeight*dalleZoom)+decalYpixel*dalleZoom;
var realBoundx1=actualX_-xMire*dalleZoom;var realBoundx2=actualX_+xMire*dalleZoom;var realBoundy1=actualY_-yMire*dalleZoom;var realBoundy2=actualY_+yMire*dalleZoom;contentMGT.extractContent(oLayerMainCurrent.id,0,0,x0-xMire*dalleZoom,y0+(dalleHeight+yMire)*dalleZoom,dalleZoom,lg,realBoundx1,realBoundy1,realBoundx2,realBoundy2)
}}function cleanContentLMAIN(oLayerMain,type,prefix,dalleID){var lstTOSUPPR=new Array();for(i=0;i<oLayerMain.childNodes.length;i++){toSUPPR=true;if(toSUPPR&&type!=null){if(type==oLayerMain.childNodes[i].type){toSUPPR=false
}}if(toSUPPR&&prefix!=null){if(prefix!=oLayerMain.childNodes[i].dallePrefix){toSUPPR=false}}if(toSUPPR&&dalleID!=null){if(dalleID!=oLayerMain.childNodes[i].dalleID){toSUPPR=false}}if(toSUPPR){lstTOSUPPR.push(oLayerMain.childNodes[i].id)
}}var node=null;for(i=0;i<lstTOSUPPR.length;i++){try{node=document.getElementById(lstTOSUPPR[i]);node.parentNode.removeChild(node)}catch(e){}}}function internalRestitueContent(prefix,dalleID,cOBJ,i_dx,i_dy){cleanContentLMAIN(oLayerMainCurrent,null,prefix,dalleID);
var oDalle=document.getElementById(dalleID);var ii;var i_x;var i_y;var i_w;var i_h;var i_ref;var i_picto;var newBound;var oMe1;var i_interact;for(ii=0;ii<cOBJ.length;ii++){i_x=parseInt(xmlReadField(cOBJ[ii],"CX"));
i_y=parseInt(xmlReadField(cOBJ[ii],"CY"));i_w=parseInt(xmlReadField(cOBJ[ii],"W"));i_h=parseInt(xmlReadField(cOBJ[ii],"H"));i_ref=xmlReadField(cOBJ[ii],"REF");i_picto=xmlReadField(cOBJ[ii],"PICTO");i_contenu1=xmlReadField(cOBJ[ii],"CONTENT1");
i_contenu2=xmlReadField(cOBJ[ii],"CONTENT2");i_contenu3=xmlReadField(cOBJ[ii],"CONTENT3");i_interact=xmlReadField(cOBJ[ii],"INTERACT");if(i_w<=0||i_h<=0){i_w=20;i_h=20}var newPOI=new genericPOI();newPOI.init(sessionId,i_x+i_dx,i_y+i_dy,i_w,i_h,imageWidth,imageHeight,lg,i_ref,i_contenu3,oLayerMainCurrent,popupname,poiPopupType,poiPopupLookandFeel,true,OBJMAP,pathMain);
var newI=document.createElement("div");newI.id=dalleID+"_"+prefix+"_"+ii;newI.type="POI";newI.dalleID=dalleID;newI.dallePrefix=prefix;newI.i_ref=i_ref;newI.i_interact=i_interact;newI.style.position="absolute";
newI.style.left=(i_x-i_w/2)+"px";newI.style.top=(i_y-i_h/2)+"px";newI.style.width=i_w+"px";newI.style.height=i_h+"px";newI.style.zIndex=100;newI.isParent=true;if(i_picto!=null){newI.innerHTML=i_picto}switch(currentMapEventMode){case mapEventMode.edition:break;
case mapEventMode.pinpoint:break;case mapEventMode.drag:if(poiPopupType==popupType.bestDisplayOnMouseOver){newI.onmouseover=newPOI.activate;newI.onmouseout=newPOI.unactivate}else{if(poiPopupType==popupType.centeredDisplayOnMouseClick){newI.onmousedown=newPOI.activate
}}break}oDalle.appendChild(newI)}}this.setMouseButtonIndicator=function(tp,value){if(tp=="left"){leftMouseButtonPress=value}else{if(tp=="right"){rightMouseButtonPress=value}}};function mouseDownXXX(e){if(!threadStarted){return 
}setPreventDefault(e);switch(currentMapEventMode){case mapEventMode.drag:mouseDownMODE_DRAG(e);break;case mapEventMode.edition:mouseDownMODE_EDITION(e);break;case mapEventMode.pinpoint:mouseDownMODE_PINPOINT(e);
break;case mapEventMode.geocod:mouseDownMODE_PINPOINT(e);break;case mapEventMode.freeze:null;break}}function mouseMoveXXX(e){if(!threadStarted){return false}switch(currentMapEventMode){case mapEventMode.drag:mouseMoveMODE_DRAG(e);
break;case mapEventMode.edition:mouseMoveMODE_EDITION(e);break;case mapEventMode.pinpoint:mouseMoveMODE_PINPOINT(e);break;case mapEventMode.geocod:mouseMoveMODE_PINPOINT(e);break;case mapEventMode.freeze:null;
break}return false}function mouseUpXXX(e){if(!threadStarted){return }switch(currentMapEventMode){case mapEventMode.drag:mouseUpMODE_DRAG(e);break;case mapEventMode.edition:mouseUpMODE_EDITION(e);break;
case mapEventMode.pinpoint:mouseUpMODE_PINPOINT(e,"CityneoMAP_traiteXML_Dalle0light_1",false);break;case mapEventMode.geocod:mouseUpMODE_PINPOINT(e,"CityneoMAP_traiteXML_Dalle0light_2",true);break;case mapEventMode.freeze:null;
break}}this.finishPinpoint=function(e,decalXwhenUnactivate,decalYwhenUnactivate){this.playEventListener();modePinpointIsPinpointing=false;var oCursorInteractif=document.getElementById(cursorInteractif);
if(oCursorInteractif!=null){var realXpourMAP=getClientX(e)-getLeft(oLayerMainCurrent)+currentMapEventParam.imagePosition.x;var realYpourMAP=getClientY(e)-getTop(oLayerMainCurrent)+currentMapEventParam.imagePosition.y;
oCursorInteractif.style.left=(realXpourMAP+decalXwhenUnactivate)+"px";oCursorInteractif.style.top=(realYpourMAP+decalYwhenUnactivate)+"px"}};var modePinpointIsMoving=false;var modePinpointIsPinpointing=false;
var modePinpointTargetdecallageXToAdd=0;var modePinpointTargetdecallageYToAdd=0;function mouseDownMODE_PINPOINT(e){var mouseButtonPress=getMouseButton(e);if(mouseButtonPress==mouseButton.left){leftMouseButtonPress=true;
mouseDownMODE_DRAG(e)}}function mouseMoveMODE_PINPOINT(e){if(leftMouseButtonPress){modePinpointIsMoving=true;oMap.style.cursor="move";mouseMoveMODE_DRAG(e)}else{if(!modePinpointIsPinpointing){var oCursorInteractif=document.getElementById(cursorInteractif);
if(oCursorInteractif!=null){var realXpourMAP=getClientX(e)-getLeft(oLayerMainCurrent)+currentMapEventParam.imagePosition.x;var realYpourMAP=getClientY(e)-getTop(oLayerMainCurrent)+currentMapEventParam.imagePosition.y;
oCursorInteractif.style.left=realXpourMAP+"px";oCursorInteractif.style.top=realYpourMAP+"px"}}}}function mouseUpMODE_PINPOINT(e,fct,clean){oMap.style.cursor=currentMapEventParam.cursor;if(leftMouseButtonPress){if(!modePinpointIsPinpointing&&!modePinpointIsMoving){modePinpointIsPinpointing=true;
if(clean){try{var oCursorInteractif=document.getElementById(cursorInteractif);oCursorInteractif.parentNode.removeChild(oCursorInteractif)}catch(e){}}var target=getTarget(e);var realXpourMAP=getClientX(e)-getLeft(oLayerMainCurrent);
var realYpourMAP=getClientY(e)-getTop(oLayerMainCurrent);var realXScreen=getLeft(target)-getLeft(oMap)+getImageX(e);var realYScreen=getTop(target)-getTop(oMap)+getImageY(e);modePinpointTargetdecallageXToAdd=parseInt(imageWidth/2-realXScreen)+decallageXToAddpixel;
modePinpointTargetdecallageYToAdd=parseInt(imageHeight/2-realYScreen)+decallageYToAddpixel;var AJAX=new AJAX_XMLCGS(_CONFIG.urlMAINmapDisplay,"sessionid="+sessionId+"&action=dalle0&zrp="+lscale+"&dex="+(-modePinpointTargetdecallageXToAdd*dalleZoom)+"&dey="+(modePinpointTargetdecallageYToAdd*dalleZoom)+"&cx="+cx+"&cy="+cy+"&w="+imageWidth+"&h="+imageHeight,oName+"."+fct,5,oName+".serviceNonAvailable",null);
_internal_shared_v1_forsticker=e;_internal_shared_v2_forsticker=new Pixel(realXpourMAP,realYpourMAP);AJAX.execute()}else{}}else{if(!modePinpointIsPinpointing){mouseUpMODE_DRAG(e)}}modePinpointIsMoving=false;
leftMouseButtonPress=false}var modeEditionTarget=null;var modeEditionObjetToMove=null;var modeEditionFirstX=null;var modeEditionFirstY=null;var modeEditionStartX=null;var modeEditionStartY=null;var modeEditionEndX=null;
var modeEditionEndY=null;var modeEditionIsMoving=false;var modeEditionIsEditing=false;function mouseDownMODE_EDITION(e){var target=getTarget(e);while(isEmpty(target.id)&&target.isParent!=true){target=target.parentNode
}var mouseButtonPress=getMouseButton(e);if(mouseButtonPress==mouseButton.left){leftMouseButtonPress=true;modeEditionStartX=getClientX(e);modeEditionStartY=getClientY(e);if(target.i_interact!=null){if(modeEditionTarget==target||!modeEditionIsEditing){modeEditionTarget=target;
modeEditionFirstX=parseInt(modeEditionTarget.style.left);modeEditionFirstY=parseInt(modeEditionTarget.style.top);modeEditionObjetToMove=mapEventMode.edition}else{modeEditionObjetToMove=mapEventMode.drag;
mouseDownMODE_DRAG(e)}}else{modeEditionObjetToMove=mapEventMode.drag;mouseDownMODE_DRAG(e)}}}function mouseMoveMODE_EDITION(e){if(leftMouseButtonPress){switch(modeEditionObjetToMove){case mapEventMode.drag:mouseMoveMODE_DRAG(e);
break;case mapEventMode.edition:modeEditionEndX=getClientX(e);modeEditionEndY=getClientY(e);modeEditionTarget.style.left=parseInt(modeEditionTarget.style.left)+(modeEditionEndX-modeEditionStartX)+"px";
modeEditionTarget.style.top=parseInt(modeEditionTarget.style.top)+(modeEditionEndY-modeEditionStartY)+"px";modeEditionStartX=modeEditionEndX;modeEditionStartY=modeEditionEndY;modeEditionIsMoving=true;break
}}}function mouseUpMODE_EDITION(e){if(leftMouseButtonPress){switch(modeEditionObjetToMove){case mapEventMode.drag:oMap.style.cursor=currentMapEventParam.cursorHand;break;case mapEventMode.edition:if(modeEditionIsMoving){if(!modeEditionIsEditing&&!isNull(modeEditionTarget)){modeEditionIsEditing=false;
var movingX=parseInt(modeEditionTarget.style.left)-modeEditionFirstX;var movingY=parseInt(modeEditionTarget.style.top)-modeEditionFirstY;movingX=movingX*dalleZoom;movingY=-movingY*dalleZoom;contentMGT.updateXY_POIfromSandBox(modeEditionTarget.i_ref,movingX,movingY)
}}else{var realXpourMAP=getClientX(e)-getLeft(oLayerMainCurrent);var realYpourMAP=getClientY(e)-getTop(oLayerMainCurrent);editForm(e,new Pixel(realXpourMAP,realYpourMAP),modeEditionTarget.i_ref)}break}}leftMouseButtonPress=false;
modeEditionIsMoving=false}function mouseDownMODE_DRAG(e){var tmpTarget=getTarget(e);oMap.style.cursor=currentMapEventParam.cursorMove;startX=getClientX(e);startY=getClientY(e);var mouseButtonPress=getMouseButton(e);
if(mouseButtonPress==mouseButton.left){leftMouseButtonPress=true;layerMainPosition.x=parseInt(oLayerMainCurrent.style.left);layerMainPosition.y=parseInt(oLayerMainCurrent.style.top)}}function mouseMoveMODE_DRAG(e){if(leftMouseButtonPress){var target=getTarget(e);
var endX=getClientX(e);var endY=getClientY(e);purgepopup(popupname);decallageXToAddpixel=endX-startX;decallageYToAddpixel=endY-startY;decallageXToAddpixel=decallageXToAddpixel+layerMainPosition.x-decallageXpixel;
decallageYToAddpixel=decallageYToAddpixel+layerMainPosition.y-decallageYpixel;oLayerMainCurrent.style.left=(decallageXpixel+decallageXToAddpixel)+"px";oLayerMainCurrent.style.top=(decallageYpixel+decallageYToAddpixel)+"px";
updateLMainLightJeton=(jeton++)}}function mouseUpMODE_DRAG(e){oMap.style.cursor=currentMapEventParam.cursorHand;var endX=getClientX(e);var endY=getClientY(e);var isLeftDblClk=false;if((leftMouseButtonPress)&&(startX!=endX)&&(startY!=endY)){decallageXpixel=decallageXpixel+decallageXToAddpixel;
decallageYpixel=decallageYpixel+decallageYToAddpixel;decallageXToAddpixel=0;decallageYToAddpixel=0}var now=new Date().getTime();var mouseButtonPress=getMouseButton(e);if(mouseButtonPress==mouseButton.left){if(now-leftMouseButtonTime<DEFAULT_DOUBLE_CLICK_TIME&&Math.abs(endX-startX)<DEFAULT_SMOOTH_MOUSE&&Math.abs(endY-startY)<DEFAULT_SMOOTH_MOUSE){var target=getTarget(e);
var realXpourMAP=getLeft(target)-getLeft(oMap)+getImageX(e);var realYpourMAP=getTop(target)-getTop(oMap)+getImageY(e);targetdecallageXToAdd=imageWidth/2-realXpourMAP;targetdecallageYToAdd=imageHeight/2-realYpourMAP;
lscale=_NAV.calculateNewZOOM(lscale,-1);_NAV.setLScale(lscale);refreshDalle0(-targetdecallageXToAdd*dalleZoom,targetdecallageYToAdd*dalleZoom);isLeftDblClk=true}else{leftMouseButtonTime=now}}else{if(mouseButtonPress==mouseButton.right){if(now-rightMouseButtonTime<DEFAULT_DOUBLE_CLICK_TIME&&Math.abs(endX-startX)<DEFAULT_SMOOTH_MOUSE&&Math.abs(endY-startY)<DEFAULT_SMOOTH_MOUSE){NAV.menuZoomXXX(1)
}else{rightMouseButtonTime=now}}}if(leftMouseButtonPress){if(!isLeftDblClk&&(startX!=endX)&&(startY!=endY)){updateLMainJeton=(jeton++);var actualX_=x0-decallageXpixel*dalleZoom;var actualY_=y0+(dalleHeight*dalleZoom)+decallageYpixel*dalleZoom;
recalculCoordonnee(actualX_,actualY_,".CityneoMAP_traiteXML_Coordonnee")}leftMouseButtonPress=false}}this.refreshMainLight=function(){updateLMainLightJeton=(jeton++)};this.refreshMain=function(){refreshDalle0(0,0)
};this.deplaceCarte=function(XX,YY,recalcul){if(recalcul){purgepopup(popupname)}targetrecalcul=recalcul;targetdecallageXToAdd=XX;targetdecallageYToAdd=YY;decallageYXPos=10;currentdecallageXToAdd=0;currentdecallageYToAdd=0;
decallageXToAddpas=targetdecallageXToAdd/decallageYXPos;decallageYToAddpas=targetdecallageYToAdd/decallageYXPos;setTimeout(deplaceProgressif,10)};function deplaceProgressif(){currentdecallageXToAdd=currentdecallageXToAdd+decallageXToAddpas;
currentdecallageYToAdd=currentdecallageYToAdd+decallageYToAddpas;if(decallageYXPos<=0){decallageXToAddpixel=targetdecallageXToAdd;decallageYToAddpixel=targetdecallageYToAdd;oLayerMainCurrent.style.left=(decallageXpixel+decallageXToAddpixel)+"px";
oLayerMainCurrent.style.top=(decallageYpixel+decallageYToAddpixel)+"px";decallageXpixel=decallageXpixel+decallageXToAddpixel;decallageYpixel=decallageYpixel+decallageYToAddpixel;decallageXToAddpixel=0;
decallageYToAddpixel=0;if(targetrecalcul){updateLMainJeton=(jeton++);var actualX_=x0-decallageXpixel*dalleZoom;var actualY_=y0+(dalleHeight*dalleZoom)+decallageYpixel*dalleZoom;recalculCoordonnee(actualX_,actualY_,".CityneoMAP_traiteXML_Coordonnee")
}else{updateLMainLightJeton=(jeton++)}}else{oLayerMainCurrent.style.left=(decallageXpixel+currentdecallageXToAdd)+"px";oLayerMainCurrent.style.top=(decallageYpixel+currentdecallageYToAdd)+"px";decallageYXPos=decallageYXPos-1;
setTimeout(deplaceProgressif,10)}}}function calculateMinMax(E,D,B,A,C,F){this.nbXMIN=Math.floor((-B-2*E)/(2*C));this.nbXMAX=Math.floor((B-2*E)/(2*C));this.nbYMIN=Math.floor((-A-2*D)/(2*F));this.nbYMAX=Math.floor((A-2*D)/(2*F));
this.isEgal=function(G){if(G==null){return false}if((G.nbXMIN==this.nbXMIN)&&(G.nbXMAX==this.nbXMAX)&&(G.nbYMIN==this.nbYMIN)&&(G.nbYMAX==this.nbYMAX)){return true}else{return false}}}function extractDalle(B,A,C){this.dalleX=B;
this.dalleY=A;this.ctid=C}function background(B,D,A,C){this.color=B;this.image=D;this.position=A;this.repeat=C}function CityneoNAV(){var H=true;var R;var O;var E;var D;var B;var J;var M;var A;var C="menu_XTZ";
var N;var K;var I;var L;var Q;var S=null;var F=null;var G=-1;var P=12;this.init=function(a,U,Y,V,W,X,Z,T){R=a;O=U;E=Y;D=V;B=W;J=X;M=Z;A=T};this.isStarted=false;this.start=function(){this.isStarted=true;
N=A.getOMap();if(B!=null){I=document.getElementById(B)}if(J!=null){L=document.getElementById(J)}if(D!=null){K=document.getElementById(D)}if(M!=null){Q=document.getElementById(M)}createBoutonsDefilement(N,K,A,E);
S=createZOOM(N,I,A,this,E);F=createECHELLE(N,L,A,E);createCGU(N,Q,A,E);if(G!=-1){if(S!=null){S.setNewScale(G)}if(F!=null){F.setNewScale(G)}}};this.calculateNewZOOM=function(T,U){T=T+U;if(T<0){T=0}else{if(T>(P-1)){T=P-1
}}return T};this.setLScale=function(T){G=T;if(S!=null){S.setNewScale(G)}if(F!=null){F.setNewScale(G)}};this.menuZoomXXX=function(U){this.hideMenu();A.setMouseButtonIndicator("right",false);var T=this.calculateNewZOOM(A.getLScale(),U);
if(H){_DEBUG.debug("CityneoNAV.fZoomXXX "+T)}A.setLScale(T)};this.showMenu=function(U,T){if(!A.isStarted){return }var V=document.createElement("div");V.id=C;V.style.position="absolute";V.style.width="75px";
V.style.height="100px";V.style.left=(U)+"px";V.style.top=(T)+"px";setBorder(V,DEFAULT_WINDOW_BORDER);V.style.whiteSpace="nowrap";V.style.fontSize="12px";V.style.backgroundColor="#d9bb7a";V.style.textAlign="left";
V.style.listStyleType="none";V.innerHTML='<li><a href="javascript:'+O+'.menuZoomXXX(-1);">Zoom+</a></li><li><a href="javascript:'+O+'.menuZoomXXX(1);">Zoom-</a></li><li><a href="#">Add ...</a></li>';fadeIn(V,90);
N.appendChild(V)};this.hideMenu=function(){try{var T=document.getElementById(C);N.removeChild(T)}catch(U){}}}function DEFcreateCGU(D,I,L,H,J,N,B,K,M,C,A,G){var E=document.createElement("div");E.id="lCGU";
E.style.position="absolute";E.innerHTML=N;E.style.color=B;E.style.whiteSpace=K;E.style.fontSize=M+"px";E.style.zIndex="500";E.style.visibility="hidden";D.appendChild(E);var F=document.getElementById("lCGU");
if(C==1){F.style.left=(I+L)+"px"}else{F.style.left=(I-L-F.offsetWidth)+"px"}if(A==1){F.style.top=(H+J)+"px"}else{F.style.top=(H-J-F.offsetHeight)+"px"}F.style.visibility="visible"}function DEFcreateBoutonsDefilementSurMAP(F,J){var E=F.getOMap();
var D=12;var M=12;var L=2*F.getImageWidth()/3;var I=2*F.getImageHeight()/3;var C=0;var B=F.getImageWidth()-D;var A=(F.getImageWidth()-D)/2;var K=0;var H=F.getImageHeight()-M;var G=(F.getImageHeight()-M)/2;
createBT(F,E,C,G,L,0,J+"pictoMain/navWest.gif",J+"pictoMain/navWestOver.gif");createBT(F,E,B,G,-L,0,J+"pictoMain/navEst.gif",J+"pictoMain/navEstOver.gif");createBT(F,E,A,K,0,I,J+"pictoMain/navNorth.gif",J+"pictoMain/navNorthOver.gif");
createBT(F,E,A,H,0,-I,J+"pictoMain/navSouth.gif",J+"pictoMain/navSouthOver.gif")}function createBT(C,B,H,D,F,E,J,G){var I=document.createElement("div");I.id="nav_bt_"+H+"_"+D;I.style.position="absolute";
I.style.left=H+"px";I.style.top=D+"px";I.style.zIndex="200";var A=document.createElement("img");A.id=I.id+"_img";A.galleryimg="no";A.decalX=F;A.decalY=E;A.urlIMG1=J;A.urlIMG2=G;A.src=A.urlIMG1;I.appendChild(A);
I.onmousedown=function(L){universalCancelBubble(L);var K=document.getElementById(getTarget(L).id);C.deplaceCarte(K.decalX,K.decalY,true)};I.onmouseover=function(L){universalCancelBubble(L);var K=document.getElementById(getTarget(L).id);
K.src=K.urlIMG2};I.onmouseout=function(L){universalCancelBubble(L);var K=document.getElementById(getTarget(L).id);K.src=K.urlIMG1};I.onmouseup=null;B.appendChild(I)}function DEFcreateZOOM(E,K,I,O,N,L,Q,D,G,H,A,B,F,J,M){var P=document.createElement("div");
P.id="zoom";P.style.position="relative";P.style.left=O+"px";P.style.top=N+"px";P.style.width=(Q*L)+"px";P.style.height=(D*L)+"px";P.style.zIndex="200";E.appendChild(P);var C=document.createElement("img");
C.id="zoom_IMG";C.style.position="absolute";C.style.left="0px";C.style.top="0px";C.style.width=(Q*L)+"px";C.style.height=(D*L)+"px";C.style.zIndex="201";C.src=F;P.appendChild(C);P.onmousedown=function(Z){universalCancelBubble(Z);
var a=document.getElementById(getTarget(Z).parentNode.id+"_img");var W=getCustomClientRelatifX(Z,this);var V=getCustomClientRelatifY(Z,this);var Y=true;var U;var T;var S;var R;for(var X=0;X<G.length&&Y;
X=X+4){U=G[X];T=G[X+1];S=G[X+2];R=G[X+3];if(U<=W&&W<=T&&S<=V&&V<=R){Y=false;K.setLScale(X/4)}}if(Y){U=A[0];T=A[1];S=A[2];R=A[3];if(U<=W&&W<=T&&S<=V&&V<=R){Y=false;I.menuZoomXXX(-1)}}if(Y){U=B[0];T=B[1];
S=B[2];R=B[3];if(U<=W&&W<=T&&S<=V&&V<=R){Y=false;I.menuZoomXXX(1)}}};P.onmouseover=function(S){universalCancelBubble(S);var R=document.getElementById("zoom_IMG");R.src=J};P.onmouseout=function(S){universalCancelBubble(S);
var R=document.getElementById("zoom_IMG");R.src=F};img2=document.createElement("img");img2.id="zoom_BARRE";img2.galleryimg="no";img2.style.position="absolute";img2.style.left="0px";img2.style.top="0px";
img2.style.width=(L*Q)+"px";img2.style.height=(L*D)+"px";img2.IMG=H;img2.src=M+"pictoMain/zoomEmpty.gif";img2.style.zIndex="202";P.appendChild(img2);img2.setNewScale=function(R){this.src=this.IMG[R]};return img2
}function DEFcreateECHELLE(C,G,E,D,J,B,H,F){var I=document.createElement("div");I.id="echelle";I.style.position="relative";I.style.left=G+"px";I.style.top=E+"px";I.style.width=(J*D)+"px";I.style.height=(B*D)+"px";
I.style.zIndex="200";C.appendChild(I);var A=document.createElement("img");A.id="echelle_IMG";A.style.position="absolute";A.style.left="0px";A.style.top="0px";A.style.width=(J*D)+"px";A.style.height=(B*D)+"px";
A.style.zIndex="201";A.IMG=H;A.src=F+"pictoMain/zoomEmpty.gif";I.appendChild(A);A.setNewScale=function(K){this.src=this.IMG[K]};return A}function PanelManager(){var B=new Array();var I=null;var D=null;
var H=false;var E=null;function C(K,L,J){this.index=K;this.id=L;this.isDown=J}this.setLength=function(J){B=new Array(J);H=true};this.setImagePath=function(J){E=J};function F(J){I=document.getElementById(B[J].id+"Image");
D=document.getElementById(B[J].id)}function G(){D.style.display="";if(isExist(I)){I.src=E+"down.gif"}}function A(){D.style.display="none";if(isExist(I)){I.src=E+"up.gif"}}this.displayPanel=function(J){F(J);
if(B[J].isDown){A()}else{G()}B[J].isDown=!B[J].isDown};this.addNew=function(K,L,J){if(!H){B.push(new C(K,L,J))}else{B[K]=new C(K,L,J)}F(K);J?G():A()}}function CityneoPARSE(){var J=true;var Y;var T;var O;
var M;var X;var C;var S;var e;var Q;var U;var B;var K;var a;var G;this.serviceNonAvailable=function(h,f,k,g,l){alert("CityneoPARSE.serviceNonAvailable :"+h+","+f+":"+g+" "+l)};this.init=function(h,g,k,f,o,l,n,m,p){Y=h;
T=g;O=k;M=f;X=o;C=l;S=n;e=m;Q=p};var P=false;this.start=function(){this.isStarted=true;U=document.getElementById(M);B=document.getElementById(X);K=document.getElementById(C);a=document.getElementById(S);
G=document.getElementById(e);U.onkeypress=this.keyPress;B.onkeypress=this.keyPress;K.onkeypress=this.keyPress;a.onkeypress=this.keyPress;G.onkeypress=this.keyPress};var b=null;var A=null;this.keyPress=function(l){var k=getTarget(l);
var h=getCustomKeyCode(l);if(c){f(k,h);setPreventDefault(l)}else{g(k,h)}function f(n,m){setTimeout(T+".clearPOPUP()",0)}function g(n,m){if(m==13){setTimeout(T+".geocodeCurrent(false)",0)}}};var R="";var H="";
var W="";var F="";var V="";function d(h,g,f){if((h!=R)||(g!=H)||(f!=W)){return true}else{return false}}function E(f,g){if((f!=F)||(g!=V)){return true}else{return false}}this.geocodeCurrent=function(f){if(f){R="";
H="";W="";F="";V=""}var n=G.value;var k=false;if(n!=null&&n!=""){k=true}else{n=""}var q=a.value;var r=false;if(q!=null&&q!=""){r=true}else{q=""}var h=K.value;var g=false;if(h!=null&&h!=""){g=true}else{h=""
}var p=B.value;var o=false;if(p!=null&&p!=""){o=true}else{p=""}var m=U.value;var l=false;if(m!=null&&m!=""){l=true}else{m=""}if(!k){this.showPOPUP(G,200,100,"#ffa0a0","Invalid input","Try to select a countrycode.");
return }if(!g&&!r){this.showPOPUP(a,200,100,"#ffa0a0","Invalid input","Try to input a city or zipcode.");return }if(!o&&l){this.showPOPUP(B,200,100,"#ffa0a0","Invalid input","Try to input a street.");return 
}if(d(n,h,q)){currentGeocode=null;currentCommuneID=null;b=null;A=null;R=n;H=h;W=q;F=p;V=m}else{if(E(p,m)){currentGeocode=null;A=null;F=p;V=m}}if(b!=null){if(J){_DEBUG.debug("CityneoPARSE Commune deja geocodee")
}if(o){if(A!=null){if(J){_DEBUG.debug("CityneoPARSE Rue deja geocodee")}a.value=A.settlementNAME;K.value=A.zip;B.value=A.rueNAME;if(A.house!=null&&A.house!=""){U.value=A.house}else{U.value=""}W=a.value;
H=K.value;F=B.value;V=U.value;if(Q!=null){setTimeout(Q+"("+A.getParamForCallback()+")",0)}return }else{if(J){_DEBUG.debug("CityneoPARSE Rue a geocoder")}L(n,b.communeID,p,m)}}else{if(J){_DEBUG.debug("CityneoPARSE Pas de Rue a geocoder")
}U.value="";B.value="";a.value=b.settlementNAME;K.value=b.zip;W=a.value;H=K.value;F=B.value;V=U.value;if(Q!=null){setTimeout(Q+"("+b.getParamForCallback()+")",0)}return }}else{if(J){_DEBUG.debug("CityneoPARSE Commune a geocoder")
}Z(n,q,h)}};var c=false;var N="demo";this.clearPOPUP=function(){var f=document.getElementById(N);if(f!=null){f.style.display="none"}try{U.onfocus=null}catch(g){}try{B.onfocus=null}catch(g){}try{K.onfocus=null
}catch(g){}try{a.onfocus=null}catch(g){}c=false};this.showPOPUP=function(q,r,n,f,m,o){var g=document.getElementById("demo");g.style.position="absolute";g.style.left=(getLeft(q)+2*q.offsetWidth/3)+"px";
g.style.top=getTop(q)+"px";if(J){_DEBUG.debug("popup left = "+g.style.left+", top = "+g.style.top)}g.style.zIndex="1000";g.style.display="";demoTable.style.display="";var k=document.getElementById("popupHeader");
k.innerHTML="<table><tr><td width='100%'><span class='popupHeader'>"+m+"</span></td><td><a href='javascript:"+T+".clearPOPUP();'><img border='0' src='images/html/close.gif'/></a></td></tr></table>";var l=document.getElementById("popupBody");
l.innerHTML="<div class='popupBody'>"+o+"</div>";var p=document.getElementById("popupFooter");p.innerHTML="<div class='popupFooter'></div>";U.onfocus=I;B.onfocus=I;K.onfocus=I;a.onfocus=I;g.onkeypress=this.keyPress;
g.srcOBJ=q;g.focus();c=true};function I(){var f=document.getElementById(N);f.focus()}this.CityneoPARSE_traiteXML_geocodeRue=function(q){var l=q.getElementsByTagName("CONTENT")[0];var k=xmlReadField(l,"COUNT");
var n=xmlReadField(l,"TYPE");if(k==0||n!="STREET"){this.showPOPUP(B,200,100,"#ffffa0","No result","Street not found");return }var g=l.getElementsByTagName("STREET");var f=new Array();for(var p=0;p<g.length;
p++){var m=new geocodeRUE(xmlReadField(g[p],"STREET.ID"),xmlReadField(g[p],"STREET.SETTLEMENT"),xmlReadField(g[p],"STREET.SETTLEMENT.LG"),xmlReadField(g[p],"STREET.ZIP"),xmlReadField(g[p],"STREET.NAME"),xmlReadField(g[p],"STREET.NAME.LG"),xmlReadField(g[p],"STREET.GEOCODE.HOUSE"),xmlReadField(g[p],"STREET.GEOCODE.X"),xmlReadField(g[p],"STREET.GEOCODE.Y"),xmlReadField(g[p],"STREET.GEOCODE.LEVEL"));
f.push(m)}if(k==1){A=f[0];this.geocodeCurrent(false)}else{var o="";D=f;for(var p=0;p<k;p++){var h=f[p];o=o+"<div><a href='javascript:"+T+".choiceRue("+p+");'>"+h.toString()+"</a></div>"}this.showPOPUP(B,300,100,"#a0ffa0","Specify your choice:",o)
}};this.CityneoPARSE_traiteXML_geocodeCommune=function(p){var l=p.getElementsByTagName("CONTENT")[0];var k=xmlReadField(l,"COUNT");if(k==0){this.showPOPUP(a,200,100,"#ffffa0","No result","City not found.");
return }var g=l.getElementsByTagName("SETTLEMENT");var f=new Array();for(var o=0;o<g.length;o++){var n=new geocodeCOMMUNE(xmlReadField(g[o],"SETTLEMENT.ID"),xmlReadField(g[o],"SETTLEMENT.NAME"),xmlReadField(g[o],"SETTLEMENT.NAME.LG"),xmlReadField(g[o],"SETTLEMENT.NAME.GEO"),xmlReadField(g[o],"SETTLEMENT.NAME.GEO.LG"),xmlReadField(g[o],"SETTLEMENT.ZIP"),xmlReadField(g[o],"SETTLEMENT.LEVEL3.NAME"),xmlReadField(g[o],"SETTLEMENT.LEVEL3.NAME.LG"),xmlReadField(g[o],"SETTLEMENT.GEOCODE.X"),xmlReadField(g[o],"SETTLEMENT.GEOCODE.Y"),xmlReadField(g[o],"SETTLEMENT.GEOCODE.LEVEL"));
f.push(n)}if(k==1){b=f[0];this.geocodeCurrent(false)}else{var m="";D=f;for(var o=0;o<k;o++){var h=f[o];m=m+"<div><a href='javascript:"+T+".choiceCommune("+o+");'>"+h.toString()+"</a></div>"}this.showPOPUP(a,300,100,"#a0ffa0","Specify your choice:",m)
}};var D=null;this.choiceCommune=function(f){this.clearPOPUP();b=D[f];this.geocodeCurrent(false)};this.choiceRue=function(f){this.clearPOPUP();A=D[f];this.geocodeCurrent(false)};function Z(k,h,g){var l="sessionid="+Y+"&method=auto&c=propercase&country="+k+"&lg="+O;
if(h!=null&&h!=""){l=l+"&settlement="+h}if(g!=null&&g!=""){l=l+"&zip="+g}var f=new AJAX_XMLCGS(_CONFIG.urlMAINgeocode,l,T+".CityneoPARSE_traiteXML_geocodeCommune",5,T+".serviceNonAvailable",null);f.execute()
}function L(l,h,k,g){var m="sessionid="+Y+"&method=auto&c=propercase&country="+l+"&lg="+O+"&settlement="+h+"&street="+k;if(g!=null&&g!=""){m=m+"&house="+g}var f=new AJAX_XMLCGS(_CONFIG.urlMAINgeocode,m,T+".CityneoPARSE_traiteXML_geocodeRue",5,T+".serviceNonAvailable",null);
f.execute()}this.setNumForm=function(f){U.value=f};this.setStreetForm=function(f){B.value=f};this.setCityForm=function(f){a.value=f};this.setZipcodeForm=function(f){K.value=f};this.setCountrycodeForm=function(g){var f=0;
while(f<G.length&&g!=G[f].value){f++}if(f<G.length){G.selectedIndex=f}};this.updateForm=function(f,l,k,h,g){this.setNumForm(f);this.setStreetForm(l);this.setCityForm(k);this.setZipcodeForm(h);this.setCountrycodeForm(g)
}}function geocodeRUE(F,H,G,D,I,J,A,E,C,B){this.rueID=F;this.settlementNAME=H;this.settlementLG=G;this.zip=D;this.rueNAME=I;this.rueLG=J;this.house=A;this.X=E;this.Y=C;this.level=B;this.toString=function(){var K=I;
if(A!=null&&A!=""){K=K+", "+A}K=K+" - "+H;if(D!=null&&D!=""){K=K+" ("+D+")"}return K};this.getParamForCallback=function(){return this.X+","+this.Y+",'"+this.level+"'"}}function geocodeCOMMUNE(G,K,I,J,B,D,H,F,E,C,A){this.communeID=G;
this.settlementNAME=K;this.settlementLG=I;this.communeNAME=J;this.communeLG=B;this.zip=D;this.departementNAME=H;this.departementLG=F;this.X=E;this.Y=C;this.level=A;this.toString=function(){var L=K;if(D!=null&&D!=""){L=L+" ("+D+")"
}if(K!=J){L=L+" - "+J}if(H!=null&&H!=""){L=L+" - "+H}return L};this.getParamForCallback=function(){return this.X+","+this.Y+",'"+this.level+"'"}}var popup1IMG="/cityneo/mapDisplayJS/pictoMain/popup1.gif";
function genericPOI(){var H=true;var J=100;var X=400;var R=null;var W;var G;var T;var I;var P;var O;var Q;var V;var E;var C;var N;var L;var D;var B;var K;var A;var U;var M;var F;this.init=function(f,b,r,g,o,h,q,n,k,p,a,e,c,m,l,Z,d){P=b;
O=r;Q=g;V=o;C=h;N=q;L=n;F=d;E=l;W=f;G=k;T=p;I=a;D=e;B=c;K=m;A=Z};this.activate=function(b){purgepopup(D);if(G==null){return }if(T==null){return }var c=document.createElement("div");c.id=D;c.style.position="absolute";
c.style.zIndex=200;c.style.visibility="hidden";I.appendChild(c);var d=document.createElement("div");d.id=D+"_N1";d.style.zIndex=220;d.style.position="absolute";d.innerHTML=T;c.appendChild(d);var g=null;
if(K==popupLookandFeel.blank){g=new CityneoPOPUPblank(F,c,d,P,O,Q,V)}else{if(K==popupLookandFeel.bubble){g=new CityneoPOPUPbubble(F,c,d,P,O,Q,V)}else{return }}var a=null;var h=true;if(B==popupType.bestDisplayOnMouseOver){var f=calculateOPTIMALPopupPosition(I,P,O,g.getNEWIwidth(),g.getNEWIheight(),C,N);
g.setPosition(f);U=0;M=0;a=null;h=true;c.onmouseout=Y}else{if(B==popupType.centeredDisplayOnMouseClick){g.setPosition(popupPosition.HM);var k=I.offsetLeft+P+g.getNEWIrecentrageX();var Z=I.offsetTop+O+g.getNEWIrecentrageY();
U=parseInt(C/2-k);M=parseInt(N/2-Z);if(E){a='mouseOutInteractXXX("'+A.getOName()+'",'+U+","+M+',"'+D+'",false)'}else{a=null}h=false;A.deplaceCarte(U,M,false)}}g.build(D,a);d.style.top=g.getN1top()+"px";
d.style.left=g.getN1left()+"px";c.style.width=g.getNEWIwidth()+"px";c.style.height=g.getNEWIheight()+"px";c.style.left=g.getNEWIleft()+"px";c.style.top=g.getNEWItop()+"px";fadeIn(c,J);internal_SHOWPOPUP=true;
if(S!=0){clearTimeout(S)}A.stopEventListener();if(h){S=setTimeout("showPOPUP('"+D+"')",X)}else{showPOPUP(D)}};var S=0;this.unactivate=function(a,Z){internal_SHOWPOPUP=false;if(isNull(Z)){Z=false}Y(a,Z)
};this.closeWindow=function(a,Z){internal_SHOWPOPUP=false;if(isNull(Z)){Z=false}mouseOutInteractXXX(A.getOName(),U,M,D,Z)};this.getDecalXwhenUnactivate=function(){return U};this.getDecalYwhenUnactivate=function(){return M
};function Y(a,Z){if(isNull(Z)){Z=false}if(testMouseLeave(a,D)){mouseOutInteractXXX(A.getOName(),U,M,D,Z)}}}function mouseOutInteractXXX(D,C,A,E,B){if(C!=0||A!=0){setTimeout(D+".deplaceCarte("+(-C)+","+(-A)+","+B+")",0)
}purgepopup(E);setTimeout(D+".playEventListener()",0)}var internal_SHOWPOPUP=false;function showPOPUP(B){if(internal_SHOWPOPUP){var A=document.getElementById(B);if(A!=null){A.style.visibility="visible";
internal_SHOWPOPUP=false}}}function getInnerHTML_CopyCONTENU(D,A,C,B){return B}function purgepopup(B){try{oMe1=document.getElementById(B);oMe1.parentNode.removeChild(oMe1)}catch(A){}}function testMouseLeave(A,B){if(!A){if(!event.fromElement.contains(event.toElement)&&!document.getElementById(B).contains(event.toElement)){return true
}}else{b1=firefoxContains(A.target,A.relatedTarget);b2=firefoxContains(document.getElementById(B),A.relatedTarget);if(!b1&&!b2){return true}}return false}function getDIVforImage(A,B,C){return"<div style='width:"+B+"px;height:"+C+"px;background:url("+A+");background-position:center center; background-repeat : no-repeat;'></div>"
}function getDIVforImageWithID(D,A,B,C){return"<div id='"+D+"' style='width:"+B+"px;height:"+C+"px;background:url("+A+");background-position:center center; background-repeat : no-repeat;'></div>"}function getIMGforImage(A){return"<img valign='middle' align='center' src='"+A+"'/>"
}function CityneoBUTTONTypeHand(C,A,D,B){if(C!=mapEventMode.edition){throw"eventMode "+C+" incompatible with CityneoBUTTONTypeHand"}this.eventMode=C;this.cursorHand=A;this.cursorMove=D;this.callBackFunction=B
}function CityneoBUTTONTypeSticker(I,H,D,B,A,G,C,F,E){if(I!=mapEventMode.pinpoint&&I!=mapEventMode.geocod){throw"eventMode "+I+" incompatible with CityneoBUTTONTypeSticker"}this.eventMode=I;this.cursor=H;
this.image=D;this.imagePosition=new Pixel(B,A);this.recenterPosition=new Pixel(F,E);this.sandbox=G;this.callBackFunction=C}function CityneoTOOLBAR(){var J;var B;var G;var C;var H;var I;var A;var L;var N=mapEventMode.edition;
var F=toolBarPosition.horizontal;var M;var E="toolBar_button_";this.init=function(S,P,T,R,O,Q){J=S;B=document.getElementById(P);G=Q;C=N;H=F;this.setButtonNameAndParamList(T,R,O)};this.setSelectedButton=function(O,P){if(!G.setMapEventMode(L[O].eventMode,L[O],P)){alert("Ce mode ne peut etre active");
return }K(O)};this.setButtonNameAndParamList=function(Q,P,O){I=Q;A=P;L=O};this.setPosition=function(O,Q,P){B.style.position=O;B.style.left=Q;B.style.top=P};this.setPositionBar=function(O){H=O};this.start=function(){D()
};function K(P){var O=document.getElementById(E+C);O.src=I[C];var O=document.getElementById(E+P);O.src=A[P];C=P}function D(){if(H==toolBarPosition.horizontal){var Q=document.createElement("div");for(i=0;
i<L.length;i++){var P=document.createElement("a");P.href="javascript:"+J+".setSelectedButton("+i+",null);";Q.appendChild(P);var O=document.createElement("img");O.id=E+i;O.src=I[i];O.border=0;P.appendChild(O)
}}B.appendChild(Q);K(C)}};