// JavaScript Document
  var geocoder,map,markers=[];
  function initialize() {
  	geocoder = new google.maps.Geocoder();
    var latlng = new google.maps.LatLng(-34.397, 150.644);
    var myOptions = {
      zoom: 15,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    	};
    map = new google.maps.Map(document.getElementById("panel"),myOptions);
	
	address = "4151 Hazelbridge Way Richmond, BC, CA";
	geocoder.geocode( { 'address': address}, function(results, status) {
		  if (status == google.maps.GeocoderStatus.OK) {
			map.setCenter(results[0].geometry.location);
			var mapMarker = new google.maps.MarkerImage(
			  'images/map_marker.png',
				new google.maps.Size(42,42),
				new google.maps.Point(0,0)
				);
			
			var marker =new google.maps.Marker({
				map: map, 
				position: results[0].geometry.location,
				icon:mapMarker,
				title:"eSeeLYNX.com"
				});
			markers.push(marker);
			
			myInfoWindowOptions = {
			content: '<div id="infoWindow"><h4>eSeeLYNX.com</h4><form action="http://maps.google.com/maps" method="get" target="_blank"><p> Enter your starting address:</p><input name="saddr" type="text" /><input name="daddr" type="hidden" value="4151 Hazelbridge Way Richmond, BC, CA" /><input type="submit" value="get directions" /></form></div>',
			maxWidth: 275,
			pixelOffset:new google.maps.Size(13,6)
	};
		infoWindow = new google.maps.InfoWindow(myInfoWindowOptions);
			google.maps.event.addListener(marker, 'click', function() {
			infoWindow.open(map,marker);
		});
	
		google.maps.event.addListener(marker, 'dragstart', function(){
			infoWindow.close();
		});

		infoWindow.open(map,marker);
			}
		});
  }
