var store = new Array();

// OCC #001: 1720 E Olive Way, Seattle, WA 98102
store[1] = new Array();
store[1]["lat"] = 47.620020;
store[1]["lng"] = -122.322953;
store[1]["address"] = "1720 E Olive Way";
store[1]["city"] = "Seattle";
store[1]["state"] = "WA";
store[1]["zipcode"] = "98102";
store[1]["phone"] = "(206) 328-3731";

// OCC #002: 1111 1st Ave, Seattle, WA 98101 
store[2] = new Array();
store[2]["lat"] = 47.605626; 
store[2]["lng"] = -122.336817;
store[2]["address"] = "1111 1st Ave";
store[2]["city"] = "Seattle";
store[2]["state"] = "WA";
store[2]["zipcode"] = "98101";
store[2]["phone"] = "(206) 381-1911";

// OCC #003: 1404 E Pine, Seattle, WA 98122
store[3] = new Array();
store[3]["lat"] = 47.615420;
store[3]["lng"] = -122.314072;
store[3]["address"] = "1404 E Pine St";
store[3]["city"] = "Seattle";
store[3]["state"] = "WA";
store[3]["zipcode"] = "98122";
store[3]["phone"] = "(206) 323-7798";


function getStoreLat(id) {
	return(store[id]["lat"]);
}

function getStoreLng(id) {
	return(store[id]["lng"]);
}

function getStoreGeoLocation(id) {
	return(new GPoint(getStoreLng(id), getStoreLat(id)));
}

function displayLocationMarker(point, content) {
  var marker = new GMarker(point);
  GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml(content);
  });
  return marker;
}

function displayLocationInfo(point, content) {
  var marker = new GMarker(point);
  marker.openInfoWindowHtml(content);
  return marker;
}

function addStoreLocations(map, active) {
	locations = store.length; 
	for(i = 1; i < locations; i++) {
		point = getStoreGeoLocation(i);
		content = "<div style=\"width: 200px; color: #000000; font-size: 10pt;\"><b><a href=\"/locations/" + i + "/\">Online Coffee Company</a></b><br/>" + store[i]["address"] + "<br />" + store[i]["city"] + ", " + store[i]["state"] + " " + store[i]["zipcode"] + "<br />" + store[i]["phone"] + "<br /></div>";
		map.addOverlay(displayLocationMarker(point, content));
		if(i == active)
			map.openInfoWindowHtml(point, content);
	}	
	
	//occ001 = map.addOverlay(displayLocation(getStoreGeoLocation("001"), "<div style=\"width: 200px; color: #000000; font-size: 10pt;\"><b><a href=\"/locations/002/\">Online Coffee Company</a></b><br/>1720 E Olive Way<br />Seattle, WA 98102<br /><br /></div>"));

	//occ002 = map.addOverlay(displayLocation(getStoreGeoLocation("002"), "<div style=\"width: 200px; color: #000000; font-size: 10pt;\"><b><a href=\"/locations/001/\">Online Coffee Company</a></b><br/>1111 1st Ave<br />Seattle, WA 98101<br /><br /></div>"));

	//occ003 = map.addOverlay(displayLocation(getStoreGeoLocation("003"), "<div style=\"width: 200px; color: #000000; font-size: 10pt;\"><b><a href=\"/locations/003/\">Online Coffee Company</a></b><br/>1404 E Pine St<br />Seattle, WA 98122<br />(206) 323-7798<br /></div>"));
}