if(!Artem){var Artem={}}if(!Artem.Web){Artem.Web={}}Artem.Web.GoogleMapView={Normal:0,Satellite:1,Hybrid:2,Physical:3,MoonElevation:4,MoonVisible:5,MarsElevation:6,MarsVisible:7,MarsInfrared:8,SkyVisible:9,Satellite3D:10,convert:function(A){switch(A){case G_SATELLITE_MAP:return Artem.Web.GoogleMapView.Satellite;case G_SATELLITE_3D_MAP:return Artem.Web.GoogleMapView.Satellite3D;case G_HYBRID_MAP:return Artem.Web.GoogleMapView.Hybrid;case G_PHYSICAL_MAP:return Artem.Web.GoogleMapView.Physical;case G_MOON_ELEVATION_MAP:return Artem.Web.GoogleMapView.MoonElevation;case G_MOON_VISIBLE_MAP:return Artem.Web.GoogleMapView.MoonVisible;case G_MARS_ELEVATION_MAP:return Artem.Web.GoogleMapView.MarsElevation;case G_MARS_VISIBLE_MAP:return Artem.Web.GoogleMapView.MarsVisible;case G_MARS_INFRARED_MAP:return Artem.Web.GoogleMapView.MarsInfrared;case G_SKY_VISIBLE_MAP:return Artem.Web.GoogleMapView.SkyVisible;default:return Artem.Web.GoogleMapView.Normal}}};Artem.Web.OpenInfoBehaviour={Click:0,DoubleClick:1,MouseDown:2,MouseOut:3,MouseOver:4,MouseUp:5};Artem.Web.Delegate={call:function(A,B){this.create(A,B).call(A,arguments)},callFromString:function(A,B){this.createFromString(A,B).call(A,arguments)},create:function(A,B){return function(){return B.apply(A,arguments)}},createFromString:function(instance,methodString){var rex=new RegExp("\\(.*\\)");if(rex.test(methodString)){return function(){eval(methodString)}}else{var method=eval(methodString);return function(){return method.apply(instance,arguments)}}}};Artem.Web.GoogleManager={CurrentMap:null,Disposed:false,Initialized:false,Maps:new Array(),addMap:function(A){this.Maps[this.Maps.length]=(this.CurrentMap=A)},dispose:function(){if(!this.Disposed){GUnload();this.Disposed=true}},initialize:function(){if(!GBrowserIsCompatible()){throw"Your browser is not google maps api compatible!"}if(!this.Initialized){var A=Artem.Web.Delegate.create(this,this.dispose);if(typeof (Sys)!=="undefined"){Sys.Application.add_disposing(A)}else{document.body.onunload=A}}}};Artem.Web.GoogleBounds=function(A){this.GBounds=A};Artem.Web.GoogleBounds.prototype={save:function(){var B="{";if(this.GBounds){var A=this.GBounds.getSouthWest();var C=this.GBounds.getNorthEast();B+='"SouthWest":{"Latitude":'+A.lat()+',"Longitude":'+A.lng()+"},";B+='"NorthEast":{"Latitude":'+C.lat()+',"Longitude":'+C.lng()+"}"}B+="}";return B}};Artem.Web.GoogleDirection=function(B,A){this.Locale=A.Locale;this.Query=A.Query;this.RoutePanelId=A.RoutePanelId;var C=null;if(this.RoutePanelId){C=document.getElementById(this.RoutePanelId)}this.GDirections=new GDirections(B,C);this.error=false;GEvent.addListener(this.GDirections,"error",Artem.Web.Delegate.create(this,this.handleErrors))};Artem.Web.GoogleDirection.prototype={handleErrors:function(){alert("Une des adresses specifiee est introuvable.");this.error=true},save:function(){if(this.error==false){var B="{";B+='"Locale":"'+this.Locale+'",';B+='"Query":"'+this.Query+'",';B+='"RoutePanelId":"'+this.RoutePanelId+'",';var D=this.getDistance();B+='"Distance":{"Meters":'+D.meters+',"Html":"'+D.html+'"},';var C=this.getDuration();B+='"Duration":{"Seconds":'+C.seconds+',"Html":"'+C.html+'"},';var A=new Artem.Web.GoogleBounds(this.getBounds());B+='"Bounds":';B+=A.save();B+="}"}else{B=""}return B},load:function(B,A){this.GDirections.load(B,A)},loadDefault:function(){var A=(this.Locale)?{locale:this.Locale}:null;this.load(this.Query,A)},loadFromWaypoints:function(B,A){this.GDirections.loadFromWaypoints(B,A)},clear:function(){this.GDirections.clear()},getStatus:function(){return this.GDirections.getStatus()},getBounds:function(){return this.GDirections.getBounds()},getNumRoutes:function(){return this.GDirections.getNumRoutes()},getRoute:function(A){return this.GDirections.getRoute(A)},getNumGeocodes:function(){return this.GDirections.getNumGeocodes()},getGeocode:function(A){return this.GDirections.getGeocode(A)},getCopyrightsHtml:function(){return this.GDirections.getCopyrightsHtml()},getSummaryHtml:function(){return this.GDirections.getSummaryHtml()},getDistance:function(){return this.GDirections.getDistance()},getDuration:function(){return this.GDirections.getDuration()},getPolyline:function(){return this.GDirections.getPolyline()},getMarker:function(A){return this.GDirections.getMarker(A)}};Artem.Web.GoogleGroundOverlay=function(C,B){this.groundOverlay=null;this.Map=C;this.Image=B.Image;this.SouthWest=B.SouthWest;this.NorthEast=B.NorthEast;this.Zindex=B.Zindex;if(this.Image&&this.SouthWest&&this.NorthEast){var A=new GLatLngBounds(new GLatLng(this.SouthWest.Latitude,this.SouthWest.Longitude),new GLatLng(this.NorthEast.Latitude,this.NorthEast.Longitude));this.groundOverlay=new GGroundOverlay(this.Image,A)}};Artem.Web.GoogleGroundOverlay.prototype={save:function(){var A="{";A+='"Image":'+this.Image+",";A+='"SouthWest":{"Latitude":'+this.SouthWest.Latitude+',"Longitude":'+this.SouthWest.Longitude+"},";A+='"NorthEast":{"Latitude":'+this.NorthEast.Latitude+',"Longitude":'+this.NorthEast.Longitude+"}";A+="}";return A},load:function(){this.Map.addOverlay(this.groundOverlay)}};Artem.Web.GooglePolygon=function(B){this.Clickable=B.Clickable;this.FillColor=B.FillColor;this.FillOpacity=B.FillOpacity;this.Points=B.Points;this.StrokeColor=B.StrokeColor;this.StrokeOpacity=B.StrokeOpacity;this.StrokeWeight=B.StrokeWeight;var D=new Array();var A=new Object();if(this.Points){for(var C=0;C<this.Points.length;C++){D.push(new GLatLng(this.Points[C].Latitude,this.Points[C].Longitude))}}A.clickable=this.Clickable;this.GPolygon=new GPolygon(D,this.StrokeColor,this.StrokeWeight,this.StrokeOpacity,this.FillColor,this.FillOpacity,A)};Artem.Web.GooglePolygon.prototype={save:function(){var D="{";D+='"Clickable":'+this.Clickable+",";D+='"FillColor":"'+this.FillColor+'",';D+='"FillOpacity":'+this.FillOpacity+",";D+='"StrokeColor":"'+this.StrokeColor+'",';D+='"StrokeOpacity":'+this.StrokeOpacity+",";D+='"StrokeWeight":'+this.StrokeWeight+",";if(this.Points){D+='"Points":[';var A;for(var B=0;B<this.Points.length;B++){A=this.Points[B];D+='{"Latitude":'+A.Latitude+',"Longitude":'+A.Longitude+"},"}D=D.substr(0,D.length-1);D+="],"}var C=new Artem.Web.GoogleBounds(this.getBounds());D+='"Bounds":';D+=C.save();D+="}";return D},getBounds:function(){return this.GPolygon.getBounds()},hide:function(){this.GPolygon.hide()},isHidden:function(){return this.GPolygon.isHidden()},show:function(){this.GPolygon.show()}};Artem.Web.GooglePolyline=function(B){this.Clickable=B.Clickable;this.Color=B.Color;this.Geodesic=B.Geodesic;this.Opacity=B.Opacity;this.Points=B.Points;this.Weight=B.Weight;var D=new Array();var A=new Object();if(this.Points){for(var C=0;C<this.Points.length;C++){D.push(new GLatLng(this.Points[C].Latitude,this.Points[C].Longitude))}}A.clickable=this.Clickable;A.geodesic=this.Geodesic;this.GPolyline=new GPolyline(D,this.Color,this.Weight,this.Opacity,A)};Artem.Web.GooglePolyline.prototype={save:function(){var D="{";D+='"Clickable":'+this.Clickable+",";D+='"Color":"'+this.Color+'",';D+='"Geodesic":'+this.Geodesic+",";D+='"Opacity":'+this.Opacity+",";D+='"Weight":'+this.Weight+",";if(this.Points){D+='"Points":[';var A;for(var B=0;B<this.Points.length;B++){A=this.Points[B];D+='{"Latitude":'+A.Latitude+',"Longitude":'+A.Longitude+"},"}D=D.substr(0,D.length-1);D+="],"}var C=new Artem.Web.GoogleBounds(this.getBounds());D+='"Bounds":';D+=C.save();D+="}";return D},getBounds:function(){return this.GPolyline.getBounds()},hide:function(){this.GPolyline.hide()},isHidden:function(){return this.GPolyline.isHidden()},show:function(){this.GPolyline.show()},supportsHide:function(){return this.GPolyline.supportsHide()}};Artem.Web.GoogleMarker=function(C,A){this.GMarker=null;this.Map=C;this.Address=A.Address;this.AutoPan=A.AutoPan;this.Bouncy=A.Bouncy;this.Clickable=A.Clickable;this.Draggable=A.Draggable;this.DragCrossMove=A.DragCrossMove;this.Latitude=A.Latitude;this.Longitude=A.Longitude;this.OpenInfoBehaviour=A.OpenInfoBehaviour;this.OpenWindowContent=null;this.Text=A.Text;this.Title=A.Title;this.Id=A.Id;this.MaxContent=A.MaxContent;this.MaxTitle=A.MaxTitle;this.Icon=new GIcon();this.setIcon(A);if(A.GoogleEvents){this.ClientEvents=A.GoogleEvents.ClientEvents;this.ServerEvents=A.GoogleEvents.ServerEvents}if(C.Markers.length!=0){if(C.Markers[C.Markers.length-1].ClientEvents){this.ClientEvents=[];for(var B=0;B<C.Markers[C.Markers.length-1].ClientEvents.length;B++){this.ClientEvents[B]=new Object();this.ClientEvents[B].Key=C.Markers[C.Markers.length-1].ClientEvents[B].Key;this.ClientEvents[B].Handler=C.Markers[C.Markers.length-1].ClientEvents[B].Handler}}if(C.Markers[C.Markers.length-1].ServerEvents){this.ServerEvents=[];for(var B=0;B<C.Markers[C.Markers.length-1].ServerEvents.length;B++){this.ServerEvents[B]=new Object();this.ServerEvents[B].Key=C.Markers[C.Markers.length-1].ServerEvents[B].Key;this.ServerEvents[B].Handler=C.Markers[C.Markers.length-1].ServerEvents[B].Handler}}}};Artem.Web.GoogleMarker.prototype={check:function(){if(!this.GMarker){throw"Cannot use it before marker been loaded!"}},initialize:function(){var A;switch(this.OpenInfoBehaviour){case Artem.Web.OpenInfoBehaviour.Click:A="click";break;case Artem.Web.OpenInfoBehaviour.DoubleClick:A="dblclick";break;case Artem.Web.OpenInfoBehaviour.MouseDown:A="mousedown";break;case Artem.Web.OpenInfoBehaviour.MouseOut:A="mouseout";break;case Artem.Web.OpenInfoBehaviour.MouseOver:A="mouseover";break;case Artem.Web.OpenInfoBehaviour.MouseUp:A="mouseup";break}if(A){GEvent.addListener(this.GMarker,A,Artem.Web.Delegate.create(this,this.openDefaultInfoWindow))}this.initializeEvents(this.ClientEvents);this.initializeEvents(this.ServerEvents)},initializeEvents:function(B){if(B){for(var A=0;A<B.length;A++){GEvent.addListener(this.GMarker,B[A].Key,Artem.Web.Delegate.createFromString(this,B[A].Handler))}}},load:function(A){if(A){this.Latitude=A.lat();this.Longitude=A.lng();var B=new Object();B.autoPan=this.AutoPan;B.bouncy=this.Bouncy;B.clickable=this.Clickable;B.draggable=this.Draggable;B.dragCrossMove=this.DragCrossMove;B.title=this.Title;B.icon=this.createIcon();this.GMarker=new GMarker(A,B);this.Map.addOverlay(this.GMarker);this.initialize()}},save:function(){var B="{";B+='"Address":"'+this.Address+'",';B+='"AutoPan":'+this.AutoPan+",";B+='"Bouncy":'+this.Bouncy+",";B+='"Clickable":'+this.Clickable+",";B+='"Draggable":'+this.Draggable+",";B+='"Id":'+this.Id+",";B+='"DragCrossMove":'+this.DragCrossMove+",";var A=this.getLatLng();if(A){B+='"Latitude":'+A.lat()+",";B+='"Longitude":'+A.lng()+","}else{B+='"Latitude":'+this.Latitude+",";B+='"Longitude":'+this.Longitude+","}B+='"Text":"'+this.Text+'",';B+='"Title":"'+this.Title+'",';B+='"MaxContent":"'+this.MaxContent+'",';B+='"MaxTitle":"'+this.MaxTitle+'",';if(this.Icon){B+='"Icon":{';B+='"Shadow":"'+this.Icon.shadow+'",';if(this.Icon.iconSize){B+='"IconSize":{"Width":'+this.Icon.iconSize.width+',"Height":'+this.Icon.iconSize.height+"},"}if(this.Icon.shadowSize){B+='"ShadowSize":{"Width":'+this.Icon.shadowSize.width+',"Height":'+this.Icon.shadowSize.height+"},"}if(this.Icon.iconAnchor){B+='"IconAnchor":{"X":'+this.Icon.iconAnchor.x+',"Y":'+this.Icon.iconAnchor.y+"},"}if(this.Icon.infoWindowAnchor){B+='"InfoWindowAnchor":{"X:"'+this.Icon.infoWindowAnchor.x+',"Y":'+this.Icon.infoWindowAnchor.y+"},"}if(this.Icon.maxHeight){B+='"MaxHeight":"'+this.maxHeight+'",'}if(this.Icon.dragCrossImage){B+='"DragCrossImage":"'+this.dragCrossImage+'",'}if(this.Icon.dragCrossSize){B+='"DragCrossSize":{"Width":'+this.Icon.dragCrossSize.width+',"Height":'+this.Icon.dragCrossSize.height+"},"}if(this.Icon.dragCrossAnchor){B+='"DragCrossAnchor":{"X":'+this.Icon.dragCrossAnchor.x+',"Y":'+this.Icon.dragCrossAnchor.y+"}"}B+='"Image":"'+this.Icon.image+'"}'}B+="}";return B},createIcon:function(){if(!this.Icon.image){this.Icon=new GIcon(G_DEFAULT_ICON)}if(!this.Icon.iconSize||(this.Icon.iconSize.width==0&&this.Icon.iconSize.height==0)){this.Icon.iconSize=new GSize(20,34)}if(!this.Icon.iconAnchor||(this.Icon.iconAnchor.x==0&&this.Icon.iconAnchor.y==0)){this.Icon.iconAnchor=new GPoint(Math.round(this.Icon.iconSize.width/2),this.Icon.iconSize.height)}if(!this.Icon.infoWindowAnchor||(this.Icon.infoWindowAnchor.x==0&&this.Icon.infoWindowAnchor.y==0)){this.Icon.infoWindowAnchor=new GPoint(Math.round(this.Icon.iconSize.width/2),5)}return this.Icon},setIcon:function(A){if(A.Icon){if(A.Icon.image){this.Icon=A.Icon}else{this.Icon.iconSize=new GSize(20,34);this.Icon.shadowSize=new GSize(20,34);this.Icon.iconAnchor=new GPoint(9,34);this.Icon.infoWindowAnchor=new GPoint(9,2);this.Icon.dragCrossSize=new GSize(16,16);this.Icon.dragCrossAnchor=new GPoint(7,9);if(A.Icon.Image){this.Icon.image=A.Icon.Image}if(A.Icon.IconSize){this.Icon.iconSize.height=A.Icon.IconSize.Height}if(A.Icon.IconSize){this.Icon.iconSize.width=A.Icon.IconSize.Width}if(A.Icon.Shadow){this.Icon.shadow=A.Icon.Shadow}if(A.Icon.ShadowSize){this.Icon.shadowSize.height=A.Icon.ShadowSize.Height}if(A.Icon.ShadowSize){this.Icon.shadowSize.width=A.Icon.ShadowSize.Width}if(A.Icon.IconAnchor){this.Icon.iconAnchor.x=A.Icon.IconAnchor.X}if(A.Icon.IconAnchor){this.Icon.iconAnchor.y=A.Icon.IconAnchor.Y}if(A.Icon.InfoWindowAnchor){this.Icon.infoWindowAnchor.x=A.Icon.InfoWindowAnchor.X}if(A.Icon.InfoWindowAnchor){this.Icon.infoWindowAnchor.y=A.Icon.InfoWindowAnchor.Y}if(A.Icon.MaxHeight){this.Icon.maxHeight=A.Icon.MaxHeight}if(A.Icon.DragCrossImage){this.Icon.dragCrossImage=A.Icon.DragCrossImage}if(A.Icon.DragCrossSize){this.Icon.dragCrossSize.height=A.Icon.DragCrossSize.Height}if(A.Icon.DragCrossSize){this.Icon.dragCrossSize.width=A.Icon.DragCrossSize.Width}if(A.Icon.DragCrossAnchor){this.Icon.dragCrossAnchor.x=A.Icon.DragCrossAnchor.X}if(A.Icon.DragCrossAnchor){this.Icon.dragCrossAnchor.y=A.Icon.DragCrossAnchor.Y}}}},openDefaultInfoWindow:function(){this.check();if(this.OpenWindowContent){var B=document.getElementById(this.OpenWindowContent);this.openInfoWindow(B.cloneNode(true))}else{var A=new Object();A.maxContent=this.MaxContent;A.maxTitle=this.MaxTitle;this.openInfoWindowHtml(this.Text,A)}},openInfoWindowHtml:function(B,A){this.check();this.GMarker.openInfoWindowHtml(B,A)},closeInfoWindow:function(){this.check();this.GMarker.closeInfoWindow()},disableDragging:function(){this.check();this.GMarker.disableDragging()},draggable:function(){this.check();return this.GMarker.draggable()},draggingEnabled:function(){this.check();return this.GMarker.draggingEnabled()},enableDragging:function(){this.check();this.GMarker.enableDragging()},getIcon:function(){this.check();return this.GMarker.getIcon()},getLatLng:function(){this.check();return this.GMarker.getLatLng()},getPoint:function(){this.check();return this.GMarker.getPoint()},getTitle:function(){this.check();return this.GMarker.getTitle()},hide:function(){this.check();this.GMarker.hide()},isHidden:function(){this.check();return this.GMarker.isHidden()},openInfoWindow:function(A){this.check();this.GMarker.openInfoWindow(A)},setImage:function(A){this.check();this.GMarker.setImage(A)},setLatLng:function(A){this.check();this.GMarker.setLatLng(A)},setPoint:function(A){this.check();this.GMarker.setPoint(A)},show:function(){this.check();this.GMarker.show()}};var pAdress=true;var ge=null;Artem.Web.GoogleMap=function(D){this.Address=D.Address;this.BaseCountryCode=D.BaseCountryCode;this.DefaultMapView=D.DefaultMapView;this.ClientID=D.ClientID;this.IsGeolocation=false;this.IsStatic=D.IsStatic;this.Key=D.Key;this.Latitude=D.Latitude;this.Longitude=D.Longitude;this.ShowMapTypeControl=D.ShowMapTypeControl;this.ShowTraffic=D.ShowTraffic;this.Zoom=D.Zoom;this.ZoomPanType=D.ZoomPanType;this.ZoomPanControl=null;this.TypeControl=null;this.OverViewControl=null;this.OverView=D.OverView;this.ScaleControl;this.Scale=D.Scale;this.EnableStartPolygon=D.EnableStartPolygon;this.EnableContinuousZoom=D.EnableContinuousZoom;this.EnableDoubleClickZoom=D.EnableDoubleClickZoom;this.EnableDragging=D.EnableDragging;this.EnableGoogleBar=D.EnableGoogleBar;this.EnableInfoWindow=D.EnableInfoWindow;this.EnableMarkerManager=D.EnableMarkerManager;this.EnableScrollWheelZoom=D.EnableScrollWheelZoom;if(D.GoogleEvents){this.ClientEvents=D.GoogleEvents.ClientEvents;this.ServerEvents=D.GoogleEvents.ServerEvents}this.ClientGeoLoadedIndex=null;this.ServerGeoLoadedIndex=null;this.Actions=null;this.Directions=null;this.Markers=null;this.Polygons=null;this.Polylines=null;this.GroundOverlays=null;this.Addresses=D.Addresses;if(this.Addresses[0]){var G=document.createElement("div");var H=[];H[H.length]='<table width="400">';H[H.length]="<tr><td><b>Veuillez choisir l'adresse desiree</b></td></tr>";for(var E=0,B=this.Addresses.length;E<B;E++){H[H.length]='<tr><td><a style="color:black;" href="#" onClick="'+this.ClientID+"_Map.loadAdresses("+E+');" >'+this.Addresses[E].Name+"</a></td></tr>"}H[H.length]="</table>";G.innerHTML=H.join("");var F="width:400px;background-color: #fff;border:1px solid #000;padding:15px;text-align:center;z-index: 1001;position : absolute;top: 100px;left:"+(((screen.width)/2)-200)+"px;";G.style.cssText=F;G.id="contenuPopup";var A=document.createElement("div");A.id="popup";F="position: absolute;left: 0px;top: 0px;width:100%;height:100%;text-align:center;z-index: 1000;background-color:Gray;filter:alpha(opacity=70);opacity:0.7;";A.style.cssText=F;document.body.appendChild(A);document.body.appendChild(G)}this.GMap=null;this.MarkerManager=null;ge=null;this.EnableView3D=D.EnableView3D;this.Geocoder=new GClientGeocoder();if(D.BaseCountryCode){this.Geocoder.setBaseCountryCode(D.BaseCountryCode)}Artem.Web.GoogleManager.initialize();if(!this.IsStatic){var C;if(this.Width&&this.Height){C={size:new GSize(this.Width,this.Height)}}this.BlockUpdate=D.BlockUpdate;if(this.BlockUpdate==false){this.GMap=new GMap2(document.getElementById(this.ClientID+"_Map"),C)}}};Artem.Web.GoogleMap.prototype={addMarkers:function(D,E,C,B){var A=D.pop();if(D.length>0){this.addMarker(A,function(){this.addMarkers(D,E,C,B)},this)}else{if(D.length==0){this.addMarker(A,E,this)}}},addMarker:function(C,E,D,B){if(!this.Markers){this.Markers=new Array()}if(C.Latitude==0&&C.Longitude==0){var A=this;this.Geocoder.getLatLng(C.Address,function(F){if(F){A.Markers.push(new Artem.Web.GoogleMarker(A,C))}if(E){E.apply(D||this,B||[])}})}else{this.Markers.push(new Artem.Web.GoogleMarker(this,C));if(E){E.apply(D||this,B||[])}}},addDirection:function(A){if(!this.Directions){this.Directions=new Array()}this.Directions.push(new Artem.Web.GoogleDirection(this.GMap,A))},addGroundOverlay:function(A){if(!this.GroundOverlays){this.GroundOverlays=new Array()}this.GroundOverlays.push(new Artem.Web.GoogleGroundOverlay(this.GMap,A))},addPolygon:function(A){if(!this.Polygons){this.Polygons=new Array()}this.Polygons.push(new Artem.Web.GooglePolygon(A))},addPolyline:function(A){if(!this.Polylines){this.Polylines=new Array()}this.Polylines.push(new Artem.Web.GooglePolyline(A))},addAction:function(A){if(!this.Actions){this.Actions=new Array()}this.Actions.push(A)},clearMarkers:function(){if(this.Markers){this.Markers=new Array()}},clearDirections:function(A){if(this.Directions){this.Directions=new Array()}},clearPolygons:function(A){if(this.Polygons){this.Polygons=new Array()}},clearPolylines:function(A){if(this.Polylines){this.Polylines=new Array()}},clearActions:function(A){if(this.Actions){this.Actions=new Array()}},getElement:function(){return document.getElementById(this.ClientID)},getMapElement:function(){return document.getElementById(this.ClientID+"_Map")},initialize:function(){(this.EnableContinuousZoom)?this.enableContinuousZoom():this.disableContinuousZoom();(this.EnableDoubleClickZoom)?this.enableDoubleClickZoom():this.disableDoubleClickZoom();(this.EnableDragging)?this.enableDragging():this.disableDragging();(this.EnableGoogleBar)?this.enableGoogleBar():this.disableGoogleBar();(this.EnableInfoWindow)?this.enableInfoWindow():this.disableInfoWindow();(this.EnableScrollWheelZoom)?this.enableScrollWheelZoom():this.disableScrollWheelZoom();if(this.ZoomPanType&&this.ZoomPanType==1){this.Control=new GLargeMapControl()}else{this.ZoomPanControl=new GSmallMapControl()}this.GMap.addControl(this.ZoomPanControl);this.TypeControl=new GMapTypeControl();if(this.ShowMapTypeControl){this.GMap.addControl(this.TypeControl)}this.ScaleControl=new GScaleControl();if(this.Scale){this.GMap.addControl(this.ScaleControl)}this.OverViewControl=new GOverviewMapControl();if(this.OverView){this.GMap.addControl(this.OverViewControl)}if(this.ShowTraffic){this.GMap.addOverlay(new GTrafficOverlay())}if(this.EnableMarkerManager){this.MarkerManager=new MarkerManager(this.GMap)}if(this.EnableStartPolygon){itStartPolygon()}if(this.EnableView3D){this.GMap.addMapType(G_SATELLITE_3D_MAP);this.GMap.getEarthInstance(this.getEarthInstanceCB)}this.setupEvents(this.ClientEvents,true);this.setupEvents(this.ServerEvents,false);this.setMapView()},getEarthInstanceCB:function(A){ge=A},toggleOptions:function(B,C,A){if(this.getCurrentMapType().getUrlArg()!="e"){switch(B){case"ZoomPan":this.GMap.removeControl(this.ZoomPanControl);if(C=="Large"){this.ZoomPanControl=new GLargeMapControl()}if(C=="Small"){this.ZoomPanControl=new GSmallMapControl()}if(C!="Hide"){this.GMap.addControl(this.ZoomPanControl,A)}break;case"OverView":if(C=="Show"){this.GMap.addControl(this.OverViewControl)}if(C=="Hide"){this.GMap.removeControl(this.OverViewControl)}break;case"Scale":if(C=="Show"){this.GMap.addControl(this.ScaleControl)}if(C=="Hide"){this.GMap.removeControl(this.ScaleControl)}break;case"Type":if(C=="Show"){this.GMap.addControl(this.TypeControl,A)}if(C=="Hide"){this.GMap.removeControl(this.TypeControl)}break}}else{switch(B){case"ZoomPan":if(C=="Large"||C=="Small"){ge.getNavigationControl().setVisibility(true)}else{ge.getNavigationControl().setVisibility(false)}break;case"OverView":if(C=="Show"){ge.getOptions().setOverviewMapVisibility(true)}if(C=="Hide"){ge.getOptions().setOverviewMapVisibility(false)}break;case"Scale":if(C=="Show"){ge.getOptions().setScaleLegendVisibility(true)}if(C=="Hide"){ge.getOptions().setScaleLegendVisibility(false)}break;case"Type":if(C=="Show"){this.GMap.addControl(this.TypeControl,A)}if(C=="Hide"){this.GMap.removeControl(this.TypeControl)}break;case"Grid":if(C=="Show"){ge.getOptions().setGridVisibility(true)}if(C=="Hide"){ge.getOptions().setGridVisibility(false)}break;case"Atmosphere":if(C=="Show"){ge.getOptions().setAtmosphereVisibility(true)}if(C=="Hide"){ge.getOptions().setAtmosphereVisibility(false)}break;case"Border":if(C=="Show"){ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS,true)}if(C=="Hide"){ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS,false)}break}}},load:function(A){if(this.BlockUpdate==false){if(A){if(!this.IsStatic){this.Latitude=A.lat();this.Longitude=A.lng();this.setCenter(A,this.Zoom);if(this.IsGeolocation){this.IsGeolocation=false;if(this.ClientGeoLoadedIndex!=null){Artem.Web.Delegate.callFromString(this,this.ClientEvents[this.ClientGeoLoadedIndex].Handler)}if(this.ServerGeoLoadedIndex!=null){Artem.Web.Delegate.callFromString(this,this.ServerEvents[this.ServerGeoLoadedIndex].Handler)}}this.initialize();this.render();this.checkResize()}else{this.loadStatic()}}else{Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(Artem.Web.Delegate.create(this,this.savepartial));document.forms[0].onsubmit=Artem.Web.Delegate.create(this,this.save);if((this.Latitude!=0)&&(this.Longitude!=0)){this.load(new GLatLng(this.Latitude,this.Longitude))}else{this.IsGeolocation=true;var B=this;this.Geocoder.getLatLng(this.Address,function(C){if(C){B.Geocoder.getLatLng(B.Address,Artem.Web.Delegate.create(B,B.load))}else{if(!B.Addresses[0]){B.Geocoder.getLatLng("Paris",Artem.Web.Delegate.create(B,B.load));if(B.Address!=null){alert("Adresse Introuvable.")}}}})}}}},savepartial:function(D,B){this.save();var F=document.getElementById(this.ClientID+"_State");var G=F.value;var E=B.get_request();var A=E.get_body();var C="&"+this.ClientID+"_State=";G=escape(G);G=G.replace("+","%2B");G=G.replace("/","%2F");A=A.replace(C,C+G);E.set_body(A)},loadAddress:function(A){this.Address=A;this.IsGeolocation=true;this.Geocoder.getLatLng(this.Address,Artem.Web.Delegate.create(this,this.load))},loadStatic:function(){var E=this.getMapElement();var D=512;if(this.Didth&&this.Width<512){D=this.Width}var A=512;if(this.Height&&this.Height<512){A=this.Height}var F="http://maps.google.com/staticmap?";F+="center="+this.Latitude+","+this.Longitude+"&";F+="zoom="+this.Zoom+"&";F+="size="+D+"x"+A+"&";F+="key="+this.Key;if(this.Markers){var C;F+="&markers=";for(C=0;C<this.Markers.length;C++){F+=this.Markers[C].Latitude+","+this.Markers[C].Longitude+"|"}}var B=document.createElement("img");B.src=F;E.appendChild(B)},render:function(){if(this.Markers){var A;for(var B=0;B<this.Markers.length;B++){A=this.Markers[B];if((A.Latitude!=0)&&(A.Longitude!=0)){A.load(new GLatLng(A.Latitude,A.Longitude))}else{this.Geocoder.getLatLng(A.Address,Artem.Web.Delegate.create(A,A.load))}}}if(this.Directions){for(var B=0;B<this.Directions.length;B++){this.Directions[B].loadDefault()}}if(this.Polylines){for(var B=0;B<this.Polylines.length;B++){this.addOverlay(this.Polylines[B].GPolyline)}}if(this.Polygons){for(var B=0;B<this.Polygons.length;B++){this.addOverlay(this.Polygons[B].GPolygon)}}if(this.GroundOverlays){for(var B=0;B<this.GroundOverlays.length;B++){this.GroundOverlays[B].load()}}if(this.Actions){for(var B=0;B<this.Actions.length;B++){Artem.Web.Delegate.callFromString(this,this.Actions[B])}}},save:function(){var E="{";E+='"Address":"'+this.Address+'"';E+=',"BaseCountryCode":"'+this.BaseCountryCode+'"';E+=',"DefaultMapView":'+Artem.Web.GoogleMapView.convert(this.getCurrentMapType());E+=',"EnableGoogleBar":'+this.EnableGoogleBar;E+=',"EnableMarkerManager":'+this.EnableMarkerManager;E+=',"EnableScrollWheelZoom":'+this.EnableScrollWheelZoom;E+=',"IsStatic":'+this.IsStatic;var A=this.getCenter();if(A){E+=',"Latitude":'+A.lat();E+=',"Longitude":'+A.lng()}else{E+=',"Latitude":'+this.Latitude;E+=',"Longitude":'+this.Longitude}E+=',"ShowMapTypeControl":'+this.ShowMapTypeControl;E+=',"ShowTraffic":'+this.ShowTraffic;E+=',"Zoom":'+this.getZoom();E+=',"ZoomPanType":'+this.ZoomPanType;var D=new Artem.Web.GoogleBounds(this.getBounds());E+=',"Bounds":';E+=D.save();if(this.Markers){E+=',"Markers":[';for(var B=0;B<this.Markers.length;B++){E+=this.Markers[B].save()}E+="]"}if(this.Directions){E+=',"Directions":[';for(var B=0;B<this.Directions.length;B++){if(this.Directions[B].error==false){E+=this.Directions[B].save()}}E+="]"}if(this.Polylines){E+=',"Polylines":[';for(var B=0;B<this.Polylines.length;B++){E+=this.Polylines[B].save()}E+="]"}if(this.GroundOverlays){E+=',"GroundOverlays":[';for(var B=0;B<this.GroundOverlays.length;B++){E+=this.GroundOverlays[B].save()}E+="]"}if(this.Polygons){E+=',"Polygons":[';for(var B=0;B<this.Polygons.length;B++){E+=this.Polygons[B].save()}E+="]"}E+="}";var C=document.getElementById(this.ClientID+"_State");C.value=E},setupEvents:function(C,A){if(C){for(var B=0;B<C.length;B++){if(C[B].Key!="geoload"){GEvent.addListener(this.GMap,C[B].Key,Artem.Web.Delegate.createFromString(this,C[B].Handler))}else{if(A){this.ClientGeoLoadedIndex=B}else{this.ServerGeoLoadedIndex=B}}}}},setMapView:function(){if(this.DefaultMapView){switch(this.DefaultMapView){case Artem.Web.GoogleMapView.Normal:this.GMap.setMapType(G_NORMAL_MAP);break;case Artem.Web.GoogleMapView.Satellite:this.GMap.setMapType(G_SATELLITE_MAP);break;case Artem.Web.GoogleMapView.Satellite3D:this.GMap.setMapType(G_SATELLITE_3D_MAP);break;case Artem.Web.GoogleMapView.Hybrid:this.GMap.setMapType(G_HYBRID_MAP);break;case Artem.Web.GoogleMapView.Physical:this.GMap.addMapType(G_PHYSICAL_MAP);this.GMap.setMapType(G_PHYSICAL_MAP);break;case Artem.Web.GoogleMapView.MoonElevation:this.GMap.addMapType(G_MOON_ELEVATION_MAP);this.GMap.setMapType(G_MOON_ELEVATION_MAP);break;case Artem.Web.GoogleMapView.MoonVisible:this.GMap.addMapType(G_MOON_VISIBLE_MAP);this.GMap.setMapType(G_MOON_VISIBLE_MAP);break;case Artem.Web.GoogleMapView.MarsElevation:this.GMap.addMapType(G_MARS_ELEVATION_MAP);this.GMap.setMapType(G_MARS_ELEVATION_MAP);break;case Artem.Web.GoogleMapView.MarsVisible:this.GMap.addMapType(G_MARS_VISIBLE_MAP);this.GMap.setMapType(G_MARS_VISIBLE_MAP);break;case Artem.Web.GoogleMapView.MarsInfrared:this.GMap.addMapType(G_MARS_INFRARED_MAP);this.GMap.setMapType(G_MARS_INFRARED_MAP);break;case Artem.Web.GoogleMapView.SkyVisible:this.GMap.addMapType(G_SKY_VISIBLE_MAP);this.GMap.setMapType(G_SKY_VISIBLE_MAP);break}}},addControl:function(B,A){this.GMap.addControl(B,A)},addMapType:function(A){this.GMap.addMapType(A)},addOverlay:function(A){this.GMap.addOverlay(A)},checkResize:function(){this.GMap.checkResize()},clearOverlays:function(){this.GMap.clearOverlays()},closeInfoWindow:function(){this.GMap.closeInfoWindow()},continuousZoomEnabled:function(){return this.GMap.continuousZoomEnabled()},disableContinuousZoom:function(){this.GMap.disableContinuousZoom()},disableDoubleClickZoom:function(){this.GMap.disableDoubleClickZoom()},disableDragging:function(){this.GMap.disableDragging()},disableGoogleBar:function(){this.GMap.disableGoogleBar()},disableInfoWindow:function(){this.GMap.disableInfoWindow()},disableScrollWheelZoom:function(){this.GMap.disableScrollWheelZoom()},doubleClickZoomEnabled:function(){return this.GMap.doubleClickZoomEnabled()},draggingEnabled:function(){return this.GMap.draggingEnabled()},enableContinuousZoom:function(){this.GMap.enableContinuousZoom()},enableDoubleClickZoom:function(){this.GMap.enableDoubleClickZoom()},enableDragging:function(){this.GMap.enableDragging()},enableGoogleBar:function(){this.GMap.enableGoogleBar()},enableInfoWindow:function(){this.GMap.enableInfoWindow()},enableScrollWheelZoom:function(){this.GMap.enableScrollWheelZoom()},fromContainerPixelToLatLng:function(A){return this.GMap.fromContainerPixelToLatLng(A)},fromDivPixelToLatLng:function(A){return this.GMap.fromDivPixelToLatLng(A)},fromLatLngToDivPixel:function(A){return this.GMap.fromLatLngToDivPixel(A)},getBounds:function(){return this.GMap.getBounds()},getBoundsZoomLevel:function(){return this.GMap.getBoundsZoomLevel()},getCenter:function(){return this.GMap.getCenter()},getContainer:function(){return this.GMap.getContainer()},getCurrentMapType:function(){return this.GMap.getCurrentMapType()},getDragObject:function(){return this.GMap.getDragObject()},getInfoWindow:function(){return this.GMap.getInfoWindow()},getMapTypes:function(){return this.GMap.getMapTypes()},getCurrentMapType:function(){return this.GMap.getCurrentMapType()},getPane:function(A){return this.GMap.getPane()},getSize:function(){return this.GMap.getSize()},getZoom:function(){return this.GMap.getZoom()},infoWindowEnabled:function(){return this.GMap.infoWindowEnabled()},isLoaded:function(){return this.GMap.isLoaded()},openInfoWindow:function(A,C,B){this.GMap.openInfoWindow(A,C,B)},openInfoWindowHtml:function(A,B,C){this.GMap.openInfoWindowHtml(A,B,C)},panBy:function(A){this.GMap.panBy(A)},panDirection:function(B,A){this.GMap.panDirection(B,A)},panTo:function(A){this.GMap.panTo(A)},removeControl:function(A){this.GMap.removeControl(A)},removeMapType:function(A){this.GMap.removeMapType()},removeOverlay:function(A){this.GMap.removeOverlay(A)},returnToSavedPosition:function(){this.GMap.returnToSavedPosition()},savePosition:function(){this.GMap.savePosition()},scrollWheelZoomEnabled:function(){return this.GMap.scrollWheelZoomEnabled()},setCenter:function(A,C,B){this.GMap.setCenter(A,C,B)},setMapType:function(A){this.GMap.setMapType(A)},setZoom:function(A){this.GMap.setZoom(A)},zoomIn:function(){this.GMap.zoomIn()},zoomOut:function(){this.GMap.zoomOut()},loadAdresses:function(A){this.load(new GLatLng(this.Addresses[A].Position.Latitude,this.Addresses[A].Position.Longitude));this.hidePopup()},hidePopup:function(){document.getElementById("popup").style.visibility="hidden";document.getElementById("contenuPopup").style.visibility="hidden"}};var icon=new GIcon(G_DEFAULT_ICON);var imgMark='WebResource.axd?d=3FRsNW5KoJj4WhnirhOE5saVD2WzhQ1zWQWNh5O0p_tHHGnvOfIjWe2PvB1k1HPY_FHxzVf6xJB8ZzIQ-GDrjA2&t=633494081241406250';var imgMark_hover='WebResource.axd?d=3FRsNW5KoJj4WhnirhOE5saVD2WzhQ1zWQWNh5O0p_tHHGnvOfIjWe2PvB1k1HPYtkBAwqf8t3CsiqExUQE4qw2&t=633494081241406250';icon.image=imgMark;icon.iconSize=new GSize(11,11);icon.shadowSize=new GSize(0,0);icon.iconAnchor=new GPoint(6,6);icon.maxHeight=0;icon.dragCrossSize=new GSize(0,0);var markers=[];var points=[];var poly=[];var polygon;var polygonIsDrawing=false;function itStartPolygon(){polygonIsDrawing=true}function itDrawPolygon(A){var C=ctl00_phContent_GoogleMap1_Map;if(C.Markers){poly.length=0;for(var B=0;B<C.Markers.length;B++){poly.push(C.Markers[B].getPoint())}if(polygon){C.removeOverlay(polygon)}if(polygonIsDrawing){poly.push(new GLatLng(A.lat(),A.lng()));polygon=new GPolygon(poly,"#FF0000",3,1,"#FF0000",0.1,{clickable:false})}else{poly.push(C.Markers[0].getPoint());polygon=new GPolygon(poly,"#003dc9",3,1,"#003dc9",0.5,{clickable:false})}C.addOverlay(polygon)}}function itAddBoundPolygon(B,A){var C=ctl00_phContent_GoogleMap1_Map;if(polygonIsDrawing&&!B){var D=points.length;points.push(A);C.addMarker({Latitude:points[D].lat(),Longitude:points[D].lng(),Draggable:true,Clickable:false,Icon:icon,GoogleEvents:{ClientEvents:[{Key:"mouseover",Handler:'instance.setImage("'+imgMark+'");'},{Key:"mouseout",Handler:'instance.setImage("'+imgMark_hover+'");'}]}});C.Markers[C.Markers.length-1].load(points[D])}}function itClosePolygon(B,A){polygonIsDrawing=false;itDrawPolygon(A)};

if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();