
/* Scripts for Argos Yachtcharter GmbH
 * Copyright © 2002-2008 Inceoeren IT Consulting. All rights reserved. 
 */
 
var map;
 
function mapZoom( a )
{
	map.setZoom( map.getZoom() + a );
}

function mapLoad( x, y, z, maptitle)
{
	if( GBrowserIsCompatible() )
	{
		map = new GMap2( document.getElementById( "googleMap" ) );
		
		document.getElementById( "googleMap" ).style.backgroundColor="white";
		document.getElementById( "googleMapLabelDetail" ).innerHTML = maptitle;
		
		map.setCenter( new GLatLng( x, y ), z );
		map.setMapType( G_HYBRID_MAP );
		//map.addControl( new GSmallMapControl() );
		map.addControl( new GMapTypeControl() );
		map.addControl( new GScaleControl(50) );
		map.enableScrollWheelZoom();
		
		var tooltip = document.createElement( "div" );
		document.getElementById( "googleMap" ).appendChild( tooltip );
		tooltip.style.visibility="hidden";
		
        function markerIcon( type_id, dim_x, dim_y, anchor_x, anchor_y )
        {
        	var icon = new GIcon();
			icon.image = "http://www.argos-yachting.de/images/marker_"+type_id+".png";
			icon.iconSize = new GSize( dim_x, dim_y );
			icon.iconAnchor = new GPoint( anchor_x, anchor_y );
			icon.infoWindowAnchor = new GPoint( 5, 1 );
			return icon;
        }
                
        function createMarker( coords, zoom, type_id, dim_x, dim_y, anchor_x, anchor_y, html )
        {
        	var marker = new GMarker( coords, markerIcon( type_id, dim_x, dim_y, anchor_x, anchor_y ) );
        	
        	marker.tooltip = '<div class="googleMapTooltip"><p>'+html+'</p></div>';
        	
			GEvent.addListener( marker, "click", function()
			{
				tooltip.style.visibility="hidden"
				map.setCenter( coords );
				map.setZoom( zoom );
			} );
			
			GEvent.addListener( marker, "mouseover", function()
			{
				showTooltip( marker );
			} );
			
			GEvent.addListener( marker, "mouseout", function()
			{
				tooltip.style.visibility="hidden"
			} );

			return marker;
		}
				
		// initialize variables
		var gmarkers = new Array();
		var oceans = new Array();
		var harbours = new Array();
		var locations = new Array();
		
		harbours[0] = new Object();
harbours[0]['name'] = 'Agropoli<br><ul><li>Kiriacoulis</li></ul>';
harbours[0]['google_x'] = Number(40.35164631606427);
harbours[0]['google_y'] = Number(14.983377456665039);
harbours[0]['google_z'] = Number(14);
harbours[0]['type_id'] = '0';
harbours[0]['dim_x'] = 10;
harbours[0]['dim_y'] = 10;
harbours[0]['anchor_x'] = 1;
harbours[0]['anchor_y'] = 1;
harbours[0]['shown'] = true;
harbours[1] = new Object();
harbours[1]['name'] = 'Alghero (Marina di Alghero)<br><ul><li>North Sardinia Sail</li><li>Wind Sardinya Sail</li></ul>';
harbours[1]['google_x'] = Number(40.5621340004699);
harbours[1]['google_y'] = Number(8.311758041381836);
harbours[1]['google_z'] = Number(14);
harbours[1]['type_id'] = '0';
harbours[1]['dim_x'] = 10;
harbours[1]['dim_y'] = 10;
harbours[1]['anchor_x'] = 1;
harbours[1]['anchor_y'] = 1;
harbours[1]['shown'] = true;
harbours[2] = new Object();
harbours[2]['name'] = 'Cagliari (Marina del Sole)';
harbours[2]['google_x'] = Number(39.2020298985819);
harbours[2]['google_y'] = Number(9.125787019729614);
harbours[2]['google_z'] = Number(17);
harbours[2]['type_id'] = '0';
harbours[2]['dim_x'] = 10;
harbours[2]['dim_y'] = 10;
harbours[2]['anchor_x'] = 1;
harbours[2]['anchor_y'] = 1;
harbours[2]['shown'] = true;
harbours[3] = new Object();
harbours[3]['name'] = 'Cala Galera';
harbours[3]['google_x'] = Number(42.396079701288315);
harbours[3]['google_y'] = Number(11.207084655761719);
harbours[3]['google_z'] = Number(13);
harbours[3]['type_id'] = '0';
harbours[3]['dim_x'] = 10;
harbours[3]['dim_y'] = 10;
harbours[3]['anchor_x'] = 1;
harbours[3]['anchor_y'] = 1;
harbours[3]['shown'] = true;
harbours[4] = new Object();
harbours[4]['name'] = 'Cannigione<br><ul><li>43Â° Parallelo</li><li>Moorings</li><li>Sail Italia</li><li>Sailor\\\'s Center</li><li>Sardinia Yachting</li></ul>';
harbours[4]['google_x'] = Number(41.10661620244698);
harbours[4]['google_y'] = Number(9.44249153137207);
harbours[4]['google_z'] = Number(15);
harbours[4]['type_id'] = '0';
harbours[4]['dim_x'] = 10;
harbours[4]['dim_y'] = 10;
harbours[4]['anchor_x'] = 1;
harbours[4]['anchor_y'] = 1;
harbours[4]['shown'] = true;
harbours[5] = new Object();
harbours[5]['name'] = 'Carloforte<br><ul><li>Carloforte Sail</li></ul>';
harbours[5]['google_x'] = Number(39.14297561414161);
harbours[5]['google_y'] = Number(8.311843872070312);
harbours[5]['google_z'] = Number(14);
harbours[5]['type_id'] = '0';
harbours[5]['dim_x'] = 10;
harbours[5]['dim_y'] = 10;
harbours[5]['anchor_x'] = 1;
harbours[5]['anchor_y'] = 1;
harbours[5]['shown'] = true;
harbours[6] = new Object();
harbours[6]['name'] = 'Castellammare di Stabia<br><ul><li>Vela Charter</li></ul>';
harbours[6]['google_x'] = Number(40.69274368477265);
harbours[6]['google_y'] = Number(14.470968246459961);
harbours[6]['google_z'] = Number(14);
harbours[6]['type_id'] = '0';
harbours[6]['dim_x'] = 10;
harbours[6]['dim_y'] = 10;
harbours[6]['anchor_x'] = 1;
harbours[6]['anchor_y'] = 1;
harbours[6]['shown'] = true;
harbours[7] = new Object();
harbours[7]['name'] = 'Castiglioncello<br><ul><li>North Sardinia Sail</li><li>Sailor.Tex</li></ul>';
harbours[7]['google_x'] = Number(43.394165177670445);
harbours[7]['google_y'] = Number(10.425167083740234);
harbours[7]['google_z'] = Number(15);
harbours[7]['type_id'] = '0';
harbours[7]['dim_x'] = 10;
harbours[7]['dim_y'] = 10;
harbours[7]['anchor_x'] = 1;
harbours[7]['anchor_y'] = 1;
harbours[7]['shown'] = true;
harbours[8] = new Object();
harbours[8]['name'] = 'Catania (Marina di Riposto)';
harbours[8]['google_x'] = Number(37.49413270543131);
harbours[8]['google_y'] = Number(15.095129013061523);
harbours[8]['google_z'] = Number(14);
harbours[8]['type_id'] = '0';
harbours[8]['dim_x'] = 10;
harbours[8]['dim_y'] = 10;
harbours[8]['anchor_x'] = 1;
harbours[8]['anchor_y'] = 1;
harbours[8]['shown'] = true;
harbours[9] = new Object();
harbours[9]['name'] = 'Cefalu';
harbours[9]['google_x'] = Number(38.039236094193356);
harbours[9]['google_y'] = Number(14.032716751098633);
harbours[9]['google_z'] = Number(14);
harbours[9]['type_id'] = '0';
harbours[9]['dim_x'] = 10;
harbours[9]['dim_y'] = 10;
harbours[9]['anchor_x'] = 1;
harbours[9]['anchor_y'] = 1;
harbours[9]['shown'] = true;
harbours[10] = new Object();
harbours[10]['name'] = 'Chiavari';
harbours[10]['google_x'] = Number(44.312303089286736);
harbours[10]['google_y'] = Number(9.322929382324219);
harbours[10]['google_z'] = Number(14);
harbours[10]['type_id'] = '0';
harbours[10]['dim_x'] = 10;
harbours[10]['dim_y'] = 10;
harbours[10]['anchor_x'] = 1;
harbours[10]['anchor_y'] = 1;
harbours[10]['shown'] = true;
harbours[11] = new Object();
harbours[11]['name'] = 'Elba (Portoferraio)<br><ul><li>Kiriacoulis</li></ul>';
harbours[11]['google_x'] = Number(42.808782715169244);
harbours[11]['google_y'] = Number(10.316462516784668);
harbours[11]['google_z'] = Number(15);
harbours[11]['type_id'] = '0';
harbours[11]['dim_x'] = 10;
harbours[11]['dim_y'] = 10;
harbours[11]['anchor_x'] = 1;
harbours[11]['anchor_y'] = 1;
harbours[11]['shown'] = true;
harbours[12] = new Object();
harbours[12]['name'] = 'Elba (Porto Azurro)';
harbours[12]['google_x'] = Number(42.76431161561805);
harbours[12]['google_y'] = Number(10.397100448608398);
harbours[12]['google_z'] = Number(16);
harbours[12]['type_id'] = '0';
harbours[12]['dim_x'] = 10;
harbours[12]['dim_y'] = 10;
harbours[12]['anchor_x'] = 1;
harbours[12]['anchor_y'] = 1;
harbours[12]['shown'] = true;
harbours[13] = new Object();
harbours[13]['name'] = 'Elba (Marciana Marina)<br><ul><li>Sailor.Tex</li></ul>';
harbours[13]['google_x'] = Number(42.808310456370585);
harbours[13]['google_y'] = Number(10.196514129638672);
harbours[13]['google_z'] = Number(16);
harbours[13]['type_id'] = '0';
harbours[13]['dim_x'] = 10;
harbours[13]['dim_y'] = 10;
harbours[13]['anchor_x'] = 1;
harbours[13]['anchor_y'] = 1;
harbours[13]['shown'] = true;
harbours[14] = new Object();
harbours[14]['name'] = 'Genua (Marina di Porto Antico)<br><ul><li>Sailor\\\'s Center</li></ul>';
harbours[14]['google_x'] = Number(44.4091367694858);
harbours[14]['google_y'] = Number(8.919610977172852);
harbours[14]['google_z'] = Number(14);
harbours[14]['type_id'] = '0';
harbours[14]['dim_x'] = 10;
harbours[14]['dim_y'] = 10;
harbours[14]['anchor_x'] = 1;
harbours[14]['anchor_y'] = 1;
harbours[14]['shown'] = true;
harbours[15] = new Object();
harbours[15]['name'] = 'Grado<br><ul><li>Kiriacoulis</li></ul>';
harbours[15]['google_x'] = Number(45.68201871407241);
harbours[15]['google_y'] = Number(13.377399444580078);
harbours[15]['google_z'] = Number(15);
harbours[15]['type_id'] = '0';
harbours[15]['dim_x'] = 10;
harbours[15]['dim_y'] = 10;
harbours[15]['anchor_x'] = 1;
harbours[15]['anchor_y'] = 1;
harbours[15]['shown'] = true;
harbours[16] = new Object();
harbours[16]['name'] = 'La Maddalena<br><ul><li>Sandalia Yachting</li></ul>';
harbours[16]['google_x'] = Number(41.21154394632066);
harbours[16]['google_y'] = Number(9.404404163360596);
harbours[16]['google_z'] = Number(16);
harbours[16]['type_id'] = '0';
harbours[16]['dim_x'] = 10;
harbours[16]['dim_y'] = 10;
harbours[16]['anchor_x'] = 1;
harbours[16]['anchor_y'] = 1;
harbours[16]['shown'] = true;
harbours[17] = new Object();
harbours[17]['name'] = 'La Spezia<br><ul><li>Sailor\\\'s Center</li></ul>';
harbours[17]['google_x'] = Number(44.10280296712115);
harbours[17]['google_y'] = Number(9.82703447341919);
harbours[17]['google_z'] = Number(17);
harbours[17]['type_id'] = '0';
harbours[17]['dim_x'] = 10;
harbours[17]['dim_y'] = 10;
harbours[17]['anchor_x'] = 1;
harbours[17]['anchor_y'] = 1;
harbours[17]['shown'] = true;
harbours[18] = new Object();
harbours[18]['name'] = 'Marsala<br><ul><li>Jonio Yachting</li><li>Kiriacoulis</li></ul>';
harbours[18]['google_x'] = Number(37.64794668685352);
harbours[18]['google_y'] = Number(12.582950592041016);
harbours[18]['google_z'] = Number(14);
harbours[18]['type_id'] = '0';
harbours[18]['dim_x'] = 10;
harbours[18]['dim_y'] = 10;
harbours[18]['anchor_x'] = 1;
harbours[18]['anchor_y'] = 1;
harbours[18]['shown'] = true;
harbours[19] = new Object();
harbours[19]['name'] = 'Milazzo (Porto Santa Maria Maggiore)<br><ul><li>Sailing Sicily</li></ul>';
harbours[19]['google_x'] = Number(38.23018254558458);
harbours[19]['google_y'] = Number(15.248701572418213);
harbours[19]['google_z'] = Number(17);
harbours[19]['type_id'] = '0';
harbours[19]['dim_x'] = 10;
harbours[19]['dim_y'] = 10;
harbours[19]['anchor_x'] = 1;
harbours[19]['anchor_y'] = 1;
harbours[19]['shown'] = true;
harbours[20] = new Object();
harbours[20]['name'] = 'Neapel (St. Lucia, Marina Darsena)<br><ul><li>Vela Charter</li></ul>';
harbours[20]['google_x'] = Number(40.82793650172552);
harbours[20]['google_y'] = Number(14.248967170715332);
harbours[20]['google_z'] = Number(15);
harbours[20]['type_id'] = '0';
harbours[20]['dim_x'] = 10;
harbours[20]['dim_y'] = 10;
harbours[20]['anchor_x'] = 1;
harbours[20]['anchor_y'] = 1;
harbours[20]['shown'] = true;
harbours[21] = new Object();
harbours[21]['name'] = 'Nettuno<br><ul><li>Marina Charter</li></ul>';
harbours[21]['google_x'] = Number(41.45511068498117);
harbours[21]['google_y'] = Number(12.661614418029785);
harbours[21]['google_z'] = Number(15);
harbours[21]['type_id'] = '0';
harbours[21]['dim_x'] = 10;
harbours[21]['dim_y'] = 10;
harbours[21]['anchor_x'] = 1;
harbours[21]['anchor_y'] = 1;
harbours[21]['shown'] = true;
harbours[22] = new Object();
harbours[22]['name'] = 'Olbia';
harbours[22]['google_x'] = Number(40.91117344279947);
harbours[22]['google_y'] = Number(9.574670791625977);
harbours[22]['google_z'] = Number(18);
harbours[22]['type_id'] = '0';
harbours[22]['dim_x'] = 10;
harbours[22]['dim_y'] = 10;
harbours[22]['anchor_x'] = 1;
harbours[22]['anchor_y'] = 1;
harbours[22]['shown'] = true;
harbours[23] = new Object();
harbours[23]['name'] = 'Palau<br><ul><li>Petag</li></ul>';
harbours[23]['google_x'] = Number(41.1794937844722);
harbours[23]['google_y'] = Number(9.385714530944824);
harbours[23]['google_z'] = Number(16);
harbours[23]['type_id'] = '0';
harbours[23]['dim_x'] = 10;
harbours[23]['dim_y'] = 10;
harbours[23]['anchor_x'] = 1;
harbours[23]['anchor_y'] = 1;
harbours[23]['shown'] = true;
harbours[24] = new Object();
harbours[24]['name'] = 'Palermo (Marina di Villa Igiea)<br><ul><li>Moorings</li><li>Sail Italia</li><li>Sailing Sicily</li><li>Sunsail</li><li>Vela Charter</li><li>Velasud</li></ul>';
harbours[24]['google_x'] = Number(38.143248129069946);
harbours[24]['google_y'] = Number(13.370425701141357);
harbours[24]['google_z'] = Number(16);
harbours[24]['type_id'] = '0';
harbours[24]['dim_x'] = 10;
harbours[24]['dim_y'] = 10;
harbours[24]['anchor_x'] = 1;
harbours[24]['anchor_y'] = 1;
harbours[24]['shown'] = true;
harbours[25] = new Object();
harbours[25]['name'] = 'Palermo (Isola delle Femmine)<br><ul><li>Marina Charter</li></ul>';
harbours[25]['google_x'] = Number(38.19960837048767);
harbours[25]['google_y'] = Number(13.248546123504639);
harbours[25]['google_z'] = Number(16);
harbours[25]['type_id'] = '0';
harbours[25]['dim_x'] = 10;
harbours[25]['dim_y'] = 10;
harbours[25]['anchor_x'] = 1;
harbours[25]['anchor_y'] = 1;
harbours[25]['shown'] = true;
harbours[26] = new Object();
harbours[26]['name'] = 'Palermo (Marina La Cala)<br><ul><li>Sea-Folk Charter</li></ul>';
harbours[26]['google_x'] = Number(38.11990517188392);
harbours[26]['google_y'] = Number(13.36812973022461);
harbours[26]['google_z'] = Number(16);
harbours[26]['type_id'] = '0';
harbours[26]['dim_x'] = 10;
harbours[26]['dim_y'] = 10;
harbours[26]['anchor_x'] = 1;
harbours[26]['anchor_y'] = 1;
harbours[26]['shown'] = true;
harbours[27] = new Object();
harbours[27]['name'] = 'Palermo (Club Nautico Vincenzo Florio)<br><ul><li>Dream Yacht Charter</li></ul>';
harbours[27]['google_x'] = Number(38.15081653048068);
harbours[27]['google_y'] = Number(13.37510347366333);
harbours[27]['google_z'] = Number(17);
harbours[27]['type_id'] = '0';
harbours[27]['dim_x'] = 10;
harbours[27]['dim_y'] = 10;
harbours[27]['anchor_x'] = 1;
harbours[27]['anchor_y'] = 1;
harbours[27]['shown'] = true;
harbours[28] = new Object();
harbours[28]['name'] = 'Pescara';
harbours[28]['google_x'] = Number(42.46745933458721);
harbours[28]['google_y'] = Number(14.231092929840088);
harbours[28]['google_z'] = Number(16);
harbours[28]['type_id'] = '0';
harbours[28]['dim_x'] = 10;
harbours[28]['dim_y'] = 10;
harbours[28]['anchor_x'] = 1;
harbours[28]['anchor_y'] = 1;
harbours[28]['shown'] = true;
harbours[29] = new Object();
harbours[29]['name'] = 'Portisco<br><ul><li>Boomerang</li><li>Cruising Charter</li><li>Europe Sail</li><li>Kiriacoulis</li><li>North Sardinia Sail</li></ul>';
harbours[29]['google_x'] = Number(41.033544344674254);
harbours[29]['google_y'] = Number(9.524052143096924);
harbours[29]['google_z'] = Number(16);
harbours[29]['type_id'] = '0';
harbours[29]['dim_x'] = 10;
harbours[29]['dim_y'] = 10;
harbours[29]['anchor_x'] = 1;
harbours[29]['anchor_y'] = 1;
harbours[29]['shown'] = true;
harbours[30] = new Object();
harbours[30]['name'] = 'Portisco (Cala dei Sardi)';
harbours[30]['google_x'] = Number(41.02731241427712);
harbours[30]['google_y'] = Number(9.51991081237793);
harbours[30]['google_z'] = Number(14);
harbours[30]['type_id'] = '0';
harbours[30]['dim_x'] = 10;
harbours[30]['dim_y'] = 10;
harbours[30]['anchor_x'] = 1;
harbours[30]['anchor_y'] = 1;
harbours[30]['shown'] = true;
harbours[31] = new Object();
harbours[31]['name'] = 'Porto Rotondo';
harbours[31]['google_x'] = Number(41.029125400322236);
harbours[31]['google_y'] = Number(9.54535961151123);
harbours[31]['google_z'] = Number(16);
harbours[31]['type_id'] = '0';
harbours[31]['dim_x'] = 10;
harbours[31]['dim_y'] = 10;
harbours[31]['anchor_x'] = 1;
harbours[31]['anchor_y'] = 1;
harbours[31]['shown'] = true;
harbours[32] = new Object();
harbours[32]['name'] = 'Portorosa<br><ul><li>Il Gabbiano</li><li>Jonio Yachting</li><li>Spartivento</li><li>Sunsicily</li></ul>';
harbours[32]['google_x'] = Number(38.12361893987304);
harbours[32]['google_y'] = Number(15.112853050231934);
harbours[32]['google_z'] = Number(15);
harbours[32]['type_id'] = '0';
harbours[32]['dim_x'] = 10;
harbours[32]['dim_y'] = 10;
harbours[32]['anchor_x'] = 1;
harbours[32]['anchor_y'] = 1;
harbours[32]['shown'] = true;
harbours[33] = new Object();
harbours[33]['name'] = 'Pozzuoli (Porto di Baia)';
harbours[33]['google_x'] = Number(40.82657262057348);
harbours[33]['google_y'] = Number(14.116573333740234);
harbours[33]['google_z'] = Number(14);
harbours[33]['type_id'] = '0';
harbours[33]['dim_x'] = 10;
harbours[33]['dim_y'] = 10;
harbours[33]['anchor_x'] = 1;
harbours[33]['anchor_y'] = 1;
harbours[33]['shown'] = true;
harbours[34] = new Object();
harbours[34]['name'] = 'Procida (Marina Chiaiolella)<br><ul><li>Spartivento</li></ul>';
harbours[34]['google_x'] = Number(40.74816730666263);
harbours[34]['google_y'] = Number(14.0055513381958);
harbours[34]['google_z'] = Number(16);
harbours[34]['type_id'] = '0';
harbours[34]['dim_x'] = 10;
harbours[34]['dim_y'] = 10;
harbours[34]['anchor_x'] = 1;
harbours[34]['anchor_y'] = 1;
harbours[34]['shown'] = true;
harbours[35] = new Object();
harbours[35]['name'] = 'Procida (Marina di Procida)<br><ul><li>Moorings</li><li>Sail Italia</li></ul>';
harbours[35]['google_x'] = Number(40.76625780558834);
harbours[35]['google_y'] = Number(14.031751155853271);
harbours[35]['google_z'] = Number(16);
harbours[35]['type_id'] = '0';
harbours[35]['dim_x'] = 10;
harbours[35]['dim_y'] = 10;
harbours[35]['anchor_x'] = 1;
harbours[35]['anchor_y'] = 1;
harbours[35]['shown'] = true;
harbours[36] = new Object();
harbours[36]['name'] = 'Punta Ala (Marina di Punta Ala)<br><ul><li>Controvento</li><li>Kiriacoulis</li></ul>';
harbours[36]['google_x'] = Number(42.8052564290912);
harbours[36]['google_y'] = Number(10.734672546386719);
harbours[36]['google_z'] = Number(15);
harbours[36]['type_id'] = '0';
harbours[36]['dim_x'] = 10;
harbours[36]['dim_y'] = 10;
harbours[36]['anchor_x'] = 1;
harbours[36]['anchor_y'] = 1;
harbours[36]['shown'] = true;
harbours[37] = new Object();
harbours[37]['name'] = 'Reggio<br><ul><li>Spartivento</li></ul>';
harbours[37]['google_x'] = Number(38.12466551309718);
harbours[37]['google_y'] = Number(15.650625228881836);
harbours[37]['google_z'] = Number(15);
harbours[37]['type_id'] = '0';
harbours[37]['dim_x'] = 10;
harbours[37]['dim_y'] = 10;
harbours[37]['anchor_x'] = 1;
harbours[37]['anchor_y'] = 1;
harbours[37]['shown'] = true;
harbours[38] = new Object();
harbours[38]['name'] = 'Rio Marina';
harbours[38]['google_x'] = Number(42.81448102041831);
harbours[38]['google_y'] = Number(10.430316925048828);
harbours[38]['google_z'] = Number(14);
harbours[38]['type_id'] = '0';
harbours[38]['dim_x'] = 10;
harbours[38]['dim_y'] = 10;
harbours[38]['anchor_x'] = 1;
harbours[38]['anchor_y'] = 1;
harbours[38]['shown'] = true;
harbours[39] = new Object();
harbours[39]['name'] = 'Salerno<br><ul><li>Breeze Yachting</li><li>Eva Mare</li><li>Marina Charter</li></ul>';
harbours[39]['google_x'] = Number(40.671264391515514);
harbours[39]['google_y'] = Number(14.747943878173828);
harbours[39]['google_z'] = Number(13);
harbours[39]['type_id'] = '0';
harbours[39]['dim_x'] = 10;
harbours[39]['dim_y'] = 10;
harbours[39]['anchor_x'] = 1;
harbours[39]['anchor_y'] = 1;
harbours[39]['shown'] = true;
harbours[40] = new Object();
harbours[40]['name'] = 'Salivoli<br><ul><li>Gruppo Nautico Italiano</li><li>Time Charter</li></ul>';
harbours[40]['google_x'] = Number(42.93097632881716);
harbours[40]['google_y'] = Number(10.506448745727539);
harbours[40]['google_z'] = Number(14);
harbours[40]['type_id'] = '0';
harbours[40]['dim_x'] = 10;
harbours[40]['dim_y'] = 10;
harbours[40]['anchor_x'] = 1;
harbours[40]['anchor_y'] = 1;
harbours[40]['shown'] = true;
harbours[41] = new Object();
harbours[41]['name'] = 'San Vincenzo (Marina di San Vincenzo)';
harbours[41]['google_x'] = Number(43.10076353315865);
harbours[41]['google_y'] = Number(10.53736925125122);
harbours[41]['google_z'] = Number(16);
harbours[41]['type_id'] = '0';
harbours[41]['dim_x'] = 10;
harbours[41]['dim_y'] = 10;
harbours[41]['anchor_x'] = 1;
harbours[41]['anchor_y'] = 1;
harbours[41]['shown'] = true;
harbours[42] = new Object();
harbours[42]['name'] = 'San Vito lo Capo';
harbours[42]['google_x'] = Number(38.18085457777227);
harbours[42]['google_y'] = Number(12.733261585235596);
harbours[42]['google_z'] = Number(16);
harbours[42]['type_id'] = '0';
harbours[42]['dim_x'] = 10;
harbours[42]['dim_y'] = 10;
harbours[42]['anchor_x'] = 1;
harbours[42]['anchor_y'] = 1;
harbours[42]['shown'] = true;
harbours[43] = new Object();
harbours[43]['name'] = 'Sant`Agata di Militello<br><ul><li>Kiriacoulis</li></ul>';
harbours[43]['google_x'] = Number(38.07218333885628);
harbours[43]['google_y'] = Number(14.62155818939209);
harbours[43]['google_z'] = Number(15);
harbours[43]['type_id'] = '0';
harbours[43]['dim_x'] = 10;
harbours[43]['dim_y'] = 10;
harbours[43]['anchor_x'] = 1;
harbours[43]['anchor_y'] = 1;
harbours[43]['shown'] = true;
harbours[44] = new Object();
harbours[44]['name'] = 'Santa Teresa di Gallura (Port Santa Teresa di Gallura)';
harbours[44]['google_x'] = Number(41.235268712631694);
harbours[44]['google_y'] = Number(9.193475246429443);
harbours[44]['google_z'] = Number(16);
harbours[44]['type_id'] = '0';
harbours[44]['dim_x'] = 10;
harbours[44]['dim_y'] = 10;
harbours[44]['anchor_x'] = 1;
harbours[44]['anchor_y'] = 1;
harbours[44]['shown'] = true;
harbours[45] = new Object();
harbours[45]['name'] = 'Santo Stefano Al Mare (Marina degli Aregai)';
harbours[45]['google_x'] = Number(43.83805573980301);
harbours[45]['google_y'] = Number(7.911272048950195);
harbours[45]['google_z'] = Number(14);
harbours[45]['type_id'] = '0';
harbours[45]['dim_x'] = 10;
harbours[45]['dim_y'] = 10;
harbours[45]['anchor_x'] = 1;
harbours[45]['anchor_y'] = 1;
harbours[45]['shown'] = true;
harbours[46] = new Object();
harbours[46]['name'] = 'Scarlino (Marina di Scarlino)<br><ul><li>43Â° Parallelo</li><li>Kiriacoulis</li></ul>';
harbours[46]['google_x'] = Number(42.88498947261718);
harbours[46]['google_y'] = Number(10.782995223999023);
harbours[46]['google_z'] = Number(15);
harbours[46]['type_id'] = '0';
harbours[46]['dim_x'] = 10;
harbours[46]['dim_y'] = 10;
harbours[46]['anchor_x'] = 1;
harbours[46]['anchor_y'] = 1;
harbours[46]['shown'] = true;
harbours[47] = new Object();
harbours[47]['name'] = 'Syrakus<br><ul><li>Jonio Yachting</li></ul>';
harbours[47]['google_x'] = Number(37.06483466202545);
harbours[47]['google_y'] = Number(15.29120922088623);
harbours[47]['google_z'] = Number(15);
harbours[47]['type_id'] = '0';
harbours[47]['dim_x'] = 10;
harbours[47]['dim_y'] = 10;
harbours[47]['anchor_x'] = 1;
harbours[47]['anchor_y'] = 1;
harbours[47]['shown'] = true;
harbours[48] = new Object();
harbours[48]['name'] = 'Trapani (Marina Trapani)<br><ul><li>Sailing Sicily</li><li>Sailor\\\'s Center</li></ul>';
harbours[48]['google_x'] = Number(38.015302031321795);
harbours[48]['google_y'] = Number(12.498149871826172);
harbours[48]['google_z'] = Number(13);
harbours[48]['type_id'] = '0';
harbours[48]['dim_x'] = 10;
harbours[48]['dim_y'] = 10;
harbours[48]['anchor_x'] = 1;
harbours[48]['anchor_y'] = 1;
harbours[48]['shown'] = true;
harbours[49] = new Object();
harbours[49]['name'] = 'Trieste (Porto San Rocco)';
harbours[49]['google_x'] = Number(45.6082735094011);
harbours[49]['google_y'] = Number(13.753166198730469);
harbours[49]['google_z'] = Number(15);
harbours[49]['type_id'] = '0';
harbours[49]['dim_x'] = 10;
harbours[49]['dim_y'] = 10;
harbours[49]['anchor_x'] = 1;
harbours[49]['anchor_y'] = 1;
harbours[49]['shown'] = true;
harbours[50] = new Object();
harbours[50]['name'] = 'Tropea (Porto di Tropea)<br><ul><li>Marina Charter</li><li>Moorings</li><li>Sail Italia</li><li>Sunsail</li></ul>';
harbours[50]['google_x'] = Number(38.68092021907524);
harbours[50]['google_y'] = Number(15.903997421264648);
harbours[50]['google_z'] = Number(15);
harbours[50]['type_id'] = '0';
harbours[50]['dim_x'] = 10;
harbours[50]['dim_y'] = 10;
harbours[50]['anchor_x'] = 1;
harbours[50]['anchor_y'] = 1;
harbours[50]['shown'] = true;
harbours[51] = new Object();
harbours[51]['name'] = 'Viareggio<br><ul><li>Gruppo Nautico Italiano</li></ul>';
harbours[51]['google_x'] = Number(43.85996775065339);
harbours[51]['google_y'] = Number(10.241146087646484);
harbours[51]['google_z'] = Number(14);
harbours[51]['type_id'] = '0';
harbours[51]['dim_x'] = 10;
harbours[51]['dim_y'] = 10;
harbours[51]['anchor_x'] = 1;
harbours[51]['anchor_y'] = 1;
harbours[51]['shown'] = true;
harbours[52] = new Object();
harbours[52]['name'] = 'Vibo Valentia<br><ul><li>Breeze Yachting</li><li>Eva Mare</li></ul>';
harbours[52]['google_x'] = Number(38.718465403583835);
harbours[52]['google_y'] = Number(16.126384735107422);
harbours[52]['google_z'] = Number(14);
harbours[52]['type_id'] = '0';
harbours[52]['dim_x'] = 10;
harbours[52]['dim_y'] = 10;
harbours[52]['anchor_x'] = 1;
harbours[52]['anchor_y'] = 1;
harbours[52]['shown'] = true;
locations[0] = new Object();
locations[0]['name'] = 'Reggio (REG)';
locations[0]['google_x'] = Number(38.073027944964025);
locations[0]['google_y'] = Number(15.649251937866211);
locations[0]['google_z'] = Number(12);
locations[0]['type_id'] = '2';
locations[0]['dim_x'] = 10;
locations[0]['dim_y'] = 10;
locations[0]['anchor_x'] = 1;
locations[0]['anchor_y'] = 1;
locations[0]['shown'] = true;
locations[1] = new Object();
locations[1]['name'] = 'Genova (GOA)';
locations[1]['google_x'] = Number(44.413060740559715);
locations[1]['google_y'] = Number(8.842105865478516);
locations[1]['google_z'] = Number(13);
locations[1]['type_id'] = '2';
locations[1]['dim_x'] = 10;
locations[1]['dim_y'] = 10;
locations[1]['anchor_x'] = 1;
locations[1]['anchor_y'] = 1;
locations[1]['shown'] = true;
locations[2] = new Object();
locations[2]['name'] = 'Pisa (PSA)';
locations[2]['google_x'] = Number(43.68612212154748);
locations[2]['google_y'] = Number(10.394096374511719);
locations[2]['google_z'] = Number(13);
locations[2]['type_id'] = '2';
locations[2]['dim_x'] = 10;
locations[2]['dim_y'] = 10;
locations[2]['anchor_x'] = 1;
locations[2]['anchor_y'] = 1;
locations[2]['shown'] = true;
locations[3] = new Object();
locations[3]['name'] = 'Roma (FCO)';
locations[3]['google_x'] = Number(41.80458998739727);
locations[3]['google_y'] = Number(12.250099182128906);
locations[3]['google_z'] = Number(12);
locations[3]['type_id'] = '2';
locations[3]['dim_x'] = 10;
locations[3]['dim_y'] = 10;
locations[3]['anchor_x'] = 1;
locations[3]['anchor_y'] = 1;
locations[3]['shown'] = true;
locations[4] = new Object();
locations[4]['name'] = 'NEAPEL (NAP)';
locations[4]['google_x'] = Number(40.885356402250665);
locations[4]['google_y'] = Number(14.289779663085938);
locations[4]['google_z'] = Number(13);
locations[4]['type_id'] = '2';
locations[4]['dim_x'] = 10;
locations[4]['dim_y'] = 10;
locations[4]['anchor_x'] = 1;
locations[4]['anchor_y'] = 1;
locations[4]['shown'] = true;
locations[5] = new Object();
locations[5]['name'] = 'Lamezia Terme (SUF)';
locations[5]['google_x'] = Number(38.90559494983195);
locations[5]['google_y'] = Number(16.24251365661621);
locations[5]['google_z'] = Number(14);
locations[5]['type_id'] = '2';
locations[5]['dim_x'] = 10;
locations[5]['dim_y'] = 10;
locations[5]['anchor_x'] = 1;
locations[5]['anchor_y'] = 1;
locations[5]['shown'] = true;
locations[6] = new Object();
locations[6]['name'] = 'Catania (CTA)';
locations[6]['google_x'] = Number(37.46845481412109);
locations[6]['google_y'] = Number(15.065689086914062);
locations[6]['google_z'] = Number(14);
locations[6]['type_id'] = '2';
locations[6]['dim_x'] = 10;
locations[6]['dim_y'] = 10;
locations[6]['anchor_x'] = 1;
locations[6]['anchor_y'] = 1;
locations[6]['shown'] = true;
locations[7] = new Object();
locations[7]['name'] = 'Palermo (PMO)';
locations[7]['google_x'] = Number(38.18031482880816);
locations[7]['google_y'] = Number(13.103599548339844);
locations[7]['google_z'] = Number(16);
locations[7]['type_id'] = '2';
locations[7]['dim_x'] = 10;
locations[7]['dim_y'] = 10;
locations[7]['anchor_x'] = 1;
locations[7]['anchor_y'] = 1;
locations[7]['shown'] = true;
locations[8] = new Object();
locations[8]['name'] = 'Trieste (TRS)';
locations[8]['google_x'] = Number(45.82437334138373);
locations[8]['google_y'] = Number(13.467864990234375);
locations[8]['google_z'] = Number(13);
locations[8]['type_id'] = '2';
locations[8]['dim_x'] = 10;
locations[8]['dim_y'] = 10;
locations[8]['anchor_x'] = 1;
locations[8]['anchor_y'] = 1;
locations[8]['shown'] = true;
locations[9] = new Object();
locations[9]['name'] = 'Olbia (OLB)';
locations[9]['google_x'] = Number(40.898592594272095);
locations[9]['google_y'] = Number(9.517250061035156);
locations[9]['google_z'] = Number(14);
locations[9]['type_id'] = '2';
locations[9]['dim_x'] = 10;
locations[9]['dim_y'] = 10;
locations[9]['anchor_x'] = 1;
locations[9]['anchor_y'] = 1;
locations[9]['shown'] = true;
locations[10] = new Object();
locations[10]['name'] = 'Alghero (AHO)';
locations[10]['google_x'] = Number(40.63128146990611);
locations[10]['google_y'] = Number(8.29244613647461);
locations[10]['google_z'] = Number(13);
locations[10]['type_id'] = '2';
locations[10]['dim_x'] = 10;
locations[10]['dim_y'] = 10;
locations[10]['anchor_x'] = 1;
locations[10]['anchor_y'] = 1;
locations[10]['shown'] = true;
locations[11] = new Object();
locations[11]['name'] = 'Cagliari (CAG)';
locations[11]['google_x'] = Number(39.251530699536815);
locations[11]['google_y'] = Number(9.051876068115234);
locations[11]['google_z'] = Number(13);
locations[11]['type_id'] = '2';
locations[11]['dim_x'] = 10;
locations[11]['dim_y'] = 10;
locations[11]['anchor_x'] = 1;
locations[11]['anchor_y'] = 1;
locations[11]['shown'] = true;
locations[12] = new Object();
locations[12]['name'] = 'Riposto';
locations[12]['google_x'] = Number(37.73101392714009);
locations[12]['google_y'] = Number(15.208940505981445);
locations[12]['google_z'] = Number(15);
locations[12]['type_id'] = '1';
locations[12]['dim_x'] = 10;
locations[12]['dim_y'] = 10;
locations[12]['anchor_x'] = 1;
locations[12]['anchor_y'] = 1;
locations[12]['shown'] = true;
			
		function getMarkers( array_name )
		{
			var batch = [];
			
			// loop through all locations and set markers
			for( var i=0; i < array_name.length; i++ )
			{
				if( array_name[i].google_x && array_name[i].google_y )
				{
					var coords = new GLatLng( array_name[i].google_x, array_name[i].google_y );
					batch.push( createMarker( coords, array_name[i].google_z, array_name[i].type_id, array_name[i].dim_x, array_name[i].dim_y, array_name[i].anchor_x, array_name[i].anchor_y, array_name[i].name ) );
				}
			}
			
			return batch;
		}
		
		function setupMarkers() 
		{
			mgr = new GMarkerManager( map );
			
			mgr.addMarkers( getMarkers( oceans ), 0 );
			mgr.addMarkers( getMarkers( harbours ), 6 );
			mgr.addMarkers( getMarkers( locations ), 8, 14 );
						
			mgr.refresh();
		}
		
		window.setTimeout( setupMarkers, 0 );
		
		function showTooltip( marker )
		{
			tooltip.innerHTML = marker.tooltip;
			
			var point=map.getCurrentMapType().getProjection().fromLatLngToPixel( map.getBounds().getSouthWest(),map.getZoom() );
			var offset=map.getCurrentMapType().getProjection().fromLatLngToPixel( marker.getPoint(),map.getZoom() );
			var anchor=marker.getIcon().iconAnchor;
			var width=marker.getIcon().iconSize.width;
			var pos = new GControlPosition( G_ANCHOR_BOTTOM_LEFT, new GSize( offset.x - point.x - anchor.x + width,- offset.y + point.y +anchor.y ) ); 
			
			pos.apply(tooltip);
			
			tooltip.style.visibility="visible";
		}
		
		GEvent.addListener( map, "wheelup", function(p)
		{
		  if ( map.getZoomLevel() > 0 ) {
		    map.centerAndZoom(
		      p.scaleRelative( map.getCenterLatLng() ),
		      map.getZoomLevel() - 1
		    );
		  }
		} );
		
		GEvent.addListener( map, "wheeldown", function(p)
		{
		  if ( map.getZoomLevel() <= 16 )
		    map.centerAndZoom(
		      p.scaleRelative( map.getCenterLatLng(), -1 ),
		      map.getZoomLevel() + 1
		    );
		} );
		
		GEvent.addDomListener(map.getContainer(), "DOMMouseScroll",
		function(oEvent)
		{
			if( oEvent.preventDefault )
			oEvent.preventDefault();
		} ); 
		
		// things that happen when the map is moved - basically just for debugging and detecting the coordinates for locations
		GEvent.addListener( map, "moveend", function()
		{
			var center = map.getCenter();
			var zoom = map.getZoom();
			document.getElementById("googleMapLabelDetail").innerHTML = center.toString() + ' ' + zoom.toString();
        } );
	}
}