
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(39.567588,2.655258), 8);
	map.addControl(new GLargeMapControl());

	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(39.56734,2.648392);
	bounds.extend(point);
	var marker = createMarker(point, "La Seu Cathedral", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>La Seu Cathedral</b><br />A magnificent Gothic Cathedral<br /> whose sandstone walls and flying<br /> buttresses seem to rise out of the<br /> sea. One of the most<br /> impressive Cathedrals in Spain.</p>", 1);
	gmarkers[0] = marker;
	htmls[0] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>La Seu Cathedral</b><br />A magnificent Gothic Cathedral<br /> whose sandstone walls and flying<br /> buttresses seem to rise out of the<br /> sea. One of the most<br /> impressive Cathedrals in Spain.</p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(39.56423,2.621924);
	bounds.extend(point);
	var marker = createMarker(point, "Bellver Castle", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Bellver Castle</b><br>The 700-year-old Bellver Castle dominates<br /> the city of Palma and its circular groundplan<br /> is a unique example of Gothic military architecture</p>", 2);
	gmarkers[1] = marker;
	htmls[1] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Bellver Castle</b><br>The 700-year-old Bellver Castle dominates<br /> the city of Palma and its circular groundplan<br /> is a unique example of Gothic military architecture</p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(39.568365,2.644722);
	bounds.extend(point);
	var marker = createMarker(point, "La Llotja", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>La Llotja</b><br /> Near to the harbour is La Llotja,<br/> a beautiful Gothic building that<br/> was erected in the 15th Century<br/> as a commodities exchange.</p>", 3);
	gmarkers[2] = marker;
	htmls[2] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>La Llotja</b><br /> Near to the harbour is La Llotja,<br/> a beautiful Gothic building that<br/> was erected in the 15th Century<br/> as a commodities exchange.</p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(39.568597,2.644722);
	bounds.extend(point);
	var marker = createMarker(point, "Abaco", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Abaco</b><br /> <br />For many years the Abaco Bar<br /> has been and still is a must <br />go for Palma visitors.</p>", 4);
	gmarkers[3] = marker;
	htmls[3] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Abaco</b><br />For many years the Abaco Bar<br /> has been and still is a must <br />go for Palma visitors.</p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(39.568531,2.647984);
	bounds.extend(point);
	var marker = createMarker(point, "Palau de l'Almudaina", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Palau de l'Almudaina</b><br />10th century baths are virtually<br /> all that remain of the Arabcity<br />  of Medina Mayurqa. They were <br />probably part of a nobleman's<br /> house and are similar to those<br /> found in other Islamic cities.</p>", 5);
	gmarkers[4] = marker;
	htmls[4] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Palau de l'Almudaina</b><br />10th century baths are virtually<br /> all that remain of the Arabcity<br />  of Medina Mayurqa. They were <br />probably part of a nobleman's<br /> house and are similar to those<br /> found in other Islamic cities.</p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(39.569548,2.648671);
	bounds.extend(point);
	var marker = createMarker(point, "Plaza Mayor", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Plaza Mayor</b><br/>In the Old Town the Plaza Mayo<br /> is one of the best preserved areas.<br /> With numerous open terrace cafes,<br /> there's plenty shopping in the<br /> surrounding streets.</p>", 6);
	gmarkers[5] = marker;
	htmls[5] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Plaza Mayor</b><br />In the Old Town the Plaza Mayo<br /> is one of the best preserved areas.<br /> With numerous open terrace cafes,<br /> there's plenty shopping in the<br /> surrounding streets.</p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(39.569548,2.648671);
	bounds.extend(point);
	var marker = createMarker(point, "Basilica de Sant Francesc", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Basilica de Sant Francesc</b><br/>The sober facade of this Gothic church belies<br/> a typically exuberant Baroque interior.<br/> But the real draw is its adjoining<br/> cloister.With its simple  Gothic architecture, <br/>a central fountain and citrus trees, it is a <br/>veritable oasis of peace at the<br/> heart of the old town.</p>", 7);
	gmarkers[6] = marker;
	htmls[6] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Basilica de Sant Francesc</b><br/> The sober facade of this Gothic church belies<br/> a typically exuberant Baroque interior.<br/> But the real draw is its adjoining<br/> cloister.With its simple  Gothic architecture, <br/>a central fountain and citrus trees, it is a <br/>veritable oasis of peace at the<br/> heart of the old town.</p>";
	map.addOverlay(marker);
	
var icon = new GIcon(baseIcon);
	var point = new GLatLng(39.569473,2.653198);
	bounds.extend(point);
	var marker = createMarker(point, "Es Baluard Museum d'Art Modern I Contemporani ", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Es Baluard Museum d'Art Modern I Contemporani </b>Palma's dazzling museum of modern and contemporary art<br /> and sculpture contains works by such celebrated  artistsas<br /> Cezanne, Matisse, Dali and Picasso, together<br /> with a remarkable collection of Balearic paintings<br /> by both local and foreign artists.</p>", 8);
	gmarkers[7] = marker;
	htmls[7] =  "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Es Baluard Museum d'Art Modern I Contemporani</b><br/>Palma's dazzling museum of modern and contemporary art<br /> and sculpture contains works by such celebrated  artistsas<br /> Cezanne, Matisse, Dali and Picasso, together<br /> with a remarkable collection of Balearic paintings<br /> by both local and foreign artists.</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]);
}

