
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.34557,-0.482956), 16);
	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.35283,-0.476704);
	bounds.extend(point);
	var marker = createMarker(point, "Museo Arqueologico Provincial", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Museo Arqueologico Provincial</b><br/>Museum of Archaeology hosting a collection of<br/>classified and listed findings. Nominated as the<br/>European Museum of the Year in 2004.", 1);
	gmarkers[0] = marker;
	htmls[0] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Museo Arqueologico Provincial</b><br/>Museum of Archaeology hosting a collection of<br/>classified and listed findings. Nominated as the<br/>European Museum of the Year in 2004.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(38.340554,-0.487572);
	bounds.extend(point);
	var marker = createMarker(point, "Park de Canalejas", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Park de Canalejas</b><br>Founded in 1886, the oldest of the parks in Alicante,<br/>offers activities all year round from open air performances<br/>to boules, croquet, skating & mini-golf to name a few.", 2);
	gmarkers[1] = marker;
	htmls[1] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Park de Canalejas</b><br>Founded in 1886, the oldest of the parks in Alicante,<br/>offers activities all year round from open air performances<br/>to boules, croquet, skating & mini-golf to name a few.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(38.348388,-0.479343);
	bounds.extend(point);
	var marker = createMarker(point, "Castillo de Santa Barbara", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Castillo de Santa Barbara</b><br>Santa Barbara Castle. The most emblematic construction<br/>in the city, located on the summit of mount Benacantil at<br/>166m above the nearby sea.", 3);
	gmarkers[2] = marker;
	htmls[2] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Castillo de Santa Barbara</b><br>Santa Barbara Castle. The most emblematic construction<br/>in the city, located on the summit of mount Benacantil at<br/>166m above the nearby sea.";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(38.345115,-0.481188);
	bounds.extend(point);
	var marker = createMarker(point, "Ayuntamiento", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Ayuntamiento</b><br>The town hall, with it's twin towers, forms an impressive<br/>structure. At the foot of the main staircase is the 'cota cero'<br/>which is used as the point of reference for measuring the<br/>height above or below sea level of anywhere in Spain.", 4);
	gmarkers[3] = marker;
	htmls[3] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Ayuntamiento</b><br>The town hall, with it's twin towers, forms an impressive<br/>structure. At the foot of the main staircase is the 'cota cero'<br/>which is used as the point of reference for measuring the<br/>height above or below sea level of anywhere in Spain.";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(38.346183,-0.485072);
	bounds.extend(point);
	var marker = createMarker(point, "Teatro Principal", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Teatro Principal</b><br>The main theatre is a fine example of neo-classical construction.<br/>The centre of culture for the city where performances of ballet,<br/>opera and theatre can be enjoyed.", 5);
	gmarkers[4] = marker;
	htmls[4] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Teatro Principal</b><br>The main theatre is a fine example of neo-classical construction.<br/>The centre of culture for the city where performances of ballet,<br/>opera and theatre can be enjoyed.";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(38.345914,-0.479493);
	bounds.extend(point);
	var marker = createMarker(point, "Iglesia de Santa Maria", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Iglesia de Santa Maria</b><br>The oldest church in the city. Built between the 14th and<br/>16th centuries the church houses several important works<br/>of art.", 6);
	gmarkers[5] = marker;
	htmls[5] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Iglesia de Santa Maria</b><br>The oldest church in the city. Built between the 14th and<br/>16th centuries the church houses several important works<br/>of art.";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(38.343895,-0.481607);
	bounds.extend(point);
	var marker = createMarker(point, "Paseo de la Explanada", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Paseo de la Explanada</b><br>One of the most beautiful seafront promenades in Spain,<br/>with Parisian-style street cafes and intricate marble inlays<br/>of red, cream and black tiles, representing the colours of<br/>Alicante.", 7);
	gmarkers[6] = marker;
	htmls[6] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Paseo de la Explanada</b><br>One of the most beautiful seafront promenades in Spain,<br/>with Parisian-style street cafes and intricate marble inlays<br/>of red, cream and black tiles, representing the colours of<br/>Alicante.";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(38.34466,-0.478195);
	bounds.extend(point);
	var marker = createMarker(point, "Playa del Postiguet", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Playa del Postiguet</b><br>A beautiful beach in the heart of the city. A 900m wide<br/>arc of golden sand positioned for easy access and<br/>backed by a palm-shaded promenade with a selection<br/>of modern bars offering refreshments and food.", 8);
	gmarkers[7] = marker;
	htmls[7] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Playa del Postiguet</b><br>A beautiful beach in the heart of the city. A 900m wide<br/>arc of golden sand positioned for easy access and<br/>backed by a palm-shaded promenade with a selection<br/>of modern bars offering refreshments and food.";
	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]);
}
