
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(51.89302,-8.444366), 11);
	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(51.896622,-8.294249);
	bounds.extend(point);
	var marker = createMarker(point, "Fota Island Golf Club", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Fota Island Golf Club</b><br/>Named Course of the Year by the Irish Golf Tour Operators Association (IGTOA).<br/>In the heart of a 780-acre estate, a few minutes from Cork city the traditionally styled<br/>par 71 championship course has the natural beauty of the woodland setting woven<br/>into the design of each hole. After a round, you can make your way to the clubhouse<br/>and enjoy a drink in Spike Bar or something more substantial in Nibbicks Restaurant.</p>", 1);
	gmarkers[0] = marker;
	htmls[0] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Fota Island Golf Club</b><br/>Named Course of the Year by the Irish Golf Tour Operators Association (IGTOA).<br/>In the heart of a 780-acre estate, a few minutes from Cork city the traditionally styled<br/>par 71 championship course has the natural beauty of the woodland setting woven<br/>into the design of each hole. After a round, you can make your way to the clubhouse<br/>and enjoy a drink in Spike Bar or something more substantial in Nibbicks Restaurant.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(51.892702,-8.305578);
	bounds.extend(point);
	var marker = createMarker(point, "Fota Arboretum and Gardens", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Fota Arboretum and Gardens</b><br>This arboretum houses an excellent collection of various trees and shrubs.<br/>The project began in the early 19th century and now includes many rare<br/>specimens from as far afield as Japan, China, South America, the Himalayas<br/>and North America. Also, while you're in the vicinity don't miss the<br/>opportunity to check out the wonderful Fota Wildlife Park.</p>", 2);
	gmarkers[1] = marker;
	htmls[1] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Fota Arboretum and Gardens</b><br>This arboretum houses an excellent collection of various trees and shrubs.<br/>The project began in the early 19th century and now includes many rare<br/>specimens from as far afield as Japan, China, South America, the Himalayas<br/>and North America. Also, while you're in the vicinity don't miss the<br/>opportunity to check out the wonderful Fota Wildlife Park.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(51.897423,-8.465835);
	bounds.extend(point);
	var marker = createMarker(point, "Cork City Hall", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Cork City Hall</b><br>Overlooking the river Lee, Cork City Hall was opened in 1936, replacing the previous<br/>structure which was burned down in 1920. The six limestone Tuscan pillars and<br/>copper-domed clock tower are a particularly impressive sight after dark. City Hall<br/>houses Cork city's administration; the county administration offices are elsewhere.<br/>It is also used for concerts and, during office hours, the public can enter to see the<br/>fine Connemara marble staircase.</p>", 3);
	gmarkers[2] = marker;
	htmls[2] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Cork City Hall</b><br>Overlooking the river Lee, Cork City Hall was opened in 1936, replacing the previous<br/>structure which was burned down in 1920. The six limestone Tuscan pillars and<br/>copper-domed clock tower are a particularly impressive sight after dark. City Hall<br/>houses Cork city's administration; the county administration offices are elsewhere.<br/>It is also used for concerts and, during office hours, the public can enter to see the<br/>fine Connemara marble staircase.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(51.850705,-8.29854);
	bounds.extend(point);
	var marker = createMarker(point, "Cobh Cathedral", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Cobh Cathedral</b><br>Though it was not built until more than a thousand years after his death, this cathedral<br/>is named after St Colman, bard poet to the King of Munster, who founded this diocese<br/>in 560 A.D. Designed in Neo-Gothic style by the architects Pugin and Ashlin, the<br/>Cathedral remains an awesome testament to 1860s architecture. The largest carillon in<br/>Ireland, the cathedral is often used as a venue for concerts and recitals.</p>", 4);
	gmarkers[3] = marker;
	htmls[3] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Cobh Cathedral</b><br>Though it was not built until more than a thousand years after his death, this cathedral<br/>is named after St Colman, bard poet to the King of Munster, who founded this diocese<br/>in 560 A.D. Designed in Neo-Gothic style by the architects Pugin and Ashlin, the<br/>Cathedral remains an awesome testament to 1860s architecture. The largest carillon in<br/>Ireland, the cathedral is often used as a venue for concerts and recitals.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(51.885392,-8.426685);
	bounds.extend(point);
	var marker = createMarker(point, "Ted McCarthy Municipal Golf Course", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Ted McCarthy Municipal Golf Course</b><br>Running parallel to the estuary, close to a wildlife sanctuary, this course<br/>offers a magnificent setting for a round of golf. The eighteen-hole course<br/>is open seven days a week from 8:30a until dark, so you can play all day<br/>long if you like. If you didn't bring your clubs to Cork, not to worry, as all<br/>necessary equipment is available for hire.</p>", 5);
	gmarkers[4] = marker;
	htmls[4] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Ted McCarthy Municipal Golf Course</b><br>Running parallel to the estuary, close to a wildlife sanctuary, this course<br/>offers a magnificent setting for a round of golf. The eighteen-hole course<br/>is open seven days a week from 8:30a until dark, so you can play all day<br/>long if you like. If you didn't bring your clubs to Cork, not to worry, as all<br/>necessary equipment is available for hire.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(51.9288,-8.57028);
	bounds.extend(point);
	var marker = createMarker(point, "Blarney Castle", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Blarney Castle</b><br>A medieval stronghold in Blarney, near Cork, Ireland. The castle originally<br/>dates from before AD 1200. It was destroyed in 1446, but subsequently<br/>rebuilt by Dermot McCarthy, the King of Munster. It is currently a partial<br/>ruin with some accessible rooms and the battlements and surrounding the<br/>castle are beautiful and quite extensive gardens.</p>", 6);
	gmarkers[5] = marker;
	htmls[5] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Blarney Castle</b><br>A medieval stronghold in Blarney, near Cork, Ireland. The castle originally<br/>dates from before AD 1200. It was destroyed in 1446, but subsequently<br/>rebuilt by Dermot McCarthy, the King of Munster. It is currently a partial<br/>ruin with some accessible rooms and the battlements and surrounding the<br/>castle are beautiful and quite extensive gardens.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(51.894344,-8.480501);
	bounds.extend(point);
	var marker = createMarker(point, "Saint Finn Barre's Cathedral", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Saint Finn Barre's Cathedral</b><br>St. Finn Barre's Cathedral is a splendid triple-spired example of French-gothic<br/>architecture. It stands where the saint established his monastic school about<br/>650 AD. Among its most striking features are the fine rose window, the mosaic<br/>pavements and the elaborate carving throughout.</p>", 7);
	gmarkers[6] = marker;
	htmls[6] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Saint Finn Barre's Cathedral</b><br>St. Finn Barre's Cathedral is a splendid triple-spired example of French-gothic<br/>architecture. It stands where the saint established his monastic school about<br/>650 AD. Among its most striking features are the fine rose window, the mosaic<br/>pavements and the elaborate carving throughout.</p>";
	map.addOverlay(marker);

	var icon = new GIcon(baseIcon);
	var point = new GLatLng(51.899482,-8.478849);
	bounds.extend(point);
	var marker = createMarker(point, "Cork Vision Centre", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Cork Vision Centre</b><br>Located in the heart of Cork's historic centre, and within walking distance<br/>of the city's artistic, commercial and diverse tourist attractions, the Cork<br/>Vision Centre offers visitors an opportunity to appreciate a fine example<br/>of conservation in action, and to explore Cork's evolution from past,<br/>through present, and onwards to future development.</p>", 8);
	gmarkers[7] = marker;
	htmls[7] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Cork Vision Centre</b><br>Located in the heart of Cork's historic centre, and within walking distance<br/>of the city's artistic, commercial and diverse tourist attractions, the Cork<br/>Vision Centre offers visitors an opportunity to appreciate a fine example<br/>of conservation in action, and to explore Cork's evolution from past,<br/>through present, and onwards to future development.</p>";
	map.addOverlay(marker);


}

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]);
}
