var np_google_maps={map:null,gmap_timer:0,base_icon:null,marker_location:null,base_icon_url:null,member_icon_url:null,location_icon_url:null,width:0,load:function(){if(google.maps.BrowserIsCompatible()){var e=document.getElementById("np_le_tag_page_map");if(!e){return false}var marker_location=Drupal.settings.static_url+"graphics/sites/all/themes/nova/default/images/google_maps/";$.extend(np_google_maps,{marker_location:marker_location,base_icon_url:{image:marker_location+"post.png",shadow:marker_location+"post_shadow.png"},member_icon_url:{image:marker_location+"people.png",shadow:marker_location+"people_shadow.png"},location_icon_url:{image:marker_location+"location.png",shadow:marker_location+"location_shadow.png"}});np_google_maps.map=new google.maps.Map2(e);np_google_maps.map.addControl(new google.maps.SmallMapControl());np_google_maps.map.setMapType(G_PHYSICAL_MAP);np_google_maps.width=parseInt($(np_google_maps.map.getContainer()).css("width"));np_google_maps.base_icon=new google.maps.Icon();np_google_maps.base_icon.iconSize=new google.maps.Size(20,25);np_google_maps.base_icon.shadowSize=new google.maps.Size(35,25);np_google_maps.base_icon.iconAnchor=new google.maps.Point(9,34);np_google_maps.base_icon.infoWindowAnchor=new google.maps.Point(9,2);np_google_maps.base_icon.infoShadowAnchor=new google.maps.Point(18,25);$.extend(np_google_maps.base_icon,np_google_maps.base_icon_url);np_google_maps.mark_points()}},show_point:function(lat,lng,html_description){var point=new google.maps.LatLng(lat,lng);np_google_maps.map.setCenter(point,13);var marker=new google.maps.Marker(point);np_google_maps.map.addOverlay(marker);marker.openInfoWindowHtml(html_description,{maxWidth:np_google_maps.width*0.4})},place_point:function(lat,lon,html_description,type){type=typeof (type)=="undefined"?"item":type;var point=new google.maps.LatLng(lat,lon);if(type=="member"){var member_icon=new GIcon(np_google_maps.base_icon);$.extend(member_icon,np_google_maps.member_icon_url);var marker=new google.maps.Marker(point,{icon:member_icon})}else{if(type=="location"){var location_icon=new GIcon(np_google_maps.base_icon);$.extend(location_icon,np_google_maps.location_icon_url);var marker=new google.maps.Marker(point,{icon:location_icon})}else{var basic_icon=new GIcon(np_google_maps.base_icon);var marker=new google.maps.Marker(point,{icon:basic_icon})}}if(!np_google_maps.map.isLoaded()){np_google_maps.set_center()}np_google_maps.map.addOverlay(marker);marker.bindInfoWindowHtml(html_description,{maxWidth:np_google_maps.width*0.4})},mark_points:function(){var markers_present=false;if(typeof (Drupal.settings.le_locations.locations)!="undefined"){var len=Drupal.settings.le_locations.locations.length;for(var i=0;i<len;++i){if(Drupal.settings.le_locations.locations[i].lat!=null&&Drupal.settings.le_locations.locations[i].lat!=null){np_google_maps.place_point(Drupal.settings.le_locations.locations[i].lat,Drupal.settings.le_locations.locations[i].lon,np_google_maps.format_location(Drupal.settings.le_locations.locations[i]),"location")}}markers_present=true}if(typeof (Drupal.settings.le_locations.members)!="undefined"){var len=Drupal.settings.le_locations.members.length;for(var i=0;i<len;++i){if(Drupal.settings.le_locations.members[i].lat!=null&&Drupal.settings.le_locations.members[i].lat!=null){np_google_maps.place_point(Drupal.settings.le_locations.members[i].lat,Drupal.settings.le_locations.members[i].lon,np_google_maps.format_member(Drupal.settings.le_locations.members[i]),"member")}}markers_present=true}if(typeof (Drupal.settings.le_locations.items)!="undefined"){var len=Drupal.settings.le_locations.items.length;for(var i=0;i<len;++i){if(Drupal.settings.le_locations.items[i].lat!=null&&Drupal.settings.le_locations.items[i].lat!=null){np_google_maps.place_point(Drupal.settings.le_locations.items[i].lat,Drupal.settings.le_locations.items[i].lon,np_google_maps.format_item(Drupal.settings.le_locations.items[i]),"item")}}markers_present=true}if(markers_present){np_google_maps.set_zoom()}},set_zoom:function(){var GB=new google.maps.LatLngBounds(new google.maps.LatLng(Drupal.settings.le_locations.bounds.sw[0],Drupal.settings.le_locations.bounds.sw[1]),new google.maps.LatLng(Drupal.settings.le_locations.bounds.ne[0],Drupal.settings.le_locations.bounds.ne[1]));np_google_maps.map.setZoom(np_google_maps.map.getBoundsZoomLevel(GB))},set_center:function(){np_google_maps.map.setCenter(new google.maps.LatLng(Drupal.settings.le_locations.bounds.center[0],Drupal.settings.le_locations.bounds.center[1]))},format_item:function(data){var output="<h2>"+data.title+"</h2>";output+='<div>by <a href="'+data.url+'">'+data.name+"</a> on "+data.date_created+"</div>";output+="<div>("+data.location+")</div>";output+="<div>"+data.content+"</div>";return output},format_location:function(data){var output="<h2>location: "+data.name+"</h2>";return output},format_member:function(data){var output="<h2>member: "+data.name+"</h2>";return output}};$(function(){np_google_maps.load()});