var map;var markerflag;var fullMap=true;var mui;var lmapcontrol;var mtypecontrol;var activetown="capecod";function initializeMap(){if(GBrowserIsCompatible()){map=new GMap2(document.getElementById("map_canvas"));map.setCenter(new GLatLng(41.69605,-70.36139),9);lmapcontrol=new GLargeMapControl3D();map.addControl(lmapcontrol);mtypecontrol=new GMapTypeControl();map.addControl(mtypecontrol);map.savePosition();mui=new GMapUIOptions(468,468);setupUI()}}function dennis(){initializeMap();map.setZoom(12);map.panTo(new GLatLng(41.7082756,-70.1781391));activetown="dennis"}function falmouth(){initializeMap();map.setZoom(11);map.panTo(new GLatLng(41.5879269,-70.5930511));activetown="falmouth"}function bourne(){initializeMap();map.setZoom(11);map.panTo(new GLatLng(41.721922,-70.538055));activetown="bourne"}function mashpee(){initializeMap();map.setZoom(11);map.panTo(new GLatLng(41.648906,-70.481987));activetown="mashpee"}function sandwich(){initializeMap();map.setZoom(11);map.panTo(new GLatLng(41.757724,-70.500139));activetown="sandwich"}function barnstable(){initializeMap();map.setZoom(11);map.panTo(new GLatLng(41.6918497,-70.3360691));activetown="barnstable"}function yarmouth(){initializeMap();map.setZoom(12);map.panTo(new GLatLng(41.688339,-70.230451));activetown="yarmouth"}function brewster(){initializeMap();map.setZoom(12);map.panTo(new GLatLng(41.760956,-70.082934));activetown="brewster"}function chatham(){initializeMap();map.setZoom(12);map.panTo(new GLatLng(41.67714,-69.9642));activetown="chatham"}function harwich(){initializeMap();map.setZoom(12);map.panTo(new GLatLng(41.6716498,-70.0622231));activetown="harwich"}function orleans(){initializeMap();map.setZoom(12);map.panTo(new GLatLng(41.792795,-70.000485));activetown="orleans"}function eastham(){initializeMap();map.setZoom(12);map.panTo(new GLatLng(41.852402,-69.973726));activetown="eastham"}function provincetown(){initializeMap();map.setZoom(12);map.panTo(new GLatLng(42.05252,-70.186957));activetown="provincetown"}function truro(){initializeMap();map.setZoom(12);map.panTo(new GLatLng(42.0106926,-70.0814153));activetown="truro"}function wellfleet(){initializeMap();map.setZoom(12);map.panTo(new GLatLng(41.917405,-70.027136));activetown="wellfleet"}function nantucket(){initializeMap();map.setZoom(10);map.panTo(new GLatLng(41.283208,-70.09923));activetown="nantucket"}function marthasvineyard(){initializeMap();map.setZoom(10);map.panTo(new GLatLng(41.3804981,-70.645473));activetown="marthasvineyard"}function setupUI(){mui.maptypes.normal=true;mui.maptypes.satellite=true;mui.maptypes.hybrid=true;mui.maptypes.physical=true;mui.zoom.scrollwheel=false;mui.zoom.doubleclick=true;mui.controls.largemapcontrol3d=false;mui.controls.smallzoomcontrol3d=false;mui.controls.maptypecontrol=false;mui.controls.menumaptypecontrol=false;mui.controls.scalecontrol=true;map.setUI(mui)}function showhidemap(){var a=document.getElementById("map_canvas");if(fullMap){if(a!=null){a.style.height=60+"px";setupUI();map.removeControl(lmapcontrol);map.removeControl(mtypecontrol);fullMap=false}}else{if(a!=null){a.style.height=468+"px";map.addControl(lmapcontrol);map.addControl(mtypecontrol);fullMap=true}}map.checkResize();if(fullMap){map.returnToSavedPosition()}}function createBasicMarker(j,f,b,i,h,d,c,a){var g=new GIcon(G_DEFAULT_ICON);g.image="./"+a+"marker.png";markerOptions={icon:g};var e=new GMarker(j,markerOptions);GEvent.addListener(e,"click",function(){e.openInfoWindowHtml("<b>"+b+"</b><br>"+i+"<br>"+h+"<br><a href=http://"+c+" target=new >"+d+"</a>")});return e}function createMarker(k,h,b,j,i,f,e,a){var d=String.fromCharCode("A".charCodeAt(0)+h);var c=new GIcon(G_DEFAULT_ICON);c.image="http://www.google.com/mapfiles/marker"+d+".png";markerOptions={icon:c};var g=new GMarker(k,markerOptions);GEvent.addListener(g,"click",function(){g.openInfoWindowHtml("<b>"+b+"</b><br>"+j+"<br>"+i+"<br><a href=http://"+e+" target=new >"+f+"</a>")});return g}function showMarkers(a){GDownloadUrl(a,function(g){var j=GXml.parse(g);var f=j.documentElement.getElementsByTagName("marker");for(var h=0;h<f.length;h++){var c=new GLatLng(parseFloat(f[h].getAttribute("lat")),parseFloat(f[h].getAttribute("lng")));var b=f[h].getAttribute("name");var l=f[h].getAttribute("address");var k=f[h].getAttribute("town");var e=f[h].getAttribute("action1");var d=f[h].getAttribute("action2");markerflag=f[h].getAttribute("color");if(markerflag=="letter"){map.addOverlay(createMarker(c,h,b,l,k,e,d,markerflag))}else{map.addOverlay(createBasicMarker(c,h,b,l,k,e,d,markerflag))}}})}function show(a){if(activetown!="capecod"){var b="./"+activetown+a+".xml";showMarkers(b)}}function clearMarkers(){map.clearOverlays()};