
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(36.724576,-4.361572), 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(36.723149,-4.417212);
	bounds.extend(point);
	var marker = createMarker(point, "Fundacion Picasso", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Fundacion Picasso</b><br>Pablo Picasso was born in 1881 in a<br>five-storey building in Malaga's historic<br>old quarter. This has now become The<br>Fundacion Picasso. It houses a unique collection of<br>Picasso's work, including many ceramics.<br>", 1);
	gmarkers[0] = marker;
	htmls[0] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Fundacion Picasso</b><br>Pablo Picasso was born in 1881 in a<br>five-storey building in Malaga's historic<br>old quarter. This has now become The<br>Fundacion Picasso. It houses a unique collection of<br>Picasso's work, including many ceramics.<br>";
	map.addOverlay(marker);


	var icon = new GIcon(baseIcon);
	var point = new GLatLng(36.721235,-4.415436);
	bounds.extend(point);
	var marker = createMarker(point, "Alcazaba", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Alcazaba</b><br>The Alcazaba in Malaga, Spain is<br>a Moorish fortification dating from the 8th<br>century. It is built on a hill in the centre<br>of the city, overlooking the port,<br>and comprises two walled enclosures.<br>", 2);
	gmarkers[1] = marker;
	htmls[1] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Alcazaba</b><br>The Alcazaba in Malaga, Spain is<br>a Moorish fortification dating from the 8th<br>century. It is built on a hill in the centre<br>of the city, overlooking the port,<br>and comprises two walled enclosures.<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(36.512465,-4.883165);
	bounds.extend(point);
	var marker = createMarker(point, "Marbella", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Marbella</b><br>Marbella is a popular beach resort<br>in the Costa del Sol, one synonomous with<br>the rich and famous. The area around<br>Marbella is particularly popular<br>with those who like Golf.<br>", 3);
	gmarkers[2] = marker;
	htmls[2] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Marbella</b><br>Marbella is a popular beach resort<br>in the Costa del Sol, one synonomous with<br>the rich and famous. The area around<br>Marbella is particularly popular<br>with those who like Golf.<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(36.710265,-5.145721);
	bounds.extend(point);
	var marker = createMarker(point, "Ronda", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Ronda</b><br>Ronda is a picturesque<br>old town that is home to a spectacular<br>gorge. Perched high on a rock precipice<br>150 metres (just under 500 ft) above the<br>gorge, this is where most tourist activity<br>can be found and where the most dramatic photos<br>can be taken. There are several little cafes<br>and restaurants around the area enabling<br>visitors to relax and enjoy the scenery.<br>", 4);
	gmarkers[3] = marker;
	htmls[3] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Ronda</b><br>Ronda is a picturesque<br>old town that is home to a spectacular<br>gorge. Perched high on a rock precipice<br>150 metres (just under 500 ft) above the<br>gorge, this is where most tourist activity<br>can be found and where the most dramatic photos<br>can be taken. There are several little cafes<br>and restaurants around the area enabling<br>visitors to relax and enjoy the scenery.<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(36.542191,-4.623184);
	bounds.extend(point);
	var marker = createMarker(point, "Fuengirola", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Fuengirola</b><br>Just twenty minutes from Malaga airport<br>Fuengirola is famous for its five miles of sandy<br>beaches, many of which hold the European blue flag<br>award. Find a wide promenade and palm trees,<br>interspersed with colourful flower beds and<br>seats and expect some excellent accommodation<br>options and restaurant choices.<br></p>", 5);
	gmarkers[4] = marker;
	htmls[4] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Fuengirola</b><br>Just twenty minutes from Malaga airport<br>Fuengirola is famous for its five miles of sandy<br>beaches, many of which hold the European blue flag<br>award. Find a wide promenade and palm trees,<br>interspersed with colourful flower beds and<br>seats and expect some excellent accommodation<br>options and restaurant choices.<br></p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(36.604366,-4.537868);
	bounds.extend(point);
	var marker = createMarker(point, "Tivoli World", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Tivoli Worldg</b><br>A popular theme park with over 30 rides<br>& attractions, Flamenco dancing shows, wild<br>west shows, live music, restaurants, children's<br>shows, comedy and more.<br></p>", 6);
	gmarkers[5] = marker;
	htmls[5] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Tivoli World</b><br>A popular theme park with over 30 rides<br>& attractions, Flamenco dancing shows, wild<br>west shows, live music, restaurants, children's<br>shows, comedy and more.<br></p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(36.588707,-4.5663);
	bounds.extend(point);
	var marker = createMarker(point, "Sea Life Centre", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Sea Life Centre</b><br>One of the attractions that has to be visited<br>in Benalmadena, is the Sea Life Centre which<br>is located next to the marina. As you<br>wander round at a leisurely pace you come<br>across various displays, all of which are<br>accessible and of great interest, especially<br>with the children.<br></p>", 7);
	gmarkers[6] = marker;
	htmls[6] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Sea Life Centre</b><br>One of the attractions that has to be visited<br>in Benalmadena, is the Sea Life Centre which<br>is located next to the marina. As you<br>wander round at a leisurely pace you come<br>across various displays, all of which are<br>accessible and of great interest, especially<br>with the children.<br></p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(37.1755,-3.601112);
	bounds.extend(point);
	var marker = createMarker(point, "Granada", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Granada</b><br>Granada, a high altitude city of romance<br>and folklore, boasts one of the most popular tourist<br>attractions in Spain, the Alhambra<br>palace-fortress.<br></p>", 8);
	gmarkers[7] = marker;
	htmls[7] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Granada</b><br>Granada, a high altitude city of romance<br>and folklore, boasts one of the most popular tourist<br>attractions in Spain, the Alhambra<br>palace-fortress.<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]);
}
