﻿Function.Delegate={call:function(a,b){Function.Delegate.create(a,b).call(a,arguments)},callFromString:function(a,b){Function.Delegate.createFromString(a,b).call(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.Delegate.create(instance,method)}}};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,MapMakerNormal:11,MapMakerHybrid:12,convert:function(a){switch(a){case G_SATELLITE_MAP:return Artem.Web.GoogleMapView.Satellite;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;case G_SATELLITE_3D_MAP:return Artem.Web.GoogleMapView.Satellite3D;case G_MAPMAKER_NORMAL_MAP:return Artem.Web.GoogleMapView.MapMakerNormal;case G_MAPMAKER_HYBRID_MAP:return Artem.Web.GoogleMapView.MapMakerHybrid;default:return Artem.Web.GoogleMapView.Normal}}};Artem.Web.OpenInfoBehaviour={Click:0,DoubleClick:1,MouseDown:2,MouseOut:3,MouseOver:4,MouseUp:5};Artem.Web.GoogleManager={CurrentMap:null,Disposed:false,Initialized:false,Saved:false,Maps:[],addMap:function(c){var a=this;for(var b=0;b<a.Maps.length;b++)if(c.ClientID==a.Maps[b].ClientID)return;a.Maps[a.Maps.length]=a.CurrentMap=c},dispose:function(){if(typeof Sys!="undefined"){var a=Sys.WebForms.PageRequestManager.getInstance();!a.get_isInAsyncPostBack()&&GUnload()}else GUnload()},initialize:function(){var a=this;if(!a.Initialized){a.Initialized=true;a.Saved=false;if(!GBrowserIsCompatible())throw"Your browser is not google maps api compatible!";var b=Function.Delegate.create(a,a.dispose);if(typeof Sys!="undefined"){var c=Sys.WebForms.PageRequestManager.getInstance();c.add_beginRequest(b)}Function.Handler.add(window,"unload",b)}},save:function(){try{for(var a=0;a<this.Maps.length;a++)try{this.Maps[a].save()}catch(b){}}catch(c){}},__type:"Artem.Web.GoogleManager"};Artem.Web.GoogleBounds=function(a){this._init(a)};Artem.Web.GoogleBounds.prototype={GBounds:null,_init:function(a){this.GBounds=a},save:function(){var b=',"Longitude":',a="{";if(this.GBounds){var d=this.GBounds.getSouthWest(),c=this.GBounds.getNorthEast();a+='"SouthWest":{"Latitude":'+d.lat()+b+d.lng()+"},";a+='"NorthEast":{"Latitude":'+c.lat()+b+c.lng()+"}"}a+="}";return a},__type:"Artem.Web.GoogleBounds"};Artem.Web.GoogleDirection=function(b,a){this._init(b,a)};Artem.Web.GoogleDirection.prototype={GDirections:null,Locale:null,Query:null,PreserveViewport:null,RoutePanelId:null,_init:function(d,b){var a=this;a.Locale=b.Locale;a.Query=b.Query;a.RoutePanelId=b.RoutePanelId;a.PreserveViewport=b.PreserveViewport;var c=null;if(a.RoutePanelId)c=document.getElementById(a.RoutePanelId);a.GDirections=new GDirections(d.GMap,c)},loadDefault:function(){var a=this,b;if(a.Locale&&a.PreserveViewport)b={locale:a.Locale,preserveViewport:a.PreserveViewport};else if(a.Locale)b={locale:a.Locale};else if(a.PreserveViewport)b={preserveViewport:a.PreserveViewport};a.load(a.Query,b)},save:function(){var d=',"Html":"',c='",',b=this,a="{";a+='"Locale":"'+b.Locale+c;a+='"Query":"'+b.Query+c;a+='"RoutePanelId":"'+b.RoutePanelId+c;a+='"PreserveViewport":"'+b.PreserveViewport+c;var e=b.getDistance();a+='"Distance":{"Meters":'+e.meters+d+e.html+'"},';var f=b.getDuration();a+='"Duration":{"Seconds":'+f.seconds+d+f.html+'"},';var g=new Artem.Web.GoogleBounds(b.getBounds());a+='"Bounds":';a+=g.save();a+="}";return a},clear:function(){this.GDirections.clear()},getBounds:function(){return this.GDirections.getBounds()},getCopyrightsHtml:function(){return this.GDirections.getCopyrightsHtml()},getDistance:function(){return this.GDirections.getDistance()},getDuration:function(){return this.GDirections.getDuration()},getGeocode:function(a){return this.GDirections.getGeocode(a)},getMarker:function(a){return this.GDirections.getMarker(a)},getNumGeocodes:function(){return this.GDirections.getNumGeocodes()},getNumRoutes:function(){return this.GDirections.getNumRoutes()},getPolyline:function(){return this.GDirections.getPolyline()},getRoute:function(a){return this.GDirections.getRoute(a)},getSummaryHtml:function(){return this.GDirections.getSummaryHtml()},getStatus:function(){return this.GDirections.getStatus()},load:function(b,a){this.GDirections.load(b,a)},loadFromWaypoints:function(a,b){this.GDirections.loadFromWaypoints(a,b)},__type:"Artem.Web.GoogleDirection"};Artem.Web.GooglePolygon=function(c,b,a){this._init(c,b,a)};Artem.Web.GooglePolygon.prototype={GPolygon:null,Map:null,Index:null,Clickable:null,EnableDrawing:null,EnableEditing:null,FillColor:null,FillOpacity:null,Points:null,StrokeColor:null,StrokeOpacity:null,StrokeWeight:null,ClientEvents:null,ServerEvents:null,_init:function(c,g,b){var a=this;a.Map=c;a.Index=g;a.Clickable=b.Clickable;a.EnableDrawing=b.EnableDrawing;a.EnableEditing=b.EnableEditing;a.FillColor=b.FillColor;a.FillOpacity=b.FillOpacity;a.Points=b.Points;a.StrokeColor=b.StrokeColor;a.StrokeOpacity=b.StrokeOpacity;a.StrokeWeight=b.StrokeWeight;var f=[],e={};if(a.Points)for(var d=0;d<a.Points.length;d++)f.push(new GLatLng(a.Points[d].Latitude,a.Points[d].Longitude));e.clickable=a.Clickable;a.GPolygon=new GPolygon(f,a.StrokeColor,a.StrokeWeight,a.StrokeOpacity,a.FillColor,a.FillOpacity,e);a.EnableDrawing&&a.enableDrawing();a.EnableEditing&&a.enableEditing();if(c.PolygonEvents){a.ClientEvents=c.PolygonEvents.ClientEvents;a.ServerEvents=c.PolygonEvents.ServerEvents}a.attachEvents(a.ClientEvents,true);a.attachEvents(a.ServerEvents,false)},attachEvents:function(a,f){var b=this;if(a)for(var d,c=0;c<a.length;c++){d=a[c].Key;if(f)GEvent.addListener(b.GPolygon,d,Function.Delegate.createFromString(b,a[c].Handler));else{var g=a[c].Handler,e=Function.Delegate.create(b,b.raiseEvent);GEvent.addListener(b.GPolygon,d,function(a){e.call(this,g,a)})}}},raiseEvent:function(handler,args){this.Map.save();handler=handler.replace("INDEX",this.Index);handler=handler.replace("ARGS",args);eval(handler)},save:function(){var b=this,a="{";a+='"Clickable":'+b.Clickable+",";a+='"FillColor":"'+b.FillColor+'",';a+='"FillOpacity":'+b.FillOpacity+",";a+='"StrokeColor":"'+b.StrokeColor+'",';a+='"StrokeOpacity":'+b.StrokeOpacity+",";a+='"StrokeWeight":'+b.StrokeWeight+",";if(b.Points){a+='"Points":[';for(var c,d=0;d<b.Points.length;d++){c=b.Points[d];a+='{"Latitude":'+c.Latitude+',"Longitude":'+c.Longitude+"},"}a=a.substr(0,a.length-1);a+="],"}var e=new Artem.Web.GoogleBounds(b.getBounds());a+='"Bounds":';a+=e.save();a+="}";return a},deleteVertex:function(a){this.GPolygon.deleteVertex(a)},disableEditing:function(){this.GPolygon.disableEditing()},enableDrawing:function(a){this.GPolygon.enableDrawing(a)},enableEditing:function(a){this.GPolygon.enableEditing(a)},getArea:function(){return this.GPolygon.getArea()},getBounds:function(){return this.GPolygon.getBounds()},getVertex:function(){return this.GPolygon.getVertex()},getVertexCount:function(){return this.GPolygon.getVertexCount()},hide:function(){this.GPolygon.hide()},insertVertex:function(){this.GPolygon.insertVertex()},isHidden:function(){return this.GPolygon.isHidden()},show:function(){this.GPolygon.show()},supportsHide:function(){return this.GPolygon.supportsHide()},setFillStyle:function(a){this.GPolygon.setFillStyle(a)},setStrokeStyle:function(a){this.GPolygon.setStrokeStyle(a)},__type:"Artem.Web.GooglePolygon"};Artem.Web.GooglePolyline=function(c,b,a){this._init(c,b,a)};Artem.Web.GooglePolyline.prototype={GPolyline:null,Map:null,Index:null,Clickable:null,Color:null,Geodesic:null,Opacity:null,Points:null,Weight:null,ClientEvents:null,ServerEvents:null,_init:function(c,g,b){var a=this;a.Map=c;a.Index=g;a.Clickable=b.Clickable;a.Color=b.Color;a.Geodesic=b.Geodesic;a.Opacity=b.Opacity;a.Points=b.Points;a.Weight=b.Weight;var f=[],e={};if(a.Points)for(var d=0;d<a.Points.length;d++)f.push(new GLatLng(a.Points[d].Latitude,a.Points[d].Longitude));e.clickable=a.Clickable;e.geodesic=a.Geodesic;a.GPolyline=new GPolyline(f,a.Color,a.Weight,a.Opacity,e);if(c.PolylineEvents){a.ClientEvents=c.PolylineEvents.ClientEvents;a.ServerEvents=c.PolylineEvents.ServerEvents}a.attachEvents(a.ClientEvents,true);a.attachEvents(a.ServerEvents,false)},attachEvents:function(a,f){var b=this;if(a)for(var d=a[c].Key,c=0;c<a.length;c++)if(f)GEvent.addListener(b.GPolyline,d,Function.Delegate.createFromString(b,a[c].Handler));else{var g=a[c].Handler,e=Function.Delegate.create(b,b.raiseEvent);GEvent.addListener(b.GPolyline,d,function(a){e.call(this,g,a)})}},raiseEvent:function(handler,args){this.Map.save();if(handler){handler=handler.replace("INDEX",this.Index);if(args)handler=handler.replace("ARGS",args);eval(handler)}},save:function(){var b=this,a="{";a+='"Clickable":'+b.Clickable+",";a+='"Color":"'+b.Color+'",';a+='"Geodesic":'+b.Geodesic+",";a+='"Opacity":'+b.Opacity+",";a+='"Weight":'+b.Weight+",";if(b.Points){a+='"Points":[';for(var c,d=0;d<b.Points.length;d++){c=b.Points[d];a+='{"Latitude":'+c.Latitude+',"Longitude":'+c.Longitude+"},"}a=a.substr(0,a.length-1);a+="],"}var e=new Artem.Web.GoogleBounds(b.getBounds());a+='"Bounds":';a+=e.save();a+="}";return a},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()},__type:"Artem.Web.GooglePolyline"};Artem.Web.GoogleMarker=function(c,b,a){this._init(c,b,a)};Artem.Web.GoogleMarker.prototype={GMarker:null,Map:null,Index:null,Address:null,AutoPan:null,Bouncy:null,Clickable:null,Draggable:null,DragCrossMove:null,IconAnchor:null,IconSize:null,IconUrl:null,InfoWindowAnchor:null,Latitude:null,Longitude:null,MaxZoom:null,MinZoom:null,OpenInfoBehaviour:null,OpenWindowContent:null,ShadowSize:null,ShadowUrl:null,Text:null,Title:null,ClientEvents:null,ServerEvents:null,_init:function(c,d,b){var a=this;a.Map=c;a.Index=d;a.Address=b.Address;a.AutoPan=b.AutoPan;a.Bouncy=b.Bouncy;a.Clickable=b.Clickable;a.Draggable=b.Draggable;a.DragCrossMove=b.DragCrossMove;a.IconAnchor=b.IconAnchor;a.IconSize=b.IconSize;a.IconUrl=b.IconUrl;a.InfoWindowAnchor=b.InfoWindowAnchor;a.Latitude=b.Latitude;a.Longitude=b.Longitude;a.MaxZoom=b.MaxZoom;a.MinZoom=b.MinZoom;a.OpenInfoBehaviour=b.OpenInfoBehaviour;a.ShadowSize=b.ShadowSize;a.ShadowUrl=b.ShadowUrl;a.Text=b.Text;a.Title=b.Title;if(c.MarkerEvents){a.ClientEvents=c.MarkerEvents.ClientEvents;a.ServerEvents=c.MarkerEvents.ServerEvents}},attachEvents:function(a,f){var b=this;if(a)for(var c=0;c<a.length;c++){var d=a[c].Key;if(f)GEvent.addListener(b.GMarker,d,Function.Delegate.createFromString(b,a[c].Handler));else{var g=a[c].Handler,e=Function.Delegate.create(b,b.raiseEvent);GEvent.addListener(b.GMarker,d,function(a){e.call(this,g,a)})}}},initialize:function(){var b=this,a;switch(b.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"}a&&GEvent.addListener(b.GMarker,a,Function.Delegate.create(b,b.openDefaultInfoWindow));b.attachEvents(b.ClientEvents,true);b.attachEvents(b.ServerEvents,false)},isLoaded:function(){return this.GMarker!=null},load:function(c){var a=this;if(c){a.Latitude=c.lat();a.Longitude=c.lng();var b={};b.autoPan=a.AutoPan;b.bouncy=a.Bouncy;b.clickable=a.Clickable;b.draggable=a.Draggable;b.dragCrossMove=a.DragCrossMove;b.title=a.Title;b.icon=a.createIcon();a.GMarker=new GMarker(c,b);a.Map.addOverlay(a.GMarker);a.initialize()}},raiseEvent:function(handler,args){this.Map.save();if(handler){handler=handler.replace("INDEX",this.Index);if(args)handler=handler.replace("ARGS",args);eval(handler)}},save:function(){var i='"Longitude":',h='"Latitude":',g=",Height:",e="},",c=",",d='",',a=this,b="{";b+='"Address":"'+a.Address+d;b+='"AutoPan":'+a.AutoPan+c;b+='"Bouncy":'+a.Bouncy+c;b+='"Clickable":'+a.Clickable+c;b+='"Draggable":'+a.Draggable+c;b+='"DragCrossMove":'+a.DragCrossMove+c;if(a.IconAnchor)b+='"IconAnchor":{X:'+a.IconAnchor.X+",Y:"+a.IconAnchor.Y+e;if(a.IconSize)b+='"IconSize":{Width:'+a.IconSize.Width+g+a.IconSize.Height+e;b+='"IconUrl":"'+a.IconUrl+d;if(a.InfoWindowAnchor)b+='"InfoWindowAnchor":{X:'+a.InfoWindowAnchor.X+",Y:"+a.InfoWindowAnchor.Y+e;var f=a.getLatLng();if(f){b+=h+f.lat()+c;b+=i+f.lng()+c}else{b+=h+a.Latitude+c;b+=i+a.Longitude+c}b+='"OpenInfoBehaviour":'+a.OpenInfoBehaviour+c;if(a.ShadowSize)b+='"ShadowSize":{Width:'+a.ShadowSize.Width+g+a.ShadowSize.Height+e;b+='"ShadowUrl":"'+a.ShadowUrl+d;b+='"Title":"'+a.Title+d;b+="}";return b},closeInfoWindow:function(){this.isLoaded()&&this.GMarker.closeInfoWindow()},createIcon:function(){var a=this,b=null;if(a.IconUrl){b=new GIcon;b.image=a.IconUrl;if(a.IconSize)b.iconSize=new GSize(a.IconSize.Width,a.IconSize.Height);if(a.IconAnchor)b.iconAnchor=new GPoint(a.IconAnchor.X,a.IconAnchor.Y);if(a.InfoWindowAnchor)b.infoWindowAnchor=new GPoint(a.InfoWindowAnchor.X,a.InfoWindowAnchor.Y);if(a.ShadowUrl)b.shadow=a.ShadowUrl;if(a.ShadowSize)b.shadowSize=new GSize(a.ShadowSize.Width,a.ShadowSize.Height)}return b},disableDragging:function(){this.isLoaded()&&this.GMarker.disableDragging()},draggable:function(){if(this.isLoaded())return this.GMarker.draggable()},draggingEnabled:function(){if(this.isLoaded())return this.GMarker.draggingEnabled()},enableDragging:function(){this.isLoaded()&&this.GMarker.enableDragging()},getIcon:function(){if(this.isLoaded())return this.GMarker.getIcon()},getLatLng:function(){if(this.isLoaded())return this.GMarker.getLatLng()},getPoint:function(){if(this.isLoaded())return this.GMarker.getPoint()},getTitle:function(){if(this.isLoaded())return this.GMarker.getTitle()},hide:function(){this.isLoaded()&&this.GMarker.hide()},isHidden:function(){if(this.isLoaded())return this.GMarker.isHidden()},openDefaultInfoWindow:function(){var a=this;if(a.isLoaded())if(a.OpenWindowContent){var b=document.getElementById(a.OpenWindowContent);a.openInfoWindow(b.cloneNode(true))}else a.openInfoWindowHtml(a.Text)},openInfoWindow:function(a){this.isLoaded()&&this.GMarker.openInfoWindow(a)},openInfoWindowHtml:function(a){this.isLoaded()&&this.GMarker.openInfoWindowHtml(a)},setImage:function(a){this.isLoaded()&&this.GMarker.setImage(a)},setLatLng:function(a){this.isLoaded()&&this.GMarker.setLatLng(a)},setPoint:function(a){this.isLoaded()&&this.GMarker.setPoint(a)},show:function(){this.isLoaded()&&this.GMarker.show()},__type:"Artem.Web.GoogleMarker"};Artem.Web.GoogleMap=function(a){this._init(a)};Artem.Web.GoogleMap.prototype={Address:null,AddressNotFound:false,BaseCountryCode:null,DefaultAddress:null,DefaultMapView:null,ClientID:null,ClientMapID:null,IsGeolocation:false,IsStatic:null,IsStreetView:null,EnterpriseKey:null,Key:null,Latitude:null,Longitude:null,MarkerManagerOptions:null,ShowMapTypeControl:null,ShowScaleControl:null,ShowTraffic:null,StreetViewMode:null,StreetViewPanoID:null,Zoom:null,ZoomPanType:null,EnableContinuousZoom:null,EnableDoubleClickZoom:null,EnableDragging:null,EnableGoogleBar:null,EnableInfoWindow:null,EnableMarkerManager:null,EnableReverseGeocoding:null,EnableScrollWheelZoom:null,IsLoaded:false,ClientEvents:null,ServerEvents:null,MarkerEvents:null,PolygonEvents:null,PolylineEvents:null,ClentAddressNotFoundIndex:null,ServerAddressNotFoundIndex:null,ClientGeoLoadedIndex:null,ServerGeoLoadedIndex:null,ClientLocationLoadedIndex:null,ServerLocationLoadedIndex:null,Actions:null,Directions:null,Markers:[],Polygons:null,Polylines:null,GMap:null,GMapPano:null,MarkerManager:null,Geocoder:null,_init:function(b){var a=this;a.Address=b.Address;a.BaseCountryCode=b.BaseCountryCode;a.DefaultAddress=b.DefaultAddress;a.DefaultMapView=b.DefaultMapView;a.ClientID=b.ClientID;a.ClientMapID=b.ClientMapID;a.IsStatic=b.IsStatic;a.IsStreetView=b.IsStreetView;a.EnterpriseKey=b.EnterpriseKey;a.Key=b.Key;a.Latitude=b.Latitude;a.Longitude=b.Longitude;a.MarkerManagerOptions=b.MarkerManagerOptions;a.ShowMapTypeControl=b.ShowMapTypeControl;a.ShowScaleControl=b.ShowScaleControl;a.ShowTraffic=b.ShowTraffic;a.StreetViewMode=b.StreetViewMode;a.StreetViewPanoID=b.StreetViewPanoID;a.Zoom=b.Zoom;a.ZoomPanType=b.ZoomPanType;a.EnableContinuousZoom=b.EnableContinuousZoom;a.EnableDoubleClickZoom=b.EnableDoubleClickZoom;a.EnableDragging=b.EnableDragging;a.EnableGoogleBar=b.EnableGoogleBar;a.EnableInfoWindow=b.EnableInfoWindow;a.EnableMarkerManager=b.EnableMarkerManager;a.EnableReverseGeocoding=b.EnableReverseGeocoding;a.EnableScrollWheelZoom=b.EnableScrollWheelZoom;if(b.MapEvents){a.ClientEvents=b.MapEvents.ClientEvents;a.ServerEvents=b.MapEvents.ServerEvents}a.MarkerEvents=b.MarkerEvents;a.PolygonEvents=b.PolygonEvents;a.PolylineEvents=b.PolylineEvents;a.Geocoder=new GClientGeocoder;b.BaseCountryCode&&a.Geocoder.setBaseCountryCode(b.BaseCountryCode);Artem.Web.GoogleManager.initialize();Artem.Web.GoogleManager.addMap(a);if(!a.IsStatic&&!(a.IsStreetView&&a.StreetViewMode==0)){var c;if(a.Width&&a.Height)c={size:new GSize(a.Width,a.Height)};a.GMap=new GMap2(a.getElement(),c);a.attachEvents(a.ClientEvents,true);a.attachEvents(a.ServerEvents,false)}},_renderMarkerManager:function(){var a=this;if(a.EnableMarkerManager){for(var b,c=0;c<a.Markers.length;c++){b=a.Markers[c];a.MarkerManager.addMarker(b.GMarker,b.MinZoom,b.MaxZoom)}a.MarkerManager.refresh()}},addAction:function(a){if(!this.Actions)this.Actions=[];this.Actions.push(a)},addDirection:function(c,d){var a=this;if(!a.Directions)a.Directions=[];var b=new Artem.Web.GoogleDirection(a,c);a.Directions.push(b);d&&a.renderDirection(b)},addMarker:function(c,d){var a=this,b=new Artem.Web.GoogleMarker(a,a.Markers.length,c);a.Markers.push(b);d&&a.renderMarker(b)},addPolygon:function(c,d){var a=this;if(!a.Polygons)a.Polygons=[];var b=new Artem.Web.GooglePolygon(a,a.Polygons.length,c);a.Polygons.push(b);d&&a.renderPolygon(b)},addPolyline:function(c,d){var a=this;if(!a.Polylines)a.Polylines=[];var b=new Artem.Web.GooglePolyline(a,a.Polylines.length,c);a.Polylines.push(b);d&&a.renderPolyline(b)},attachEvents:function(d,e){var g="locationloaded",f="addressnotfound",a=this;if(d)for(var c,b=0;b<d.length;b++){c=d[b].Key;if(c!="geoload"&&c!=f&&c!=g)if(e)GEvent.addListener(a.GMap,c,Function.Delegate.createFromString(a,d[b].Handler));else{var i=d[b].Handler,h=Function.Delegate.create(a,a.raiseEvent);GEvent.addListener(a.GMap,c,function(b,a){h.call(this,i,a)})}else if(c==g)if(e)a.ClientLocationLoadedIndex=b;else a.ServerLocationLoadedIndex=b;else if(c==f)if(e)a.ClientAddressNotFoundIndex=b;else a.ServerAddressNotFoundIndex=b;else if(e)a.ClientGeoLoadedIndex=b;else a.ServerGeoLoadedIndex=b}},clearActions:function(){if(this.Actions)this.Actions=[]},clearDirections:function(){if(this.Directions)this.Directions=[]},clearMarkers:function(){var a=this;if(a.Markers){for(var c=a.Markers.length,b=0;b<c;b++)a.GMap.removeOverlay(a.Markers[b].GMarker);a.Markers=[]}},clearPolygons:function(){if(this.Polygons)this.Polygons=[]},clearPolylines:function(){if(this.Polylines)this.Polylines=[]},getElement:function(){return document.getElementById(this.ClientID)},initialize:function(){var a=this;a.EnableContinuousZoom?a.enableContinuousZoom():a.disableContinuousZoom();a.EnableDoubleClickZoom?a.enableDoubleClickZoom():a.disableDoubleClickZoom();a.EnableDragging?a.enableDragging():a.disableDragging();a.EnableGoogleBar?a.enableGoogleBar():a.disableGoogleBar();a.EnableInfoWindow?a.enableInfoWindow():a.disableInfoWindow();a.EnableScrollWheelZoom?a.enableScrollWheelZoom():a.disableScrollWheelZoom();switch(a.ZoomPanType){case 1:a.GMap.addControl(new GLargeMapControl);break;case 2:a.GMap.addControl(new GSmallZoomControl);break;case 3:a.GMap.addControl(new GSmallZoomControl3D);break;case 4:a.GMap.addControl(new GLargeMapControl3D);break;default:a.GMap.addControl(new GSmallMapControl)}a.ShowMapTypeControl&&a.GMap.addControl(new GMapTypeControl);a.ShowScaleControl&&a.GMap.addControl(new GScaleControl);a.ShowTraffic&&a.GMap.addOverlay(new GTrafficOverlay);if(a.EnableMarkerManager)a.MarkerManager=new MarkerManager(a.GMap,a.MarkerManagerOptions);a.setMapView();if(a.IsStreetView&&a.StreetViewMode==1){var b=a.StreetViewPanoID||a.ClientID+"_Pano";a.GMapPano=new GStreetviewPanorama(document.getElementById(b));a.GMap.addOverlay(new GStreetviewOverlay);GEvent.addListener(a.GMap,"click",Function.Delegate.create(a,a.setStreetView))}},load:function(c){var d=null,a=this;if(c){if(!a.IsStatic&&!(a.IsStreetView&&a.StreetViewMode==0)){a.Latitude=c.lat();a.Longitude=c.lng();a.setCenter(c,a.Zoom);if(a.IsGeolocation){a.IsGeolocation=false;a.ClientGeoLoadedIndex!=d&&Function.Delegate.callFromString(a,a.ClientEvents[a.ClientGeoLoadedIndex].Handler);if(a.ServerGeoLoadedIndex!=d){var b=a.ServerEvents[a.ServerGeoLoadedIndex].Handler;b=b.replace("ARGS",a.Address);Function.Delegate.callFromString(a,b)}}if(a.EnableReverseGeocoding&&!a.Address){var e=Function.Delegate.create(a,a.setAddress);a.Geocoder.getLocations(c,e)}a.initialize();a.render();a.checkResize()}else if(a.IsStreetView)a.loadStreetView(c);else a.loadStatic();a.IsLoaded=true}else if(a.Latitude!=0&&a.Longitude!=0)a.load(new GLatLng(a.Latitude,a.Longitude));else if(!a.IsGeolocation){a.IsGeolocation=true;a.Geocoder.getLatLng(a.Address,Function.Delegate.create(a,a.load))}else if(!a.AddressNotFound){a.ClientAddressNotFoundIndex!=d&&Function.Delegate.callFromString(a,a.ClientEvents[a.ClientAddressNotFoundIndex].Handler);if(a.ServerAddressNotFoundIndex!=d){var b=a.ServerEvents[a.ServerAddressNotFoundIndex].Handler;b=b.replace("ARGS",a.Address);Function.Delegate.callFromString(a,b)}a.AddressNotFound=true;if(a.DefaultAddress){a.Address=a.DefaultAddress;a.Geocoder.getLatLng(a.Address,Function.Delegate.create(a,a.load))}}},loadAddress:function(b){var a=this;a.Address=b;a.IsGeolocation=true;a.Geocoder.getLatLng(a.Address,Function.Delegate.create(a,a.load))},loadStatic:function(){var a=this,g=a.getElement(),e=512;if(a.Didth&&a.Width<512)e=a.Width;var d=512;if(a.Height&&a.Height<512)d=a.Height;var b="http://maps.google.com/staticmap?";b+="center="+a.Latitude+","+a.Longitude+"&";b+="zoom="+a.Zoom+"&";b+="size="+e+"x"+d+"&";if(a.EnterpriseKey)b+="enterpriseKey="+a.EnterpriseKey+"&";b+="key="+a.Key;if(a.Markers){var c;b+="&markers=";for(c=0;c<a.Markers.length;c++)b+=a.Markers[c].Latitude+","+a.Markers[c].Longitude+"|"}var f=document.createElement("img");f.src=b;g.appendChild(f)},loadStreetView:function(a){this.GMap=new GStreetviewPanorama(this.getElement(),{latlng:a});this.GMap.checkResize()},raiseEvent:function(handler,args){if(this.IsLoaded){this.save();if(handler){if(args)handler=handler.replace("ARGS",args);eval(handler)}}},render:function(){var a=this;if(a.Markers){for(var c=new Artem.Web.Geoloader(a.Geocoder,Function.Delegate.create(a,a._renderMarkerManager)),b=0;b<a.Markers.length;b++)!a.renderMarker(a.Markers[b])&&c.addMarker(a.Markers[b]);c.load()}if(a.Directions)for(var b=0;b<a.Directions.length;b++)a.renderDirection(a.Directions[b]);if(a.Polylines)for(var b=0;b<a.Polylines.length;b++)a.renderPolyline(a.Polylines[b]);if(a.Polygons)for(var b=0;b<a.Polygons.length;b++)a.renderPolygon(a.Polygons[b]);if(a.Actions)for(var b=0;b<a.Actions.length;b++)Function.Delegate.callFromString(a,a.Actions[b])},renderDirection:function(a){a.loadDefault()},renderMarker:function(a){if(a.Latitude!=0&&a.Longitude!=0){try{a.load(new GLatLng(a.Latitude,a.Longitude))}catch(b){}return true}else return false},renderPolygon:function(a){this.addOverlay(a.GPolygon)},renderPolyline:function(a){this.addOverlay(a.GPolyline)},save:function(){var f=',"Longitude":',e=',"Latitude":',b=this,a="{";a+='"Address":"'+b.Address+'"';a+=',"BaseCountryCode":"'+b.BaseCountryCode+'"';a+=',"DefaultMapView":'+Artem.Web.GoogleMapView.convert(b.getCurrentMapType());a+=',"EnableGoogleBar":'+b.EnableGoogleBar;a+=',"EnableMarkerManager":'+b.EnableMarkerManager;a+=',"EnableScrollWheelZoom":'+b.EnableScrollWheelZoom;a+=',"IsStatic":'+b.IsStatic;var d=b.getCenter();if(d){a+=e+d.lat();a+=f+d.lng()}else{a+=e+b.Latitude;a+=f+b.Longitude}a+=',"ShowMapTypeControl":'+b.ShowMapTypeControl;a+=',"ShowTraffic":'+b.ShowTraffic;a+=',"Zoom":'+b.getZoom();a+=',"ZoomPanType":'+b.ZoomPanType;var g=new Artem.Web.GoogleBounds(b.getBounds());a+=',"Bounds":';a+=g.save();if(b.Markers){a+=',"Markers":[';for(var c=0;c<b.Markers.length;c++)if(b.Markers[c].isLoaded())a+=b.Markers[c].save();a+="]"}if(b.Directions){a+=',"Directions":[';for(var c=0;c<b.Directions.length;c++)a+=b.Directions[c].save();a+="]"}if(b.Polylines){a+=',"Polylines":[';for(var c=0;c<b.Polylines.length;c++)a+=b.Polylines[c].save();a+="]"}if(b.Polygons){a+=',"Polygons":[';for(var c=0;c<b.Polygons.length;c++)a+=b.Polygons[c].save();a+="]"}a+="}";var h=document.getElementById(b.ClientID+"_State");h.value=a},setAddress:function(c){var a=this;if(c.Status.code==200)try{a.Address=c.Placemark[0].address;a.save();if(a.ClientLocationLoadedIndex!=null){var d=Function.Delegate.createFromString(a,a.ClientEvents[a.ClientLocationLoadedIndex].Handler);d.call(a,a.Address)}if(a.ServerLocationLoadedIndex!=null){var b=a.ServerEvents[a.ServerLocationLoadedIndex].Handler;b=b.replace("ARGS",a.Address);Function.Delegate.callFromString(a,b)}}catch(e){}},setMapView:function(){var a=this;if(a.DefaultMapView)switch(a.DefaultMapView){case Artem.Web.GoogleMapView.Normal:a.GMap.setMapType(G_NORMAL_MAP);break;case Artem.Web.GoogleMapView.Satellite:a.GMap.setMapType(G_SATELLITE_MAP);break;case Artem.Web.GoogleMapView.Hybrid:a.GMap.setMapType(G_HYBRID_MAP);break;case Artem.Web.GoogleMapView.Physical:a.GMap.addMapType(G_PHYSICAL_MAP);a.GMap.setMapType(G_PHYSICAL_MAP);break;case Artem.Web.GoogleMapView.MoonElevation:a.GMap.addMapType(G_MOON_ELEVATION_MAP);a.GMap.setMapType(G_MOON_ELEVATION_MAP);break;case Artem.Web.GoogleMapView.MoonVisible:a.GMap.addMapType(G_MOON_VISIBLE_MAP);a.GMap.setMapType(G_MOON_VISIBLE_MAP);break;case Artem.Web.GoogleMapView.MarsElevation:a.GMap.addMapType(G_MARS_ELEVATION_MAP);a.GMap.setMapType(G_MARS_ELEVATION_MAP);break;case Artem.Web.GoogleMapView.MarsVisible:a.GMap.addMapType(G_MARS_VISIBLE_MAP);a.GMap.setMapType(G_MARS_VISIBLE_MAP);break;case Artem.Web.GoogleMapView.MarsInfrared:a.GMap.addMapType(G_MARS_INFRARED_MAP);a.GMap.setMapType(G_MARS_INFRARED_MAP);break;case Artem.Web.GoogleMapView.SkyVisible:a.GMap.addMapType(G_SKY_VISIBLE_MAP);a.GMap.setMapType(G_SKY_VISIBLE_MAP);break;case Artem.Web.GoogleMapView.Satellite3D:a.GMap.addMapType(G_SATELLITE_3D_MAP);a.GMap.setMapType(G_SATELLITE_3D_MAP);break;case Artem.Web.GoogleMapView.MapMakerNormal:a.GMap.addMapType(G_MAPMAKER_NORMAL_MAP);a.GMap.setMapType(G_MAPMAKER_NORMAL_MAP);break;case Artem.Web.GoogleMapView.MapMakerHybrid:a.GMap.addMapType(G_MAPMAKER_HYBRID_MAP);a.GMap.setMapType(G_MAPMAKER_HYBRID_MAP)}},setStreetView:function(b,a){this.GMapPano.setLocationAndPOV(a)},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()},getPane:function(){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,b,c){this.GMap.openInfoWindow(a,b,c)},openInfoWindowHtml:function(a,b,c){this.GMap.openInfoWindowHtml(a,b,c)},panBy:function(a){this.GMap.panBy(a)},panDirection:function(a,b){this.GMap.panDirection(a,b)},panTo:function(a){this.GMap.panTo(a)},removeControl:function(a){this.GMap.removeControl(a)},removeMapType:function(){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()},__type:"Artem.Web.GoogleMap"};Artem.Web.Geoloader=function(b,a){this._init(b,a)};Artem.Web.Geoloader.prototype={_callback:null,_count:0,_delegate:null,_geocoder:null,_index:0,_markers:[],_init:function(c,b){var a=this;a._callback=b;a._delegate=Function.Delegate.create(a,a.resolve);a._geocoder=c},addMarker:function(a){this._markers.push(a)},load:function(){var a=this;if(a._markers.length>0){a._index=a._markers.length-1;var b=a._markers[a._index];a._geocoder.getLatLng(b.Address,a._delegate)}else a._callback&&a._callback()},resolve:function(b){var a=this;if(b){a._markers[a._index].load(b);a._index--;if(a._index>=0){a._count=0;a._geocoder.getLatLng(a._markers[a._index].Address,a._delegate)}else a._callback&&a._callback()}else if(a._count<6){var c=a._count*100;a._count++;setTimeout(c,function(){});a._geocoder.getLatLng(a._markers[a._index].Address,a._delegate)}else if(a._index-->=0){a._count=0;a._geocoder.getLatLng(a._markers[a._index].Address,a._delegate)}},__type:"Artem.Web.Geoloader"};Function.Handler={cache:{}};if(typeof Sys=="undefined"){Function.Delegate.create=function(a,b){return function(){return b.apply(a,arguments)}};Function.Handler.add=function(a,d,c){var b;if(a.addEventListener){b=function(b){return c.call(a,b)};a.addEventListener(d,b,false)}else if(a.attachEvent){b=function(){var b={};try{b=window.event}catch(d){}return c.call(a,b)};a.attachEvent("on"+d,b)}Function.Handler.cache[Function.Handler.cache.length]={handler:c,browserHandler:b}};Function.Handler.remove=function(c,e,f){for(var b=null,d=Function.Handler.cache,a=0,g=d.length;a<g;a++)if(d[a].handler===f){b=d[a].browserHandler;break}if(b){if(c.removeEventListener)c.removeEventListener(e,b,false);else c.detachEvent&&c.detachEvent("on"+e,b);d.splice(a,1)}}}else{Function.Delegate.create=Function.createDelegate;Function.Handler.add=$addHandler;Function.Handler.remove=$removeHandler}typeof Sys!=="undefined"&&Sys.Application.notifyScriptLoaded()
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();