
/* 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'] = 'Baska Voda';
harbours[0]['google_x'] = Number(43.357855892655586);
harbours[0]['google_y'] = Number(16.947097778320312);
harbours[0]['google_z'] = Number(16);
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'] = 'Biograd (Marina Kornati)<br><ul><li>Euromarine</li><li>Euronautic</li><li>Kiriacoulis</li></ul>';
harbours[1]['google_x'] = Number(43.94110816034728);
harbours[1]['google_y'] = Number(15.44227123260498);
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'] = 'Dubrovnik (ACI-Marina)<br><ul><li>Adria Coral / Astarea</li><li>Adriatic Yacht Charter</li><li>Euromarine</li><li>Moorings</li><li>Sunsail</li><li>Waypoint</li></ul>';
harbours[2]['google_x'] = Number(42.67028821832636);
harbours[2]['google_y'] = Number(18.124394416809082);
harbours[2]['google_z'] = Number(15);
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'] = 'Kastel Gomilica (Marina Kastela)<br><ul><li>Adriatic Yacht Charter</li><li>Croatia Yachting</li><li>Jonathan Yachting</li><li>Navigare Yachting Adria</li><li>Sail Croatia</li></ul>';
harbours[3]['google_x'] = Number(43.54554643755894);
harbours[3]['google_y'] = Number(16.404669284820557);
harbours[3]['google_z'] = Number(16);
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'] = 'Krapanj Insel<br><ul><li>Sunsail</li></ul>';
harbours[4]['google_x'] = Number(43.6717208192937);
harbours[4]['google_y'] = Number(15.918331146240234);
harbours[4]['google_z'] = Number(13);
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'] = 'Krk (Marina Punat)<br><ul><li>Daranji Sailing</li></ul>';
harbours[5]['google_x'] = Number(45.03025648616513);
harbours[5]['google_y'] = Number(14.627652168273926);
harbours[5]['google_z'] = Number(15);
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'] = 'Krvavica (Marina Ramova)<br><ul><li>Kiriacoulis</li></ul>';
harbours[6]['google_x'] = Number(43.323803998456164);
harbours[6]['google_y'] = Number(16.982567310333252);
harbours[6]['google_z'] = Number(16);
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'] = 'Makarska';
harbours[7]['google_x'] = Number(43.294309185688);
harbours[7]['google_y'] = Number(17.01553702354431);
harbours[7]['google_z'] = Number(17);
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'] = 'Mali Losinj (Marina  Mali Losinj)<br><ul><li>Jadranka Yachting</li></ul>';
harbours[8]['google_x'] = Number(44.5439793026461);
harbours[8]['google_y'] = Number(14.46076512336731);
harbours[8]['google_z'] = Number(17);
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'] = 'Marina (Marina Agana)<br><ul><li>Moorings</li></ul>';
harbours[9]['google_x'] = Number(43.51326511856049);
harbours[9]['google_y'] = Number(16.11067771911621);
harbours[9]['google_z'] = Number(13);
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'] = 'Murter (Marina Betina)<br><ul><li>Kiriacoulis</li></ul>';
harbours[10]['google_x'] = Number(43.82722055773224);
harbours[10]['google_y'] = Number(15.599384307861328);
harbours[10]['google_z'] = Number(13);
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'] = 'Murter (Marina Hramina)<br><ul><li>Adriatic Yacht Charter</li><li>Marina Hramina</li></ul>';
harbours[11]['google_x'] = Number(43.826229814363515);
harbours[11]['google_y'] = Number(15.590715408325195);
harbours[11]['google_z'] = Number(14);
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'] = 'Murter (Marina Jezera)<br><ul><li>Waypoint</li></ul>';
harbours[12]['google_x'] = Number(43.784510796440685);
harbours[12]['google_y'] = Number(15.64453125);
harbours[12]['google_z'] = Number(15);
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'] = 'Pag';
harbours[13]['google_x'] = Number(44.44137909691852);
harbours[13]['google_y'] = Number(15.049896240234375);
harbours[13]['google_z'] = Number(12);
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'] = 'Pomer<br><ul><li>Adriatic Yacht Charter</li></ul>';
harbours[14]['google_x'] = Number(44.82288194762927);
harbours[14]['google_y'] = Number(13.902854919433594);
harbours[14]['google_z'] = Number(13);
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'] = 'Primosten (Marina Kremik)<br><ul><li>Mare Charter</li><li>Sunsail</li></ul>';
harbours[15]['google_x'] = Number(43.57053508595868);
harbours[15]['google_y'] = Number(15.941033363342285);
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'] = 'Pula (ACI Marina)<br><ul><li>Euromarine</li><li>Jonathan Yachting</li></ul>';
harbours[16]['google_x'] = Number(44.872659287013775);
harbours[16]['google_y'] = Number(13.84552001953125);
harbours[16]['google_z'] = Number(13);
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'] = 'Pula (Marina Veruda)<br><ul><li>Kiriacoulis</li><li>Sunsail</li><li>Waypoint</li></ul>';
harbours[17]['google_x'] = Number(44.84333359106424);
harbours[17]['google_y'] = Number(13.845176696777344);
harbours[17]['google_z'] = Number(13);
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'] = 'Pula (Marina Bunarina)<br><ul><li>Jonathan Yachting</li></ul>';
harbours[18]['google_x'] = Number(44.83943859949069);
harbours[18]['google_y'] = Number(13.83777379989624);
harbours[18]['google_z'] = Number(16);
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'] = 'Rogac (Insel Solta)<br><ul><li>Sailing Europe</li></ul>';
harbours[19]['google_x'] = Number(43.39564251136418);
harbours[19]['google_y'] = Number(16.29848599433899);
harbours[19]['google_z'] = Number(18);
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'] = 'Rogoznica (Marina Frapa)<br><ul><li>Ban Tours</li></ul>';
harbours[20]['google_x'] = Number(43.52901122623397);
harbours[20]['google_y'] = Number(15.964250564575195);
harbours[20]['google_z'] = Number(13);
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'] = 'Rovinj<br><ul><li>Waypoint</li></ul>';
harbours[21]['google_x'] = Number(45.07594509664094);
harbours[21]['google_y'] = Number(13.634891510009765);
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'] = 'Sibenik (Marina Mandalina)<br><ul><li>Dream Yacht Charter</li><li>ECOS Yachting</li><li>Foka Nautika</li><li>Navigare Yachting Adria</li><li>NCP-Charter</li><li>Performance Sailing</li><li>Veritas Yachting</li></ul>';
harbours[22]['google_x'] = Number(43.72707243917852);
harbours[22]['google_y'] = Number(15.895671844482422);
harbours[22]['google_z'] = Number(12);
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'] = 'Slano';
harbours[23]['google_x'] = Number(42.779023369211934);
harbours[23]['google_y'] = Number(17.880935668945312);
harbours[23]['google_z'] = Number(12);
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'] = 'Split (ACI-Marina)<br><ul><li>Adria Coral / Astarea</li><li>Euromarine</li></ul>';
harbours[24]['google_x'] = Number(43.50224662373913);
harbours[24]['google_y'] = Number(16.430375576019287);
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'] = 'Split (Marina Spinut)';
harbours[25]['google_x'] = Number(43.51510133881435);
harbours[25]['google_y'] = Number(16.41902446746826);
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'] = 'Split (Marina Mornar)';
harbours[26]['google_x'] = Number(43.50195090195632);
harbours[26]['google_y'] = Number(16.427628993988037);
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'] = 'Split (Marina Nava)<br><ul><li>Nautika Centar Nava</li></ul>';
harbours[27]['google_x'] = Number();
harbours[27]['google_y'] = Number();
harbours[27]['google_z'] = Number(0);
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'] = 'Sukosan (Marina Dalmacija)<br><ul><li>Asta Yachting</li><li>Kroki</li><li>MIR-AMO</li></ul>';
harbours[28]['google_x'] = Number(44.054161173449636);
harbours[28]['google_y'] = Number(15.299406051635742);
harbours[28]['google_z'] = Number(15);
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'] = 'Trogir (ACI-Marina)<br><ul><li>ECOS Yachting</li><li>Jonathan Yachting</li><li>Kiriacoulis</li><li>Waypoint</li></ul>';
harbours[29]['google_x'] = Number(43.514245480393654);
harbours[29]['google_y'] = Number(16.24948740005493);
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'] = 'Trogir (Seget Martina)';
harbours[30]['google_x'] = Number(43.51733429408987);
harbours[30]['google_y'] = Number(16.227133870124817);
harbours[30]['google_z'] = Number(18);
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'] = 'Vinisce';
harbours[31]['google_x'] = Number(43.48555942478365);
harbours[31]['google_y'] = Number(16.11419677734375);
harbours[31]['google_z'] = Number(13);
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'] = 'Zadar (Marina Vitrenjak)';
harbours[32]['google_x'] = Number(44.127105017813705);
harbours[32]['google_y'] = Number(15.215678215026855);
harbours[32]['google_z'] = Number(16);
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'] = 'Zadar (Marina Tankerkomerc)<br><ul><li>ECOS Yachting</li><li>Kiriacoulis</li></ul>';
harbours[33]['google_x'] = Number(44.1192493466422);
harbours[33]['google_y'] = Number(15.22903561592102);
harbours[33]['google_z'] = Number(16);
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;
locations[0] = new Object();
locations[0]['name'] = 'Split (SPU)';
locations[0]['google_x'] = Number(43.538656020980866);
locations[0]['google_y'] = Number(16.298561096191406);
locations[0]['google_z'] = Number(14);
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'] = 'Zadar (ZAD)';
locations[1]['google_x'] = Number(44.10866564416913);
locations[1]['google_y'] = Number(15.34292221069336);
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'] = 'Dubrovnik (DBV)';
locations[2]['google_x'] = Number(42.557379595507584);
locations[2]['google_y'] = Number(18.263568878173828);
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'] = 'Rijeka (RJK)';
locations[3]['google_x'] = Number(45.217961503940685);
locations[3]['google_y'] = Number(14.566497802734375);
locations[3]['google_z'] = Number(13);
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'] = 'Pula (PUY)';
locations[4]['google_x'] = Number(44.89272843238244);
locations[4]['google_y'] = Number(13.922595977783203);
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'] = 'Zagreb (ZAG)';
locations[5]['google_x'] = Number(45.741412212759705);
locations[5]['google_y'] = Number(16.067333221435547);
locations[5]['google_z'] = Number(13);
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'] = 'Triest (TRS)';
locations[6]['google_x'] = Number(45.82736386003367);
locations[6]['google_y'] = Number(13.466663360595703);
locations[6]['google_z'] = Number(13);
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;
			
		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();
        } );
	}
}