
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(29.03516,-13.62648), 6);
	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(29.005288,-13.786125);
	bounds.extend(point);
	var marker = createMarker(point, "Timanfaya National Park", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Timanfaya National Park</b><br>The Montanas del Fuego consist of more<br>than 100 volcanoes on the island of Lanzarote,<br>covering more than 50 km2. The area<br>has not seen an eruption since 1824 and in 1968<br>it was declared as a national park. Discover<br>this unique, albeit volatile, landscape<br>and the rare species and attractions it<br>boasts.<br>", 1);
	gmarkers[0] = marker;
	htmls[0] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Timanfaya National Park</b><br>The Montanas del Fuego consist of more<br>than 100 volcanoes on the island of Lanzarote,<br>covering more than 50 km2. The area<br>has not seen an eruption since 1824 and in 1968<br>it was declared as a national park. Discover<br>this unique, albeit volatile, landscape<br>and the rare species and attractions it<br>boasts.<br>";
	map.addOverlay(marker);


	var icon = new GIcon(baseIcon);
	var point = new GLatLng(29.160069,-13.437953);
	bounds.extend(point);
	var marker = createMarker(point, "The Cave of Los Verdes", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>The Cave of Los Verdes</b><br>The Cueva de los Verdes or Green Caves<br>are part of the Atlantida underground Cave<br>system formed some 3000 years ago.<br>The lowest part of the cave is used occasionally as<br>a concert hall and is an impressive sight in itself.<br>The caves are definitely worth a visit and<br>if the melted wax-like rock isn't enough to impress you,<br>the secret of Cueva de los Verdes<br>will be.<br>", 2);
	gmarkers[1] = marker;
	htmls[1] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>The Cave of Los Verdes</b><br>The Cueva de los Verdes or Green Caves<br>are part of the Atlantida underground Cave<br>system formed some 3000 years ago.<br>The lowest part of the cave is used occasionally as<br>a concert hall and is an impressive sight in itself.<br>The caves are definitely worth a visit and<br>if the melted wax-like rock isn't enough to impress you,<br>the secret of Cueva de los Verdes<br>will be.<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(28.961929,-13.543439);
	bounds.extend(point);
	var marker = createMarker(point, "Castillo de San Gabriel", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Castillo de San Gabriel</b><br>The Castillo de San Gabriel was first built<br>in 1574 in order to defend Arrecife Harbour.<br>After being destroyed by pirates in<br>the 16th centuary and rebuilt again, it is<br>now is home to an archaeological museum.<br>", 3);
	gmarkers[2] = marker;
	htmls[2] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Castillo de San Gabriel</b><br>The Castillo de San Gabriel was first built<br>in 1574 in order to defend Arrecife Harbour.<br>After being destroyed by pirates in<br>the 16th centuary and rebuilt again, it is<br>now is home to an archaeological museum.<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(28.98408,-13.620086);
	bounds.extend(point);
	var marker = createMarker(point, "El Grifo Wine Museum", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>El Grifo Wine Museum</b><br>North of San Bartolome in the district of<br>La Cena is where the islands major vineyards<br>are to be found. The El Grifo Wine<br>Museum attracts over 50,000 people through its<br>door each year. There are displays of wine<br>making equipment, ancient presses, bottling tools,<br>pumps and filters, and laboratory instruments<br>used in the wine making process over the years.<br>The museum also offers visitors the opportunity<br>to join wine tasting courses and to purchase a wide<br>selection of wines and souvenirs from their<br>gift shop.<br>", 4);
	gmarkers[3] = marker;
	htmls[3] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>El Grifo Wine Museum</b><br>North of San Bartolome in the district of<br>La Cena is where the islands major vineyards<br>are to be found. The El Grifo Wine<br>Museum attracts over 50,000 people through its<br>door each year. There are displays of wine<br>making equipment, ancient presses, bottling tools,<br>pumps and filters, and laboratory instruments<br>used in the wine making process over the years.<br>The museum also offers visitors the opportunity<br>to join wine tasting courses and to purchase a wide<br>selection of wines and souvenirs from their<br>gift shop.<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(29.00251,-13.518891);
	bounds.extend(point);
	var marker = createMarker(point, "Costa Teguise Aquapark", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Costa Teguise Aquapark</b><br>The Costa Teguise Aquapark, on the<br>outskirts of the resort, is always a popular<br>attraction. The park is open each day from<br>10:00am to 6:00 pm and features the usual selection<br>of high speed slides for teens and adults, along<br>with the slower flumes for younger children.<br></p>", 5);
	gmarkers[4] = marker;
	htmls[4] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Costa Teguise Aquapark</b><br>The Costa Teguise Aquapark, on the<br>outskirts of the resort, is always a popular<br>attraction. The park is open each day from<br>10:00am to 6:00 pm and features the usual selection<br>of high speed slides for teens and adults, along<br>with the slower flumes for younger children.<br></p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(29.213983,-13.481469);
	bounds.extend(point);
	var marker = createMarker(point, "Mirador del Rio", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Mirador del Rio</b><br>The Mirador del Rio provides spectacular<br>views of the Chinijo Archipelago, which<br>consists of La Graciosa, Montana<br>Clara and Alegranza as well as the islets<br>of Roque del Este and Roque del Oeste.<br></p>", 6);
	gmarkers[5] = marker;
	htmls[5] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Mirador del Rio</b><br>The Mirador del Rio provides spectacular<br>views of the Chinijo Archipelago, which<br>consists of La Graciosa, Montana<br>Clara and Alegranza as well as the islets<br>of Roque del Este and Roque del Oeste.<br></p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(28.932881,-13.660609);
	bounds.extend(point);
	var marker = createMarker(point, "Rancho Texas Park", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Rancho Texas Park</b><br>Located just outside Puerto del Carmen,<br>Rancho Texas is a Western Theme Park<br>featuring A Nature Park, An Indian<br>Village and Theme Restaurants.<br></p>", 7);
	gmarkers[6] = marker;
	htmls[6] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Rancho Texas Park</b><br>Located just outside Puerto del Carmen,<br>Rancho Texas is a Western Theme Park<br>featuring A Nature Park, An Indian<br>Village and Theme Restaurants.<br></p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(29.157464,-13.430067);
	bounds.extend(point);
	var marker = createMarker(point, "Jameos del Agua", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Jameos del Agua</b><br>Jameos Del Agua, located in the north<br>of Lanzarote, is part of the Atlantida<br>volcanic cave system formed by the<br>eruptions of the Corona volcano about three<br>to four thousand years ago.<br></p>", 8);
	gmarkers[7] = marker;
	htmls[7] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Jameos del Agua</b><br>Jameos Del Agua, located in the north<br>of Lanzarote, is part of the Atlantida<br>volcanic cave system formed by the<br>eruptions of the Corona volcano about three<br>to four thousand years ago.<br></p>";
	map.addOverlay(marker);

	
	map.setZoom(map.getBoundsZoomLevel(bounds));
	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]);
}
