
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(32.066283,34.795761), 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(32.054517,34.754015);
	bounds.extend(point);
	var marker = createMarker(point, "Jaffa", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Jaffa</b><br />A 'must see' when visiting Tel Aviv.  This ancient part of<br /> the city is littered with many picturesque stone buildings<br /> including some of the most beautiful churches in Israel.<br /> Jaffa also contains one of the oldest ports in the world.</p>", 1);
	gmarkers[0] = marker;
	htmls[0] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Jaffa</b><br />A 'must see' when visiting Tel Aviv.  This ancient part of<br /> the city is littered with many picturesque stone buildings<br /> including some of the most beautiful churches in Israel.<br /> Jaffa also contains one of the oldest ports in the world.</p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(32.074311,34.792435);
	bounds.extend(point);
	var marker = createMarker(point, "Azrieli Centre", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Azrieli Centre</b><br />A skyscraper complex in central Tel Aviv features<br /> hotels and a shopping centre. The tallest Circular<br /> Tower gives you the unique opportunity to view<br /> Tel Aviv from 200 metres high.</p>", 2);
	gmarkers[1] = marker;
	htmls[1] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Azrieli Centre</b><br />A skyscraper complex in central Tel Aviv features<br /> hotels and a shopping centre. The tallest Circular<br /> Tower gives you the unique opportunity to view<br /> Tel Aviv from 200 metres high.</p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(32.060937,34.765935);
	bounds.extend(point);
	var marker = createMarker(point, "Neve Tzedek", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Neve Tzedek</b><br />One of Tel Aviv's oldest neighbourhoods is now one of the<br /> most fashionable. Down narrow, colourful streets you will<br /> find a heady mix of art galleries, cafes and theatres.</p>", 3);
	gmarkers[2] = marker;
	htmls[2] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Neve Tzedek</b><br />One of Tel Aviv's oldest neighbourhoods is now one of the<br /> most fashionable. Down narrow, colourful streets you will<br /> find a heady mix of art galleries, cafes and theatres.</p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(32.060764,34.764497);
	bounds.extend(point);
	var marker = createMarker(point, "Suzanne Dellal Centre", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Suzanne Dellal Centre</b><br>Located in Neve Tzedek, the Suzanne Dellal Centre is a major<br /> venue for dance and theatre hosting many major performances<br /> throughout the year. Check out their website or local listings<br /> for more details.</p>", 4);
	gmarkers[3] = marker;
	htmls[3] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Suzanne Dellal Centre</b><br>Located in Neve Tzedek, the Suzanne Dellal Centre is a major<br /> venue for dance and theatre hosting many major performances<br /> throughout the year. Check out their website or local listings<br /> for more details.</p>";
	map.addOverlay(marker);
	
	var icon = new GIcon(baseIcon);
	var point = new GLatLng(32.112731,34.808174);
	bounds.extend(point);
	var marker = createMarker(point, "Museum of the Jewish Diaspora", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Museum of the Jewish Diaspora</b><br />Tel Aviv's Museum of the Jewish Diaspora, which opened in<br /> 1978, features vast arrays of information about the Jewish<br /> people and their history. Open daily (not Sat).</p>", 5);
	gmarkers[4] = marker;
	htmls[4] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Museum of the Jewish Diaspora</b><br />Tel Aviv's Museum of the Jewish Diaspora, which opened in<br /> 1978, features vast arrays of information about the Jewish<br /> people and their history. Open daily (not Sat).</p>";
	map.addOverlay(marker);

		var icon = new GIcon(baseIcon);
	var point = new GLatLng(32.068492,34.769304);
	bounds.extend(point);
	var marker = createMarker(point, "Shuk HaCarmel Market", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Shuk HaCarmel Market</b><br />A bustling daily market in the Yemenite Quarter,<br /> Shuk HaCarmel is where you can buy everything from<br /> second-hand clothes to CD's. The real delight though,<br /> is the food section offering wonderful displays of fresh<br /> fruit, vegetables and pastries.</p>", 6);
	gmarkers[5] = marker;
	htmls[5] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Shuk HaCarmel Market</b><br />A bustling daily market in the Yemenite Quarter,<br /> Shuk HaCarmel is where you can buy everything from<br /> second-hand clothes to CD's. The real delight though,<br /> is the food section offering wonderful displays of fresh<br /> fruit, vegetables and pastries.</p>";
	map.addOverlay(marker);

		var icon = new GIcon(baseIcon);
	var point = new GLatLng(32.081238,34.768263);
	bounds.extend(point);
	var marker = createMarker(point, "Gordon-Frishman Beach", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Gordon-Frishman Beach</b><br />Located between Gordon and Frishman streets, this is<br /> the most central of the Tel Aviv's beaches and is a<br /> meeting point for city's beautiful people enjoying<br /> music and barbeques. At the northern end is a<br /> saltwater swimming pool. (Open Jun-Aug).</p>", 7);
	gmarkers[6] = marker;
	htmls[6] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Gordon-Frishman Beach</b><br />Located between Gordon and Frishman streets, this is<br /> the most central of the Tel Aviv's beaches and is a<br /> meeting point for city's beautiful people enjoying<br /> music and barbeques. At the northern end is a<br /> saltwater swimming pool. (Open Jun-Aug).</p>";
	map.addOverlay(marker);

		var icon = new GIcon(baseIcon);
	var point = new GLatLng(32.096073,34.785408);
	bounds.extend(point);
	var marker = createMarker(point, "Yehoshua Gardens (Hayarkon Park)", "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Yehoshua Gardens (Hayarkon Park)</b><br />Along the banks of the Hayarkon River is a strip of green<br /> tranquillity offering a multitude of recreational facilities<br /> including a boating lake, tropical gardens and a<br /> water park.</p>", 8);
	gmarkers[7] = marker;
	htmls[7] = "<p style='font-size: smaller; padding: 0; margin: 0;'><b>Yehoshua Gardens (Hayarkon Park)</b><br />Along the banks of the Hayarkon River is a strip of green<br /> tranquillity offering a multitude of recreational facilities<br /> including a boating lake, tropical gardens and a<br /> water park.</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]);
}
