var GoogleMapEditor=Class.create();GoogleMapEditor.prototype={initialize:function(B,D,C){this.mapcontainer=$(B);Event.observe(window,"resize",function(){this.centreAndZoom();}.bind(this));if(GBrowserIsCompatible()){this.map=new GMap2(this.mapcontainer);this.map.addControl(new GSmallMapControl());this.map.addControl(new GMapTypeControl());this.map.setCenter(new GLatLng(0,0),0);this.bounds=new GLatLngBounds();Event.observe(window,"unload",function(){GUnload();});}else{alert("Google Maps not supported on this browser.");return false;}Event.observe(document,"tab:click",function(){this.centreAndZoom();}.bind(this));this.map.setMapType(G_HYBRID_MAP);var A=new GLatLng(D,C);this.marker=new GMarker(A,{draggable:true});this.map.addOverlay(this.marker);this.bounds.extend(A);this.centreAndZoom();GEvent.addListener(this.marker,"dragend",this.onDragEnd.bindAsEventListener(this,this.marker));},centreAndZoom:function(){this.map.checkResize();this.map.setZoom(14);this.map.setCenter(this.bounds.getCenter());this.map.savePosition();},geocodePostcode:function(A){var B=new GlocalSearch();B.setSearchCompleteCallback(null,function(){if(B.results[0]){var D=B.results[0].lat;var E=B.results[0].lng;var C=new GLatLng(D,E);this.marker.setLatLng(C,13);this.bounds=new GLatLngBounds();this.bounds.extend(C);this.centreAndZoom();$("latitude").value=D;$("longitude").value=E;}}.bind(this));B.execute(A+", UK");},onDragEnd:function(B,A){var C=A.getLatLng();$("latitude").value=C.lat();$("longitude").value=C.lng();}};var mapObj;