
/** 
 * File Info
 * ----------------------------------
 * @filename     googlemaps.js
 * @created      xx.xx.xxxx
 * @author       unknown
 * @description  This file checks if email address is in correct format
 *               Add onChange="return checkEmail(this);" call to input
 *
 * History
 * ---------------------------------
 * Date         Name      Note
 * 
 */

    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());  
        map.setCenter(new GLatLng(44.995633, -93.406333), 13);
		var point = new GLatLng(44.995633, -93.406333);
		map.addOverlay(createMarker(point));
		map.openInfoWindow(map.getCenter(),"<b>Brookdale Plastics, Inc.</b><br>9909 S Shore Dr.<br>Plymouth, MN 55441");
      }
    }
	
	// Creates a marker at the given point with the given number label
	function createMarker(point) {
	  var marker = new GMarker(point);
	  GEvent.addListener(marker, "click", function() {
	    marker.openInfoWindowHtml("<b>Brookdale Plastics, Inc.</b><br>9909 S Shore Dr.<br>Plymouth, MN 55441");
	  });
	  return marker;
	}


	function showAddress(address) {
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              alert(address + " not found");
            } else {
              map.setCenter(point, 13);
              var marker = new GMarker(point);
              map.addOverlay(marker);
              marker.openInfoWindowHtml(address);
            }
          }
        );
      }
    }