/***************************************************************************
	Theme Name: Saint Honore Bakery
	Theme URI: http://www.sainthonorebakery.com
	Description: Java Script - contains Java Script for the Google Map
	Date: 4 April, 2007 
	Author: Petra Gregorova Yocum (www.bigbcreations.com)
***********************************************************************/
//<![CDATA[
function createMarker(point, icon, html, tooltip) {
   if (tooltip) {
		var marker = new GMarker(point, {icon:icon, title:tooltip});
   } else {
		var marker = new GMarker(point, {icon:icon});
   } 
   GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml(html);
   });
  return marker;
}

function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        // Set map controls
				map.addControl(new GLargeMapControl());
				map.addControl(new GMapTypeControl());
				map.addControl(new GScaleControl());
        // Set center of map, scale, type of map
				map.setCenter(new GLatLng(45.535369, -122.699215), 10);

// Create our "tiny" marker icon
var icon = new GIcon();
icon.image = "../images/googleMapMarker.png";
icon.shadow = "../images/googleMapMarkerShadow.png";
icon.iconSize = new GSize(149, 33);
icon.shadowSize = new GSize(149, 33);
icon.iconAnchor = new GPoint(6, 20);
icon.infoWindowAnchor = new GPoint(5, 1);

// Our info window content for the main location
	var v_title1 = 'NW Portland Location';
	var v_adr1 = '2335 NW Thurman St';
	var v_stzip1 = 'Portland, OR 97210';
	var v_qs1 = (v_adr1 + ' ' +v_stzip1).split(' ').join('+');
// Set point and click event for popup Information Window
   var point = new GLatLng(45.535369,-122.699215);
	 var html = '<p><strong>' + v_title1 + '</strong><br />' + v_adr1 + '<br />' + v_stzip1 + '</p><p><a href="http://maps.google.com/maps?f=q&hl=en&q=' + v_qs1 + '&om=1" target="_blank">Get Driving Directions<\/a></p>'
// Add pointer to map - calls createMarker function
   map.addOverlay(createMarker(point, icon, html, "2335 NW Thurman Street, Portland"));

// Our info window content for Lake Oswego location
	var v_title2 = 'Lake Oswego Location';
	var v_adr2 = '315 First St, Suite 103';
	var v_stzip2 = 'Lake Oswego, OR 97034';
	var v_qs2 = (v_adr2 + ' ' +v_stzip2).split(' ').join('+');
// Set point and click event for popup Information Window
   var point = new GLatLng(45.418127,-122.664362);
	 var html = '<p><strong>' + v_title2 + '</strong><br />' + v_adr2 + '<br />' + v_stzip2 + '</p><p><a href="http://maps.google.com/maps?f=q&hl=en&q=' + v_qs2 + '&om=1" target="_blank">Get Driving Directions<\/a></p>'
// Add pointer to map - calls createMarker function
   map.addOverlay(createMarker(point, icon, html, "315 First Street, Lake Oswego"));
      }
    }
		

    //]]>