text: 'use strict';var defaultMapCentreLat,defaultMapCentreLng,defaultMapZoom,map,mapZoom,mapCenter,mapCenterLat,mapCenterLng,marker,markerLat,markerLng,pinPlacementMethod,editMode,initialized=!1;
  function init(){var a={center:new google.maps.LatLng(defaultMapCentreLat,defaultMapCentreLng),zoom:defaultMapZoom,mapTypeId:google.maps.MapTypeId.ROADMAP};map=new google.maps.Map(document.getElementById("map"),a);markerLat&&markerLng&&placeMarkerAction(new google.maps.LatLng(markerLat,markerLng),!0);google.maps.event.addListener(map,"bounds_changed",function(){mapZoom=map.getZoom();mapCenter=map.getCenter();mapCenterLat=mapCenter.lat();mapCenterLng=mapCenter.lng();updateMapLatLngZoomFields()});map.setOptions({scrollwheel:!1});
  editMode||(void 0!=marker&&marker.setOptions({draggable:!1}),map.setOptions({disableDefaultUI:!0,draggable:!1,disableDoubleClickZoom:!0}))}
  function placeMarker(a){var b="";pinPlacementMethod=a;"postcode_country"==pinPlacementMethod?(""!=parent.document.getElementById("postcode").value&&(b+=parent.document.getElementById("postcode").value.replace(" ","")+","),""!=parent.document.getElementById("country").value&&(a=parent.zenario._mNAA("zenario_location_manager","&mode=get_country_name&country_id="+parent.document.getElementById("country").value),b+=a+","),b=trimTrailingComma(b),geoCode(b)):"street_postcode_country"==pinPlacementMethod?
  (""!=parent.document.getElementById("address_line_1").value&&(b+=parent.document.getElementById("address_line_1").value+","),""!=parent.document.getElementById("postcode").value&&(b+=parent.document.getElementById("postcode").value.replace(" ","")+","),""!=parent.document.getElementById("country").value&&(a=parent.zenario._mNAA("zenario_location_manager","&mode=get_country_name&country_id="+parent.document.getElementById("country").value),b+=a+","),b=trimTrailingComma(b),geoCode(b)):"street_city_country"==
  pinPlacementMethod?(""!=parent.document.getElementById("address_line_1").value&&(b+=parent.document.getElementById("address_line_1").value+","),""!=parent.document.getElementById("city").value&&(b+=parent.document.getElementById("city").value+","),""!=parent.document.getElementById("country").value&&(a=parent.zenario._mNAA("zenario_location_manager","&mode=get_country_name&country_id="+parent.document.getElementById("country").value),b+=a+","),b=trimTrailingComma(b),geoCode(b)):"locality_postcode_country"==
  pinPlacementMethod&&(""!=parent.document.getElementById("locality").value&&(b+=parent.document.getElementById("locality").value+","),""!=parent.document.getElementById("postcode").value&&(b+=parent.document.getElementById("postcode").value.replace(" ","")+","),""!=parent.document.getElementById("country").value&&(a=parent.zenario._mNAA("zenario_location_manager","&mode=get_country_name&country_id="+parent.document.getElementById("country").value),b+=a+","),b=trimTrailingComma(b),geoCode(b))}
  function latLngInRange(a,b,c){return!isNaN(b)&&b>=a&&b<=c?!0:!1}function placeLatLng(a,b){latLngInRange(-90,a,90)&&latLngInRange(-180,b,180)?(a=new google.maps.LatLng(a,b),placeMarkerAction(a)):alert("Please enter valid latitude/longitude values.")}
  function geoCode(a){(new google.maps.Geocoder).geocode({address:a},function(b,c){c==google.maps.GeocoderStatus.OK?(placeMarkerAction(b[0].geometry.location),map.fitBounds(b[0].geometry.viewport)):alert("Geocoding was not successful.  Google returned the following error code: "+c)})}function trimTrailingComma(a){","==a.substr(-1)&&(a=a.substr(0,a.length-1));return a}
  function placeMarkerAction(a,b){b||(void 0!=marker&&marker.setMap(null),marker=void 0);markerLatLng=a;markerLat=markerLatLng.lat();markerLng=markerLatLng.lng();marker=new google.maps.Marker({position:markerLatLng,map,draggable:!0});updateMarkerLatLngFields();google.maps.event.addListener(marker,"dragend",function(c){a=c.latLng;markerLat=a.lat();markerLng=a.lng();updateMarkerLatLngFields()});b||map.setCenter(marker.getPosition())}
  function clearMap(){defaultMapCentreLng=defaultMapCentreLat=0;defaultMapZoom=1;markerLng=markerLat=marker=void 0;updateMarkerLatLngFields();init()}function updateMarkerLatLngFields(){void 0==markerLat&&(markerLat="");void 0==markerLng&&(markerLng="");parent.document.getElementById("marker_lat").value=markerLat;parent.document.getElementById("marker_lng").value=markerLng;initialized&&window.parent.zenarioAB.fieldChange("map_edit")}
  function updateMapLatLngZoomFields(){parent.document.getElementById("map_center_lat").value=mapCenterLat;parent.document.getElementById("map_center_lng").value=mapCenterLng;parent.document.getElementById("zoom").value=mapZoom;initialized&&window.parent.zenarioAB.fieldChange("map_edit");initialized=!0}
  function success(a){defaultMapCentreLat=a.coords.latitude;defaultMapCentreLng=a.coords.longitude;markerLat=a.coords.latitude;markerLng=a.coords.longitude;defaultMapZoom=16;map.setCenter(new google.maps.LatLng(defaultMapCentreLat,defaultMapCentreLng));map.setZoom(defaultMapZoom);placeMarkerAction(new google.maps.LatLng(defaultMapCentreLat,defaultMapCentreLng))}function error(){alert("Your browser does not support this method")};
  