window.onload=attachHandlers; 

function attachHandlers() {
     //set up the input behavior controls
     
     //set up the map
     initializeMap(); 

     document.getElementById('frmContact').onsubmit = function() {
          if (! validateForm('txtName,txtEmail,txtComments') ) {
               return false; 
          }
     }; 


     document.getElementById('txtName').setAttribute('dataType','ReqText'); 
     document.getElementById('txtEmail').setAttribute('dataType', 'ReqEmail'); 
     document.getElementById('txtComments').setAttribute('dataType', 'ReqText'); 

     attachHandler_Inputs(); 

}


function initializeMap() {
     //this function initializes the map on the contact page

     //this slight larger version of the fav.png is used as a ap marker.  
     var image = new google.maps.MarkerImage('/images/mapMarker.png',
     // This marker is 32 pixels wide by 32 pixels tall.
     new google.maps.Size(32, 32),
     // The origin for this image is 0,0.
     new google.maps.Point(0,0),
     // The anchor for this image is the base of the flagpole at 0,32.
     new google.maps.Point(0, 32));

     var latlng = new google.maps.LatLng(42.9961500, -71.5119000); //this is the location 2 pilsbury street
     var mapCtr = new google.maps.LatLng(42.9961500, -71.5119000); // I am centering the map on a point slightly north to provide space for the "flagpole" marker
     
     //map options  
     var myOptions = {
          zoom: 16,
          center: mapCtr,
          mapTypeId: google.maps.MapTypeId.ROADMAP
     };
     
     //this is the actual map
     var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
          
     //this is the marker
      marker = new google.maps.Marker({
          map:map,
          draggable:true,
          animation: google.maps.Animation.DROP,
          position: latlng, 
          title: "Sousa Signs",
          icon: image

      });

     //top of the flagpole text
     var infowindow = new google.maps.InfoWindow({
         content: "Sousa Signs<br>3 Orchard Street<br>Manchester, NH 03102", 
          map:map,
     });
      infowindow.open(map,marker);


}


