function CMapWrapper(c,d){this.initMap=function(){this.map.enableContinuousZoom();var l=this.map.getMapTypes();for(var i=0;i<l.length;i++){l[i].getMinimumResolution=function(){return 2;};}};this.setCenter=function(l,m,n){if(m===undefined)this.map.setCenter(l);else if(n===undefined)this.map.setCenter(l,m);else this.map.setCenter(l,m,this.map.getMapTypes()[n]);};this.getCenter=function(){return this.map.getCenter();};this.getZoom=function(){return this.map.getZoom();};this.setZoom=function(l){return this.map.setZoom(l);};this.setMapType=function(l){if(l===0)this.map.setMapType(G_NORMAL_MAP);else if(l==1)this.map.setMapType(G_SATELLITE_MAP);else if(l==2)this.map.setMapType(G_HYBRID_MAP);};this.setBounds=function(l){this.map.setBounds(l);};this.PixelToLatLng=function(l){var m=this.map.fromContainerPixelToLatLng(l);return m;};this.LatLngToPixel=function(l){return this.map.fromLatLngToContainerPixel(l);};this.enableScrollWheelZoom=function(){this.map.enableScrollWheelZoom();};this.disableScrollWheelZoom=function(){this.map.disableScrollWheelZoom();};this.checkResize=function(){this.map.checkResize();if(!IsEmpty(this.streetView))this.streetView.checkResize();};this.clearOverlays=function(){this.map.clearOverlays();};this.addOverlay=function(l){this.map.addOverlay(l);return l;};this.removeOverlay=function(l){if(l)this.map.removeOverlay(l);};this.newLatLng=function(l,m){return new GLatLng(l,m);};this.getLat=function(l){return l.lat();};this.getLng=function(l){return l.lng();};this.newMarker=function(l,m){return new GMarker(l,m);};this.newLabeledMarker=function(l,m){var n=m.labelOffset;m.labelOffset=new GSize(n[0],n[1]);return new LabeledMarker(l,m);};this.getMarkerLatLng=function(l){var m=l.getLatLng();return m;};this.setImage=function(l,m){l.setImage(m);};this.addMarkerToMap=function(l){this.addOverlay(l);};this.newBounds=function(l,m){return new GLatLngBounds(l,m);};this.newEmptyBounds=function(){return new GLatLngBounds();};this.getBounds=function(){return this.map.getBounds();};this.getBoundsArray=function(l){if(l===undefined)l=this.getBounds();var m={left:l.getSouthWest().lng(),bottom:l.getSouthWest().lat(),right:l.getNorthEast().lng(),top:l.getNorthEast().lat()};return m;};this.getBoundsCenter=function(l){return l.getCenter();};this.getBoundsSouthWest=function(l){if(l===undefined)l=this.getBounds();return l.getSouthWest();};this.getBoundsNorthEast=function(l){if(l===undefined)l=this.getBounds();return l.getNorthEast();};this.getBoundsZoomLevel=function(l){if(l===undefined)l=this.getBounds();return this.map.getBoundsZoomLevel(l);};this.extendBounds=function(l,m){l.extend(m);};this.boundsContainsLatLng=function(l,m){return l.containsLatLng(m);};this.geocode=function(l,m){var n=this;this.geocoder.getLocations(l,function(p){var q={success:(p.Status.code==G_GEO_SUCCESS)};if(q.success){var r=p.Placemark[0];q.latlng=n.newLatLng(r.Point.coordinates[1],r.Point.coordinates[0]);q.bounds=n.newBounds(n.newLatLng(r.ExtendedData.LatLonBox.south,r.ExtendedData.LatLonBox.west),n.newLatLng(r.ExtendedData.LatLonBox.north,r.ExtendedData.LatLonBox.east));q.address=r.address;}m(q);});};this.GetDirections=function(l,m,n,p){var q=new GDirections();GEvent.addListener(q,"error",p);GEvent.addListener(q,"load",function(){var r={success:(q.getStatus().code==200)};if(r.success){r.bounds=q.getBounds();r.polyline=q.getPolyline();r.Routes=[];for(var i=0;i<q.getNumRoutes();i++){var s=q.getRoute(i);var t={Distance:s.getDistance().html,Duration:s.getDuration().html,sStartAddress:s.getStartGeocode().address,sEndAddress:s.getEndGeocode().address,Steps:[]};for(var j=0;j<s.getNumSteps();j++){var u=s.getStep(j);Step={LatLng:u.getLatLng(),Description:u.getDescriptionHtml(),Distance:u.getDistance().html};t.Steps.push(Step);}r.Routes.push(t);}}n(r);});q.load("from: "+l+" to: "+m,{"getPolyline":true,"getSteps":true});};this.showMapBlowup=function(l){this.map.showMapBlowup(l);};this.initStreetView=function(l,m,n){if(this.streetView){this.streetView.show();this.setStreetViewLocation(m);}else{panoramaOptions={"latlng":m,"features":{"userPhotos":false},"enableCloseButton":true};this.streetView=new GStreetviewPanorama(document.getElementById(l),panoramaOptions);this.setStreetViewLocation(m);GEvent.addListener(this.streetView,"error",n);}};this.hideStreetView=function(){this.streetView.hide();};this.setStreetViewLocation=function(l){if(!this.streetView)return;if(false){if(!this.streetView.isHidden())this.streetView.setLocationAndPOV(l);}else{var m=this;this.panoClient.getNearestPanorama(l,function(n){var p=n.location.latlng;var q=0;if(n.Links[0].yawDeg)q=Math.round(n.Links[0].yawDeg-90);m.streetView.setLocationAndPOV(p,{yaw:q});});}};this.isStreetViewVisible=function(){if(IsEmpty(this.streetView))return false;return!this.streetView.isHidden();};this.isStreetViewExists=function(l,m){this.panoClient=new GStreetviewClient();this.panoClient.getNearestPanorama(l,m);};this.newIcon=function(l,m,n){var p=new GIcon();p.image=l;p.shadow='';p.iconSize=new GSize(m[0],m[1]);p.iconAnchor=new GPoint(n[0],n[1]);p.infoWindowAnchor=new GPoint(5,1);return p;};this.getIconSize=function(l){var m={Anchor:l.getIcon().iconAnchor,Size:{width:l.getIcon().iconSize.width,height:l.getIcon().iconSize.height}};return m;};this.getIconSymbolURL=function(l){return l.image;};this.newPolyline=function(l,m,n){var P;if(IsEmpty(m))P=new GPolyline(l);else P=new GPolyline(l,m,n);return P;};this.newPolygon=function(l,m,n,p,q,r){return new GPolygon(l,m,n,p,q,r);};this.SetControls=function(l,m){if(l){this.map.addControl(new GSmallMapControl());this.map.enableScrollWheelZoom();}else{this.map.setUIToDefault();this.map.enableRotation();if(m)this.map.addControl(new GOverviewMapControl(new GSize(200,200)));}};this.AddControl=function(x,y,l){var m=new GControlPosition(G_ANCHOR_BOTTOM_LEFT,new GSize(x,y));m.apply(l);};this.AddCartologo=function(l,m){this.AddControl(3,40,document.getElementById(l));showHideElement(l,m);this.map.getContainer().appendChild(document.getElementById(l));};this.CreateShowSidebarControlKill=function(l){function m(){}m.prototype=new GControl();m.prototype.initialize=function(n){var p=document.createElement("div");var q=document.getElementById("MapMenu");p.appendChild(q);n.getContainer().appendChild(p);this.container=p;return p;};m.prototype.show=function(){$("#sbButtonShowSidebar").show();};m.prototype.hide=function(){$("#sbButtonShowSidebar").hide();};m.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(65-20*l,7));};this.ShowSidebarControl=new m();this.map.addControl(this.ShowSidebarControl);};this.EmbedWatermark=function(){gWaitScreen=new GScreenOverlay("/images/prompts/myprompt.png",promptScreenXY,promptOverlayXY,promptSize);map.addOverlay(gWaitScreen);};this.AddEvent=function(l,m,n){GEvent.addListener(l,m,n);};this.AddMarkerClickEvent=function(l,m){this.AddEvent(l,"click",m);};this.AddMarkerMouseOverEvent=function(l,m){this.AddEvent(l,"mouseover",m);};this.AddMarkerMouseOutEvent=function(l,m){this.AddEvent(l,"mouseout",m);};this.AddMapEvent=function(l,m){this.AddEvent(this.map,l,m);};this.AddMapDragEndEvent=function(l){this.AddMapEvent("moveend",l);};this.AddMapZoomEndEvent=function(l){this.AddMapEvent("zoomend",l);};this.AddMapInfoWindowCloseEvent=function(l){this.AddMapEvent("extinfowindowclose",l);};this.AddMapRightClickEvent=function(l){this.AddMapEvent("singlerightclick",l);};this.OpenInfoWindow=function(l,m,n){l.openExtInfoWindow(this.map,m,n,{"beakOffset":22,"paddingX":-50});};this.closeInfoWindow=function(){this.map.closeExtInfoWindow();};if(GBrowserIsCompatible()){if(false){var e=new GCopyrightCollection("<a href=\"http://www.openstreetmap.org/\">OpenStreetMap</a>");e.addCopyright(new GCopyright(1,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),0,"\x20"));var f=new GTileLayer(e,1,17,{tileUrlTemplate:'http://tile.openstreetmap.org/{Z}/{X}/{Y}.png'});var g=new GTileLayer(e,1,17,{tileUrlTemplate:'http://tah.openstreetmap.org/Tiles/tile/{Z}/{X}/{Y}.png'});var h=new GMapType([f],G_NORMAL_MAP.getProjection(),"Mapnik");var k=new GMapType([g],G_NORMAL_MAP.getProjection(),"Osmarend");this.map=new GMap2(document.getElementById(c),{mapTypes:[G_HYBRID_MAP,G_SATELLITE_MAP,G_NORMAL_MAP,h,k]});}else this.map=new GMap2(document.getElementById(c));this.geocoder=new GClientGeocoder();setTimeout(d,0);}else{this.map=null;alert("Your browser doesn't support google maps !!");}}function IsEmpty(o){return(o===null||o===""||o===undefined);}
