
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(54.978008,-1.61293), 6);
	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(54.969923,-1.606987);
	bounds.extend(point);
	var marker = createMarker(point, "The Church of All Saints", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>The Church of All Saints</b><br>The Church of All Saints, which was built<br>in the neo-Classical style by David Stephenson<br>in the 18th century, possesses some<br>elaborate mahogany woodwork and probably the largest<br>brass in England.<br>", 1);
	gmarkers[0] = marker;
	htmls[0] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>The Church of All Saints</b><br>The Church of All Saints, which was built<br>in the neo-Classical style by David Stephenson<br>in the 18th century, possesses some<br>elaborate mahogany woodwork and probably the largest<br>brass in England.<br>";
	map.addOverlay(marker);


	var icon = new GIcon(baseIcon);
	var point = new GLatLng(55.609081,-1.710606);
	bounds.extend(point);
	var marker = createMarker(point, "Bamburgh Castle", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Bamburgh Castle</b><br>The magnificent and dramatic coastal setting of<br>this completely restored medieval castle, perched<br>high on a bluff overlooking the North Sea in<br>Northumberland, has attracted the eyes of many a film<br>director and tourist alike<br>", 2);
	gmarkers[1] = marker;
	htmls[1] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Bamburgh Castle</b><br>The magnificent and dramatic coastal setting of<br>this completely restored medieval castle, perched<br>high on a bluff overlooking the North Sea in<br>Northumberland, has attracted the eyes of many a film<br>director and tourist alike<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(54.881619,-1.658335);
	bounds.extend(point);
	var marker = createMarker(point, "Beamish Open Air Museum", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Beamish Open Air Museum</b><br>The open air museum offers a living, working<br>experience of life in the region in the Edwardian era,<br>and has something for all ages. Staff in<br>period dress welcome visitors and demonstrate life<br>in period homes and workplaces including the<br>popular Beamish sweet factory and traditional Co-op Shops.<br>", 3);
	gmarkers[2] = marker;
	htmls[2] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Beamish Open Air Museum</b><br>The open air museum offers a living, working<br>experience of life in the region in the Edwardian era,<br>and has something for all ages. Staff in<br>period dress welcome visitors and demonstrate life<br>in period homes and workplaces including the<br>popular Beamish sweet factory and traditional Co-op Shops.<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(54.952977,-1.599498);
	bounds.extend(point);
	var marker = createMarker(point, "Corrymella Scott Gallery", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Corrymella Scott Gallery</b><br>This gallery, which features regular exhibitions,<br>specialises in the contemporary and 20th century works<br>of Scottish painters and sculptors.<br>", 4);
	gmarkers[3] = marker;
	htmls[3] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Corrymella Scott Gallery</b><br>This gallery, which features regular exhibitions,<br>specialises in the contemporary and 20th century works<br>of Scottish painters and sculptors.<br>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(54.995367,-1.460216);
	bounds.extend(point);
	var marker = createMarker(point, "Wet n Wild", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Wet n Wild</b><br>Splash down at Wet 'n' Wild and you are guaranteed<br>a fun time in the many slides and water flumes. This<br>giant waterpark complex on the outskirts of the city<br>is highly recommended for all the family.<br></p>", 5);
	gmarkers[4] = marker;
	htmls[4] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Wet n Wild</b><br>Splash down at Wet 'n' Wild and you are guaranteed<br>a fun time in the many slides and water flumes. This<br>giant waterpark complex on the outskirts of the city<br>is highly recommended for all the family.<br></p>";
	map.addOverlay(marker);

		var icon = new GIcon(baseIcon);
	var point = new GLatLng(55.415533,-1.704909);
	bounds.extend(point);
	var marker = createMarker(point, "Alnwick Castle", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Alnwick Castle</b><br>Alnwick Castle is a treasure trove of history. You will not<br>find a dry, dusty ruin, however, but a lively vibrant<br>place that is the second largest inhabited castle<br>in the country. As well as the usual attractions of an<br>old castle, such as battlements and dungeons, Alnwick has a<br>collection of fine art, including paintings by Van<br>Dyck, Canaletto, and Titian.<br></p>", 6);
	gmarkers[5] = marker;
	htmls[5] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Alnwick Castle</b><br>Alnwick Castle is a treasure trove of history. You will not<br>find a dry, dusty ruin, however, but a lively vibrant<br>place that is the second largest inhabited castle<br>in the country. As well as the usual attractions of an<br>old castle, such as battlements and dungeons, Alnwick has a<br>collection of fine art, including paintings by Van<br>Dyck, Canaletto, and Titian.<br></p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(54.994075,-1.645106);
	bounds.extend(point);
	var marker = createMarker(point, "Newcastle United Golf Club", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Newcastle United Golf Club</b><br>This is a private suburban golf club situated only<br>two miles west of Newcastle city centre. Bar<br>meals are available in the club house, and<br>there is also a practice area, and a well stocked<br>club shop. Visitors are welcome to play on weekdays,<br>and also on those weekends.<br></p>", 7);
	gmarkers[6] = marker;
	htmls[6] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Newcastle United Golf Club</b><br>This is a private suburban golf club situated only<br>two miles west of Newcastle city centre. Bar<br>meals are available in the club house, and<br>there is also a practice area, and a well stocked<br>club shop. Visitors are welcome to play on weekdays,<br>and also on those weekends.<br></p>";
	map.addOverlay(marker);

var icon = new GIcon(baseIcon);
	var point = new GLatLng(54.975089,-1.608768);
	bounds.extend(point);
	var marker = createMarker(point, "Blue Carpet", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Blue Carpet</b><br>In an innovative and imaginative piece of contemporary<br>urban design. The main effect of the design is the idea<br>of huge blue carpet that has simply been dropped<br>from the sky and left to lie where it had come to rest. Folded<br>back sections provide seating, and discreetly lit<br>underground spaces contain mini-galleries displaying<br>historical artefacts.<br></p>", 8);
	gmarkers[7] = marker;
	htmls[7] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Blue Carpet</b><br>In an innovative and imaginative piece of contemporary<br>urban design. The main effect of the design is the idea<br>of huge blue carpet that has simply been dropped<br>from the sky and left to lie where it had come to rest. Folded<br>back sections provide seating, and discreetly lit<br>underground spaces contain mini-galleries displaying<br>historical artefacts.<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]);
}
