/*'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\
/'			Code generated by GM Location Tool V0.1					'\
/'		A Customizable Google Maps Location for your Website		'\
/''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\
/'				http://9tree.net/tools/GMLocation					'\
\'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''*/


(function(){

	//main object
	var GMLocation={
		_v:{	
			//MAP
			'map_lat':39.230888,
			'map_lng':-8.684633,
			'map_zoom':14,
			'map_width':800,
			'map_height':400,

			// LOCATION MARKERS
			'markers':[
					// marker 0 - Convento de S. Francisco
					{
						'lat':39.2394,
						'lng':-8.683877,
						'info_status':false
					},
					// marker 1 - Largo do Seminário
					{
						'lat':39.237017,
						'lng':-8.685057,
						'info_status':false
					},
					// marker 2 - Skateparque de Santarém
					{
						'lat':39.239292,
						'lng':-8.695636,
						'info_status':false
					},
					// marker 3 - Teatro Sá da Bandeira
					{
						'lat':39.234335,
						'lng':-8.683169,
						'info_status':false
					},
					// marker 4 - Casual
					{
						'lat':39.233888,
						'lng':-8.684633,
						'info_status':false
					},
					// marker 5 - Largo Marvila
					{
						'lat':39.23533,
						'lng':-8.681126,
						'info_status':false
					},
					// marker 6 - Sarja
					{
						'lat':39.235250,
						'lng':-8.681586,
						'info_status':false
					},
					// marker 7 - Claustros do Cnema
					{
						'lat':39.220476,
						'lng':-8.697696,
						'info_status':false
					}
					]
		},
		'markers':[],
		init:function(){
			// inititalizes map
			GMLocation.map = new google.maps.Map2(document.getElementById('GMLocation'), { 
				size:new google.maps.Size(GMLocation._v.map_width, GMLocation._v.map_height),
				mapTypes:[G_SATELLITE_MAP]
			});
			
			GMLocation.map.setCenter(new google.maps.LatLng(GMLocation._v.map_lat, GMLocation._v.map_lng), GMLocation._v.map_zoom);
			//GMLocation.map.disableDoubleClickZoom();
			GMLocation.map.continuousZoomEnabled();
			GMLocation.map.addControl(new google.maps.LargeMapControl());
			
			//initializes markers
			for(item_i=0;item_i<GMLocation._v.markers.length;item_i++){
				GMLocation.markers[item_i] = new google.maps.Marker(
					new google.maps.LatLng(GMLocation._v.markers[item_i].lat, GMLocation._v.markers[item_i].lng),
					{
						icon:new google.maps.Icon(G_DEFAULT_ICON),
						draggable:false
					}
				);

				GMLocation.markers[item_i].bindInfoWindow(document.getElementById('GMLocation_IW_'+item_i));
				GMLocation.map.addOverlay(GMLocation.markers[item_i]);
				if(GMLocation._v.markers[item_i].info_status) GMLocation.markers[item_i].openInfoWindow(document.getElementById('GMLocation_IW_'+item_i));
			}
			
		}
	}

	//waits for google to load
	google.setOnLoadCallback(GMLocation.init);
})();
