
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(41.122808,1.123783), 10);
	map.addControl(new GLargeMapControl());
	map.addControl(new GMapTypeControl());

	baseIcon = new GIcon();
	baseIcon.image = "Graphics/Markers/marker.png";
	baseIcon.shadow = "Graphics/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(41.155547,1.11095);
	bounds.extend(point);
	var marker = createMarker(point, "Centre Del Pallol Reus", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Centre Del Pallol Reus</b><br/>The shopping centre is 800 square metres in size and<br/> boasts an eclectic array of shops, boutiques and eateries.<br/> Shopping lovers are sure to find some bargains here<br/> to keep the credit card busy.</p>", 1);
	gmarkers[0] = marker;
	htmls[0] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Centre Del Pallol Reus</b><br />The shopping centre is 800 square metres in size and boasts an eclectic array of shops, boutiques and eateries. Shopping lovers are sure to find some bargains here to keep the credit card busy.</p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(41.155864,1.106344);
	bounds.extend(point);
	var marker = createMarker(point, "Fortuny Theatre", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Fortuny Theatre</b><br/>This ancient and celebrated theatre sits proudly in Reus’ centre. It is a wonder to the eye with the beauty of the architecture and the interior. It also has an interesting choice of shows for visitors.</p>", 2);
	gmarkers[1] = marker;
	htmls[1] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Fortuny Theatre</b><br />This ancient and celebrated theatre sits proudly in Reus’ centre. It is a wonder to the eye with the beauty of the architecture and the interior. It also has an interesting choice of shows for visitors.</p>";
	map.addOverlay(marker);
	
var icon = new GIcon(baseIcon);
	var point = new GLatLng(41.154388,1.109818);
	bounds.extend(point);
	var marker = createMarker(point, "Priory Church of St Pere", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Priory Church of St Pere</b>This beautiful and ancient religious building is a beacon of Catalunyan heritage. Well worth a visit to cast your eye at the mesmerising architecture that reaches high into the sky.</p>", 3);
	gmarkers[2] = marker;
	htmls[2] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Priory Church of St Pere</b><br />This beautiful and ancient religious building is a beacon of Catalunyan heritage. Well worth a visit to cast your eye at the mesmerising architecture that reaches high into the sky.</p>";
	map.addOverlay(marker);

var icon = new GIcon(baseIcon);
	var point = new GLatLng(41.075728,1.149101);
	bounds.extend(point);
	var marker = createMarker(point, "Salou", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Salou</b><br />The lively resort town of Salou sits on Costa Darada’s coast and is perfect for some hedonistic fun in the sun. As Reus is more of a sleepy city, Salou is perfect for a day or evening out mingling in bars and enjoying the array of tasty cocktails. It has terrific beaches to relax on also.</p>", 4);
	gmarkers[3] = marker;
	htmls[3] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Salou</b><br />The lively resort town of Salou sits on Costa Darada’s coast and is perfect for some hedonistic fun in the sun. As Reus is more of a sleepy city, Salou is perfect for a day or evening out mingling in bars and enjoying the array of tasty cocktails. It has terrific beaches to relax on also.</p>";
	map.addOverlay(marker);
	
var icon = new GIcon(baseIcon);
	var point = new GLatLng(41.087907,1.158071);
	bounds.extend(point);
	var marker = createMarker(point, "Port Aventura", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Port Aventura</b><br />On Tarragona’s coast Port Aventura is a haven for families and friends keen to partake in a spot of adrenaline-pumping thrill seeking. The theme park draws in the crowds and beaches are filled with tourists relaxing in the sun.</p>", 5);
	gmarkers[4] = marker;
	htmls[4] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Port Aventura</b><br />On Tarragona’s coast Port Aventura is a haven for families and friends keen to partake in a spot of adrenaline-pumping thrill seeking. The theme park draws in the crowds and beaches are filled with tourists relaxing in the sun.</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]);
}
