--- /dev/null
+/* ============================== */
+// Google Maps mashup for bigfore golf courses
+//
+// Gaslight Media (c) 2008
+// Author: Jamie Kahgee <jamie.kahgee@gmail.com>
+/* ============================== */
+var GMaps =
+{
+ centerLat: 45.356005,
+ centerLong: -84.690857,
+ startZoom: 9,
+
+ init: function()
+ {
+ if (GBrowserIsCompatible())
+ {
+ var map = new GMap2($('map'));
+ var loc = new GLatLng(GMaps.centerLat, GMaps.centerLong);
+ var marker;
+ var base_url = $('mapsURL').value + 'assets/';
+ map.addControl(new GSmallMapControl());
+ map.addControl(new GMapTypeControl());
+ map.setCenter(loc, GMaps.startZoom);
+
+ var markers = [
+ {
+ 'lat' : 45.292304,
+ 'long' : -85.160198,
+ 'name' : 'Dunmaglas',
+ 'func' : GMaps.dunmaglas,
+ 'icon' : base_url + 'dunmaglas.png'
+ },
+ {
+ 'lat' : 45.295177,
+ 'long' : -85.26412,
+ 'name' : 'Hidden River',
+ 'func' : GMaps.hiddenRiver,
+ 'icon' : base_url + 'hiddenriver.png'
+ },
+ {
+ 'lat' : 45.32504,
+ 'long' : -84.218519,
+ 'name' : 'Black Lake Golf Club',
+ 'func' : GMaps.blackLake,
+ 'icon' : base_url + 'blacklake.png'
+ },
+ {
+ 'lat' : 45.442706,
+ 'long' : -84.896482,
+ 'name' : 'Little Traverse Bay Golf Club',
+ 'func' : GMaps.littleTraverse,
+ 'icon' : base_url + 'littletraverse.png'
+ },
+ {
+ 'lat' : 45.471746,
+ 'long' : -84.914849,
+ 'name' : 'Hamlet Village',
+ 'func' : GMaps.hamletVillage,
+ 'icon' : base_url + 'hamletvillage.png'
+ },
+ {
+ 'lat' : 45.482054,
+ 'long' : -84.914336,
+ 'name' : 'Trout Creek',
+ 'func' : GMaps.troutCreek,
+ 'icon' : base_url + 'troutcreek.png'
+ }
+ ];
+
+ markers.each(function(n) {
+ loc = new GLatLng(n.lat, n.long);
+ if (n.icon != '')
+ {
+ var icon = new GIcon();
+ icon.image = n.icon;
+ icon.shadow = base_url + 'shadow-old.png';
+ icon.iconSize = new GSize(20, 34);
+ icon.iconAnchor = new GPoint(14, 25);
+ icon.infoWindowAnchor = new GPoint(14, 14);
+ marker = new GMarker(loc, icon);
+ }
+ else
+ {
+ marker = new GMarker(loc);
+ }
+ map.addOverlay(marker);
+ GEvent.addListener(marker, 'click', n['func']);
+ });
+ }
+ },
+
+ denit: function()
+ {
+ GUnload();
+ },
+
+ dunmaglas: function(event)
+ {
+ var title = new Element('h2', {'class': 'title'}).update('Dunmaglas Golf Course');
+ var address = new Element('div', {'class': 'address'}).update('9031 Boyne City Rd<br>Charlevoix, MI 49720<br>(231) 547-4653');
+ var link = new Element('a', {target: '_blank', href: 'http://maps.google.com/maps?f=q&hl=en&geocode=&q=9031+Boyne+City+Rd,+Charlevoix,+MI+49720&sll=45.417025,-84.267797&sspn=0.007441,0.014119&ie=UTF8&ll=45.292928,-85.160265&spn=0.007457,0.014119&z=16&iwloc=addr'}).update('Get Directions');
+
+ var wrapper = new Element('div').insert({bottom: title}).insert({bottom: address}).insert({bottom: link});
+ this.openInfoWindowHtml(wrapper);
+ },
+
+ hiddenRiver: function(event)
+ {
+ var title = new Element('h2', {'class': 'title'}).update('Belvedere Golf Club');
+ var address = new Element('div', {'class': 'address'}).update('5731 Marion Center Rd<br>Charlevoix, MI 49720<br>(866) 547-2611');
+ var link = new Element('a', {target: '_blank', href: 'http://g.co/maps/qyp99'}).update('Get Directions');
+
+ var wrapper = new Element('div').insert({bottom: title}).insert({bottom: address}).insert({bottom: link});
+ this.openInfoWindowHtml(wrapper);
+ },
+
+ blackLake: function(event)
+ {
+ var title = new Element('h2', {'class': 'title'}).update('Black Lake Golf Club');
+ var address = new Element('div', {'class': 'address'}).update('2800 Maxon Rd<br>Onaway, MI 49765<br>(989) 733-4653');
+ var link = new Element('a', {target: '_blank', href: 'http://maps.google.com/maps?f=q&hl=en&geocode=&q=2800+Maxon+Road,+Onaway,+MI+49765&sll=45.508332,-84.758642&sspn=0.007429,0.014119&ie=UTF8&ll=45.417025,-84.267797&spn=0.007441,0.014119&z=16&iwloc=addr'}).update('Get Directions');
+
+ var wrapper = new Element('div').insert({bottom: title}).insert({bottom: address}).insert({bottom: link});
+ this.openInfoWindowHtml(wrapper);
+ },
+
+ littleTraverse: function(event)
+ {
+ var title = new Element('h2', {'class': 'title'}).update('Little Traverse Bay Golf Club');
+ var address = new Element('div', {'class': 'address'}).update('995 Hideaway Valley Dr<br>Harbor Springs, MI 49740<br>(231) 526-6200');
+ var link = new Element('a', {target: '_blank', href: 'http://maps.google.com/maps?f=q&hl=en&geocode=&q=995+Hideaway+Valley+Dr,+Harbor+Springs,+MI+49740&sll=45.292928,-85.160265&sspn=0.007457,0.014119&ie=UTF8&ll=45.443256,-84.895585&spn=0.007437,0.014119&z=16&iwloc=addr'}).update('Get Directions');
+
+ var wrapper = new Element('div').insert({bottom: title}).insert({bottom: address}).insert({bottom: link});
+ this.openInfoWindowHtml(wrapper);
+ },
+
+ hamletVillage: function(event)
+ {
+ var title = new Element('h2', {'class': 'title'}).update('Hamlet Village');
+ var address = new Element('div', {'class': 'address'}).update('5484 Pleasantview Rd<br>Harbor Springs, MI 49740<br>(231) 526-2641');
+ var link = new Element('a', {target: '_blank', href: 'http://maps.google.com/maps?f=q&hl=en&geocode=&q=5484+Pleasantview+Rd,+Harbor+Springs,+MI+49740&sll=45.443256,-84.895585&sspn=0.007437,0.014119&ie=UTF8&ll=45.472471,-84.914682&spn=0.007433,0.014119&z=16&iwloc=addr'}).update('Get Directions');
+
+ var wrapper = new Element('div').insert({bottom: title}).insert({bottom: address}).insert({bottom: link});
+ this.openInfoWindowHtml(wrapper);
+ },
+
+ troutCreek: function(event)
+ {
+ var title = new Element('h2', {'class': 'title'}).update('Trout Creek');
+ var address = new Element('div', {'class': 'address'}).update('4749 S Pleasantview Rd<br>Harbor Springs, MI 49740<br>(231) 526-2148');
+ var link = new Element('a', {target: '_blank', href: 'http://maps.google.com/maps?f=q&hl=en&geocode=&q=4749+S+Pleasantview+Rd,+Harbor+Springs,+MI+49740&sll=45.472471,-84.914682&sspn=0.007433,0.014119&ie=UTF8&ll=45.483018,-84.91451&spn=0.007432,0.014119&z=16&iwloc=addr'}).update('Get Directions');
+
+ var wrapper = new Element('div').insert({bottom: title}).insert({bottom: address}).insert({bottom: link});
+ this.openInfoWindowHtml(wrapper);
+ }
+};
+
+//Event.observe(window, 'load', GMaps.init);
+//Event.observe(window, 'unload', GMaps.denit);
+
+$(function(){
+ GMaps.init;
+});
\ No newline at end of file