		$.homeURL = $('link[rel=index]').attr('href');
		$.themeURL = $.homeURL+'wp-content/themes/custom-cabinets/';
	
	
		var GoogleMap = {
			_map : false,
			_center : false,
			_mapHolder : $('#gmap'),
			_allMarkers : [],
			_infoWindow : false,
			
			init : function() {
				var scope = this;
			
				this._center = new google.maps.LatLng(47.60703, -52.73307);
			
				var mapOptions_ = {};
					mapOptions_['zoom'] = 15;
					mapOptions_['center'] = this._center;
					mapOptions_['mapTypeId'] = google.maps.MapTypeId.HYBRID;
					this._map = new google.maps.Map(scope._mapHolder.get(0),mapOptions_);
					
					//load the markers
					this.loadMarker(47.60703, -52.73307,$.themeURL+'media/images/gmap.png',"<div class='window'><h1>Core Insight</h1><address>103-40 Aberdeen Avenue<br/>St. John's, NL A1A 5T3<br/>(709) 738-0336<br/><a href='http://www.coreinsight.ca' class='external'>coreinsight.ca</a></address></div>");				
					this._infoWindow = new google.maps.InfoWindow({content:"Hi I'm an Info Window",position:this._center,zIndex:110});
			},
			
			loadMarker : function(lat,lng,icon,html) {
				var scope = this;
				var MarkerOptions_ = {};
					MarkerOptions_['flat'] = true;
					if(icon) { MarkerOptions_['icon'] = icon; }
					MarkerOptions_['map'] = this._map;
					MarkerOptions_['offset'] = new google.maps.Size(-10,0);
					MarkerOptions_['position'] = new google.maps.LatLng(lat,lng);
			
				var newMarker_ = new google.maps.Marker(MarkerOptions_);
					this._allMarkers.push(newMarker_);
					newMarker_.setMap(this._map);

					
					/* google.maps.event.addListener(newMarker_,'click',function() {
						InfoOptions_ = {};
							InfoOptions_['offset'] = new google.maps.Size(10,0);
							InfoOptions_['content'] = html;
						scope._infoWindow.setOptions(InfoOptions_);
						scope._infoWindow.open(scope._map,newMarker_);
					}); */
			}
		
		}
		
		$(document).ready(function() {
			if($('#gmap').length) { GoogleMap.init(); }
		});
