if(googleApiKey!=null&&googleApiKey!=="")var lat=25.047745,lng=121.517058,zoomLevel=7,poiZoomLevel=17,placeType=["food","restaurant","lodging","book_store"],markers=[],GoogleMap=function(n,t,i){function u(){for(var n=0;n<markers.length;n++)markers[n].setMap(null)}var f;t!=null&&t!==""&&(lat=parseFloat($("#"+t).val()));i!=null&&i!==""&&(lng=parseFloat($("#"+i).val()));var e=new google.maps.LatLng(lat,lng),o={center:e,zoom:zoomLevel,mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControl:!0,streetViewControl:!0,styles:[{stylers:[{visibility:"simplified"}]},{stylers:[{visibility:"off"}],elementType:"labels.icon"}]},r=new google.maps.Map(document.getElementById(n),o);GoogleMap.prototype.AddMarker=function(n,t){u();var f=new google.maps.LatLng(n,t),i=new google.maps.Marker({animation:google.maps.Animation.DROP,position:f,map:r});r.panTo(i.getPosition());r.setZoom(poiZoomLevel);markers.push(i)};GoogleMap.prototype.AddMarkerWithContent=function(n,t){var i=new google.maps.InfoWindow;i.setContent(t);google.maps.event.addListener(n,"click",function(){r.panTo(n.getPosition());r.setZoom(poiZoomLevel);i.open(r,n)});n.setMap(r)};GoogleMap.prototype.SearchAddress=function(n){$("#"+n).change(function(){var n=$(this).val();f=new google.maps.Geocoder;f.geocode({address:n},function(n,t){t==google.maps.GeocoderStatus.OK})})};GoogleMap.prototype.GetPlaces=function(){var t={lat:lat,lng:lng},n=new google.maps.places.PlacesService(r);n.nearbySearch({location:t,radius:500,types:placeType},function(t,i){if(i===google.maps.places.PlacesServiceStatus.OK)for(var u=0;u<t.length;u++)n.getDetails({placeId:t[u].place_id},function(n,t){if(t===google.maps.places.PlacesServiceStatus.OK){var i=new google.maps.Marker({position:new google.maps.LatLng(n.geometry.location.lat(),n.geometry.location.lng()),animation:google.maps.Animation.DROP,map:r,title:n.name,icon:n.icon}),u="<p><b><a href='"+n.url+"' target='_blank'>"+n.name+"<\/a><\/b><\/p><p>"+n.formatted_address+"<\/p><p>"+n.international_phone_number+"<\/p><p><a href='"+n.website+"'>"+n.website+"<\/a><\/p>";this.addMarkerWithContent(i,u)}})})}}