
googleMap = true;

var map;
var baseIcon;
var gmarkers = [];
var htmls = [];
function ShowMap(){
	var bounds = new GLatLngBounds();

	map = new GMap2(document.getElementById("map"));
	map.setCenter(new GLatLng(38.97329,1.39389), 11);
	map.addControl(new GLargeMapControl());
	map.addControl(new GMapTypeControl());

	baseIcon = new GIcon();
	baseIcon.image = "../Images/Markers/marker.png";
	baseIcon.shadow = "../Images/Markers/shadow50.png";
	baseIcon.iconSize = new GSize(20, 34);
	baseIcon.shadowSize = new GSize(37, 34);
	baseIcon.iconAnchor = new GPoint(9, 34);
	baseIcon.infoWindowAnchor = new GPoint(9, 2);
	baseIcon.infoShadowAnchor = new GPoint(18, 25);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(38.910003,1.430025);
	bounds.extend(point);
	var marker = createMarker(point, "Ibiza Town", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Ibiza Town</b><br/>Ibiza Town really is THE most fascinating part of the island, day or night.<br>Here you will see, in glorious living colour, a concentration of all the<br>attractions and eccentricities which have made Ibiza world famous.</p>", 1);
	gmarkers[0] = marker;
	htmls[0] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Ibiza Town</b><br/>Ibiza Town really is THE most fascinating part of the island, day or night.<br>Here you will see, in glorious living colour, a concentration of all the<br>attractions and eccentricities which have made Ibiza world famous.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(38.973423,1.300936);
	bounds.extend(point);
	var marker = createMarker(point, "San Antonio", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>San Antonio</b><br>One of the most popular places on the island of Ibiza, split into three main sections;<br>the town 'Westend', The Bay 'Cala De Bou', and Sunset Strip 'Ses variades'. Most<br>people tend to visit the very popular West End and well publicised. Some people<br>never venture very far from there, but you should take the time to make a visit to<br>San Antonios' other areas. The bay has a great selection of bars, restaurants and<br>hotels, stretching the full length of the Bay. The Sunset Strip has a great vibe and<br>ambient music to suit people of all ages.</p>", 2);
	gmarkers[1] = marker;
	htmls[1] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>San Antonio</b><br>One of the most popular places on the island of Ibiza, split into three main sections;<br>the town 'Westend', The Bay 'Cala De Bou', and Sunset Strip 'Ses variades'. Most<br>people tend to visit the very popular West End and well publicised. Some people<br>never venture very far from there, but you should take the time to make a visit to<br>San Antonios' other areas. The bay has a great selection of bars, restaurants and<br>hotels, stretching the full length of the Bay. The Sunset Strip has a great vibe and<br>ambient music to suit people of all ages.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(39.080345,1.440448);
	bounds.extend(point);
	var marker = createMarker(point, "Cave of Can Marca, Puerto de San Miguel Beach", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Cave of Can Marca, Puerto de San Miguel Beach</b><br>The C'an Marca Caves are located on the north end of the Ibiza island by<br>the Puerto de San Miguel Beach.  The views are fabulous as you walk<br>down the steeps steps to the cave entrance. Inside it is a there are many<br>levels of damp golden walls, lined with stalagtites and stalagmites.</p>", 3);
	gmarkers[2] = marker;
	htmls[2] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Cave of Can Marca, Puerto de San Miguel Beach</b><br>The C'an Marca Caves are located on the north end of the Ibiza island by<br>the Puerto de San Miguel Beach.  The views are fabulous as you walk<br>down the steeps steps to the cave entrance. Inside it is a there are many<br>levels of damp golden walls, lined with stalagtites and stalagmites.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(38.907231,1.429553);
	bounds.extend(point);
	var marker = createMarker(point, "Museum of Archaeology & Necropolis Punica del Puig des Molins", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Museum of Archaeology & Necropolis Punica del Puig des Molins</b><br>The museum has one of the world's most important collections of Punic artefacts.<br>Next to the Museum, the huge necropolis dates back from the Punic era. It is one of<br>the biggest and best preserved necropolises in the Mediterranean area, containing<br>3500 hypogeums, some of which are visible, and you can clearly see the funeral<br>rites of this civilisation that was an important presence on the island.<p>", 4);
	gmarkers[3] = marker;
	htmls[3] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Museum of Archaeology & Necropolis Punica del Puig des Molins</b><br>The museum has one of the world's most important collections of Punic artefacts.<br>Next to the Museum, the huge necropolis dates back from the Punic era. It is one of<br>the biggest and best preserved necropolises in the Mediterranean area, containing<br>3500 hypogeums, some of which are visible, and you can clearly see the funeral<br>rites of this civilisation that was an important presence on the island.<p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(38.90433,1.453929);
	bounds.extend(point);
	var marker = createMarker(point, "Faro de Botafoc", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Faro de Botafoc</b><br>The Botafoc lighthouse is located just right of the beach as you head to Talamanca.<br>Once you have gone past the hotel area, you will arrive at the Calle de Botafoc, which<br>will take you straight to the lighthouse. From there you can enjoy the panoramic views,<br>especially impressive at night, of the walled city of Ibiza.</p>", 5);
	gmarkers[4] = marker;
	htmls[4] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Faro de Botafoc</b><br>The Botafoc lighthouse is located just right of the beach as you head to Talamanca.<br>Once you have gone past the hotel area, you will arrive at the Calle de Botafoc, which<br>will take you straight to the lighthouse. From there you can enjoy the panoramic views,<br>especially impressive at night, of the walled city of Ibiza.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(38.867647,1.198025);
	bounds.extend(point);
	var marker = createMarker(point, "Es Vedra", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Es Vedra</b><br>The Es Vedra rock rises 391 metres out of the sea and all those who see it (especially at sunset)<br>regard it as one of the most magical places on the island. If you want to get a closer view, you<br>can catch one of the boats from San Antonio that sails around the rock, and at the same time<br>you can also view the rocky isle Es Vedranell, just next to Es Vedra, which is 129 metres high.</p>", 6);
	gmarkers[5] = marker;
	htmls[5] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Es Vedra</b><br>The Es Vedra rock rises 391 metres out of the sea and all those who see it (especially at sunset)<br>regard it as one of the most magical places on the island. If you want to get a closer view, you<br>can catch one of the boats from San Antonio that sails around the rock, and at the same time<br>you can also view the rocky isle Es Vedranell, just next to Es Vedra, which is 129 metres high.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(38.906806,1.436602);
	bounds.extend(point);
	var marker = createMarker(point, "Catedral de Santa Maria de Ibiza", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Catedral de Santa Maria de Ibiza</b><br>Built as a church after the Catalan conquest in 1235, this cathedral can be<br>found at Dalt Vila, at the top of the old part of Ibiza. Part of the cathedral<br>was built in Gothic style (the bell tower and some of the chapels) and the<br>rest, in Baroque design. Among the Cathedral's most treasured<br>possessions is a monstrance made of silver and gold dating from 1399.</p>", 7);
	gmarkers[6] = marker;
	htmls[6] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Catedral de Santa Maria de Ibiza</b><br>Built as a church after the Catalan conquest in 1235, this cathedral can be<br>found at Dalt Vila, at the top of the old part of Ibiza. Part of the cathedral<br>was built in Gothic style (the bell tower and some of the chapels) and the<br>rest, in Baroque design. Among the Cathedral's most treasured<br>possessions is a monstrance made of silver and gold dating from 1399.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(38.911564,1.430755);
	bounds.extend(point);
	var marker = createMarker(point, "Can Ventosa", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Can Ventosa</b><br>The centre of the cultural activity in Ibiza city, located in the centre, and<br>run by the local council. It not only regularly puts on plays, concerts,<br>monologues, conferences, etc., but it is also a forum for debate, study<br>and discussion of any topic. The hall seats 400 people. Performances<br>usually begin at 9.30pm. On Saturdays and Sundays they have sessions<br>for children from 9am to 1.30pm.</p>", 8);
	gmarkers[7] = marker;
	htmls[7] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Can Ventosa</b><br>The centre of the cultural activity in Ibiza city, located in the centre, and<br>run by the local council. It not only regularly puts on plays, concerts,<br>monologues, conferences, etc., but it is also a forum for debate, study<br>and discussion of any topic. The hall seats 400 people. Performances<br>usually begin at 9.30pm. On Saturdays and Sundays they have sessions<br>for children from 9am to 1.30pm.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(38.909051,1.433544);
	bounds.extend(point);
	var marker = createMarker(point, "Monumento al General Vara de Rey", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Monumento al General Vara de Rey</b><br>The monument to General Vara de Rey is probably the most popular one on the island.<br>The statue of the General, who was born in Ibiza and died in the Cuban War, is an<br>image often used on postcards and posters. The statue stands on the main street<br>running through the centre of Ibiza city, which bears the General's name, and it was<br>unveiled by King Alfonso XIII in 1904.</p>", 9);
	gmarkers[8] = marker;
	htmls[8] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Monumento al General Vara de Rey</b><br>The statue of the General, who was born in Ibiza and died in the Cuban War, is an<br>image often used on postcards and posters. The statue stands on the main street<br>running through the centre of Ibiza city, which bears the General's name, and it was<br>unveiled by King Alfonso XIII in 1904.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(38.947503,1.408288);
	bounds.extend(point);
	var marker = createMarker(point, "Amnesia Nightclub", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Amnesia Nightclub</b><br>Awarded Best Global Club in the 2007 International Dance Music Awards for 2006.<br>The club is located close to the village of San Rafael on the highway between Sant<br>Antoni de Portmany and Ibiza Town and less than a kilometer apart from Privilege,<br>both among the island's most popular nightclubs. The club can pack more than<br>5,000 people on the dance floors.</p>", 10);
	gmarkers[9] = marker;
	htmls[9] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Amnesia Nightclub</b><br>Awarded Best Global Club in the 2007 International Dance Music Awards for 2006.<br>The club is located close to the village of San Rafael on the highway between Sant<br>Antoni de Portmany and Ibiza Town and less than a kilometer apart from Privilege,<br>both among the island's most popular nightclubs. The club can pack more than<br>5,000 people on the dance floors.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(38.885855,1.403632);
	bounds.extend(point);
	var marker = createMarker(point, "Space Nightclub", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Space Nightclub</b><br>One of Ibiza's most celebrated nightclubs, famous for its all-night, all-day parties<br>and winner of numerous International Dance Music Awards. Clubnights begin in<br>the evening; however, they usually don't end until well into the afternoon the next<br>day. We Love Sundays @ Space, however, opens at 8 AM on Sunday and keeps<br>going until 6 AM Monday morning. Located in Playa d'en Bossa, close by the<br>airport.</p>", 11);
	gmarkers[10] = marker;
	htmls[10] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Space Nightclub</b><br>One of Ibiza's most celebrated nightclubs, famous for its all-night, all-day parties<br>and winner of numerous International Dance Music Awards. Clubnights begin in<br>the evening; however, they usually don't end until well into the afternoon the next<br>day. We Love Sundays @ Space, however, opens at 8 AM on Sunday and keeps<br>going until 6 AM Monday morning. Located in Playa d'en Bossa, close by the<br>airport.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(38.958041,1.407629);
	bounds.extend(point);
	var marker = createMarker(point, "Privilege Nightclub", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Privilege Nightclub</b><br>The world's largest nightclub with a capacity of 10,000. It is situated near San Rafael,<br>Ibiza, less than a kilometer apart from the nightclub Amnesia and is home to Manumission,<br>probably the island's most famous club night. The main room is aircraft-hangar size with a<br>25-meter high roof, and a swimming pool. Officially recognised by The Guiness Book of<br>Records as being the largest club in the World.</p>", 12);
	gmarkers[11] = marker;
	htmls[11] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Privilege Nightclub</b><br>The world's largest nightclub with a capacity of 10,000. It is situated near San Rafael,<br>Ibiza, less than a kilometer apart from the nightclub Amnesia and is home to Manumission,<br>probably the island's most famous club night. The main room is aircraft-hangar size with a<br>25-meter high roof, and a swimming pool. Officially recognised by The Guiness Book of<br>Records as being the largest club in the World.</p>";
	map.addOverlay(marker);

	map.savePosition();
}

function createMarker(point, title, text, index){
	var icon = new GIcon(baseIcon);
	icon.image = "../images/icons/" + index + ".png";
	var marker = new GMarker(point, icon);
	marker.title = "" + title + "";
	GEvent.addListener(marker, "click", function() {
	  marker.openInfoWindowHtml("" + text + "");
	});
	return marker;
}


function myclick(i) {
	gmarkers[i].openInfoWindowHtml(htmls[i]);
}
