var map;
var gdir;
	function PlaneIcon() {
	}
	PlaneIcon.prototype = new GControl();
	PlaneIcon.prototype.initialize = function(map) {
	var container = document.createElement("div");
	this.setButtonStyle_(container);
	var img=document.createElement("IMG");
	img.src="../images/icon.png";
	if(window.ActiveXObject){
		img.attachEvent('onclick',function(){setDirections("1C Portland Pl, Westminster, London W1B", "London Heathrow Airport", "en")});
	}else{
		img.addEventListener('click',function(){setDirections("1C Portland Pl, Westminster, London W1B", "London Heathrow Airport", "en")}, false);
	 }
	container.appendChild(img);
	 map.getContainer().appendChild(container);
	 return container;
	 }
	 PlaneIcon.prototype.getDefaultPosition = function() {
		 return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(225, 0));
	 }
	 PlaneIcon.prototype.setButtonStyle_ = function(button) {  
	 button.style.backgroundColor = "transparent"; 
	 button.style.textAlign = "center";
	 button.style.cursor = "pointer";
	 button.style.border = "0";
	 }
	  function load() {
	 if (GBrowserIsCompatible()) {
	 map = new GMap2(document.getElementById("content"));
	 gdir = new GDirections(map, document.getElementById("directions"));
	 GEvent.addListener(gdir, "load", onGDirectionsLoad);
	 GEvent.addListener(gdir, "error", handleErrors);
	 map.addControl(new GSmallMapControl());
	 map.addControl(new GMapTypeControl());
	 map.setCenter(new GLatLng(51.517823057404094, -0.14378786087036133),14);
	 var hotelicon = new GIcon(G_DEFAULT_ICON);
	 hotelicon.image = "../images/langham_logo.png";
	 iOptions = { icon:hotelicon};
	 var aIcon = new GIcon(G_DEFAULT_ICON);
	 aIcon.image = "../images/a_icon.png";
	 aOptions = { icon:aIcon};
	 var bIcon = new GIcon(G_DEFAULT_ICON);
	 bIcon.image = "../images/b_icon.png";
	 bOptions = { icon:bIcon};
	 var cIcon = new GIcon(G_DEFAULT_ICON);
	 cIcon.image = "../images/c_icon.png";
	 cOptions = { icon:cIcon};
	 var dIcon = new GIcon(G_DEFAULT_ICON);
	 dIcon.image = "../images/d_icon.png";
	 dOptions = { icon:dIcon};
	 var eIcon = new GIcon(G_DEFAULT_ICON);
	 eIcon.image = "../images/e_icon.png";
	 eOptions = { icon:eIcon};
	 var fIcon = new GIcon(G_DEFAULT_ICON);
	 fIcon.image = "../images/f_icon.png";
	 fOptions = { icon:fIcon};
	 var gIcon = new GIcon(G_DEFAULT_ICON);
	 gIcon.image = "../images/g_icon.png";
	 gOptions = { icon:gIcon};
	 var hIcon = new GIcon(G_DEFAULT_ICON);
	 hIcon.image = "../images/h_icon.png";
	 hOptions = { icon:hIcon};
	 var transportationIcon = new GIcon(G_DEFAULT_ICON);
	 transportationIcon.image = "../images/transportation_icon.png";
	 markerOptionsTransportation = { icon:transportationIcon };
	 var point = new GLatLng(51.517823057404094, -0.14378786087036133);
	 map.addOverlay(createMarker(point, iOptions,0));
	 var point1 = new GLatLng(51.50166367816012, -0.12324213981628418);
map.addOverlay(createMarker(point1, fOptions,1));

	 var point2 = new GLatLng(51.50193875273061, -0.1577085256576538);
map.addOverlay(createMarker(point2, cOptions,2));

	 var point3 = new GLatLng(51.51707948451888, -0.13422444462776184);
map.addOverlay(createMarker(point3, cOptions,3));

	 var point4 = new GLatLng(51.512281436749255, -0.12315630912780762);
map.addOverlay(createMarker(point4, aOptions,4));

	 var point5 = new GLatLng(51.51809344453444, -0.12711524963378906);
map.addOverlay(createMarker(point5, aOptions,5));

	 var point6 = new GLatLng(51.503354588288786, -0.119757279753685);
map.addOverlay(createMarker(point6, aOptions,6));

	 var point7 = new GLatLng(51.51187705565776, -0.1442243903875351);
map.addOverlay(createMarker(point7, cOptions,7));

	 var point8 = new GLatLng(51.51626788297429, -0.2055155485868454);
map.addOverlay(createMarker(point8, cOptions,8));

	 var point9 = new GLatLng(51.529325192559966, -0.17102837562561035);
map.addOverlay(createMarker(point9, dOptions,9));

	 var point10 = new GLatLng(51.50080880759211, -0.17764806747436523);
map.addOverlay(createMarker(point10, aOptions,10));

	 var point11 = new GLatLng(51.507378543443735, -0.16568876802921295);
map.addOverlay(createMarker(point11, dOptions,11));

	 var point12 = new GLatLng(51.51279974039155, -0.13991743326187134);
map.addOverlay(createMarker(point12, cOptions,12));

	 var point13 = new GLatLng(51.51213287197696, -0.13982020318508148);
map.addOverlay(createMarker(point13, cOptions,13));

	 var point14 = new GLatLng(51.50930128503689, -0.13989262282848358);
map.addOverlay(createMarker(point14, aOptions,14));

	 var point15 = new GLatLng(51.501365644050445, -0.14188885688781738);
map.addOverlay(createMarker(point15, aOptions,15));

	 var point16 = new GLatLng(51.50015345162036, -0.1262354850769043);
map.addOverlay(createMarker(point16, eOptions,16));

	 var point17 = new GLatLng(51.502778992995374,-0.11921882629394531);
map.addOverlay(createMarker(point17, aOptions,17));

	 var point18 = new GLatLng(51.51200809388654, -0.12294508516788482);
map.addOverlay(createMarker(point18, bOptions,18));

	 var point19 = new GLatLng(51.5113295287898, -0.13174809515476227);
map.addOverlay(createMarker(point19, bOptions,19));

	 var point20 = new GLatLng(51.51118429952243, -0.13390257954597473);
map.addOverlay(createMarker(point20, fOptions,20));

	 var point21 = new GLatLng(51.50742027952542, -0.10012149810791015);
map.addOverlay(createMarker(point21, aOptions,21));

	 var point22 = new GLatLng(51.5069161051001, -0.09268976747989654);
map.addOverlay(createMarker(point22, dOptions,22));

	 var point23 = new GLatLng(51.50521864903485, -0.0851527601480484);
map.addOverlay(createMarker(point23, aOptions,23));

	 var point24 = new GLatLng(51.508555486285246, -0.07631421089172363);
map.addOverlay(createMarker(point24, aOptions,24));

	 var point25 = new GLatLng(51.5051819195103, -0.018677562475204468);
map.addOverlay(createMarker(point25, eOptions,25));

	 var point26 = new GLatLng(51.52264305141424, -0.15534281730651855);
map.addOverlay(createMarker(point26, aOptions,26));

	 var pointDefault = new GLatLng(51.517823057404094, -0.14378786087036133);

	 var mark = new GMarker(pointDefault,iOptions);
	 map.addOverlay(mark);
	 mark.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:300px\"><table border=\"0\"><tr><td><b>The Langham London<br>Address: 1C Portland Pl, Westminster, London W1B<br>Tel: (44) 20 7636 1000</b></td><td><img src=\"../images/hotel_tllon_tllon_en.jpg\"></td></tr></table></div>");
	 map.addOverlay(createMarker(pointDefault, iOptions,0));
	 map.addControl(new PlaneIcon());

	 }
	 }
 function createMarker(point, number,index) {
	 var marker = new GMarker(point,number);

	 switch (index)
	 {

case 0:	 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>The Langham London<br>Address: 1C Portland Pl, Westminster, London W1B<br>Tel: ((44) 20 7636 1000</b></td><td><img src=\"../images/hotel_tllon_tllon_en.jpg\"></td></tr></table></div>");		 });
		 break; 

		 case 1:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>London Boat Tours</b><br> Take a cruise down the river Thames from the Thames Flood Barrier to Greenwich. Most tours start at Westminster Pier.</td></tr></table></div>");
	 });
	 break;

		 case 2:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>Harrods</b><br> Arguably the most famous shop in the world, Harrods located in the heart of Knightsbridge is the UK's second-biggest store with over one million square feet of selling space.</td></tr></table></div>");
	 });
	 break;

		 case 3:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>Fortnum & Mason</b><br> This luxury food store is known as the Royal Family’s favourite food hall. The gourmet traveller simply can’t missed out on this experience. For three centuries Fortnum's has been committed to bringing the world's best food to Piccadilly. With five stores of luxury, it’s surely one of the most stunning food halls in the world.</td></tr></table></div>");
	 });
	 break;

		 case 4:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>Royal Opera House</b><br> One of the world's great opera houses, and still looking great after its £214 million refurbishment in readiness for the millennium, Covent Garden's Royal Opera House is now more adaptable and able to mount more performances than ever before.</td></tr></table></div>");
	 });
	 break;

		 case 5:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>The British Museum</b><br> World-class collections from civilisations across the globe are exhibited at the British Museum in Bloomsbury. Its mission is to 'illuminate the histories of cultures for present and future generations', with popular galleries devoted to the Assyrians and the Ancient Greeks.</td></tr></table></div>");
	 });
	 break;

		 case 6:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>London Eye</b><br> London Eye is the world's tallest observation wheel at 135m high. Located on the banks of the River Thames it offers unrivalled views over London.</td></tr></table></div>");
	 });
	 break;

		 case 7:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>New Bond Street</b><br> London's exclusive shopping destination, New Bond Street, is home to many of the big designer brands including Gucci, Alexander McQueen and Mulberry.</td></tr></table></div>");
	 });
	 break;

		 case 8:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>Portobello Road Market</b><br> Portobello Road Market is the world’s largest antiques market and is internationally recognised for its second-hand and antique sections. No surprise that it’s also one of London’s most visited tourist attractions, especially after the success of the movie “Notting Hill”. However, the history and culture of Portobello Road Market span approximately 300 years of existence.</td></tr></table></div>");
	 });
	 break;

		 case 9:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>Lords Cricket Ground</b><br> It has long been seen as the “home of cricket, this revered ancient cricket ground has been the site of many a historic victory and many more England Batting Collapses.</td></tr></table></div>");
	 });
	 break;

		 case 10:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>The Royal Albert Hall</b><br> The Royal Albert Hall is one of London's most famous venues, hosting some of the biggest international names in the music and arts worlds, including the world-famous annual BBC Proms concert series.</td></tr></table></div>");
	 });
	 break;

		 case 11:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>Diana, Princess of Wales’ Memorial Playground</b><br> Princess Diana would have loved this playground in Kensington Gardens, which was built to commemorate her spirit and important charity work. It occupies the site of an earlier playground funded by J M Barrie (author of Peter Pan), who, like Princess Diana was a local who spent many happy times in this part of Hyde Park.</td></tr></table></div>");
	 });
	 break;

		 case 12:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>Hamleys</b><br> Hamleys in London's bustling Regent Street is the daddy of all toy shops. Explore a breathtaking selection of toys and games on seven sprawling floors, pick up a few tricks from the in-house magicians and try before you buy.</td></tr></table></div>");
	 });
	 break;

		 case 13:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>Regent Street</b><br> The sweeping boulevard of Regent Street is one of the finest shopping streets in the world. Visitors are drawn by the world’s most desirable brand names and the contemporary elegance of the shops, creating a unique destination for taking time out, day or night.</td></tr></table></div>");
	 });
	 break;

		 case 14:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>Royal Academy of Arts</b><br> Founded by George III in 1768, the Royal Academy of Arts was the first British gallery devoted solely to the promotion of the visual arts. It stages exhibitions throughout the year including, famously, the annual Summer Exhibition, going strong since the year after the Academy's foundation.</td></tr></table></div>");
	 });
	 break;

		 case 15:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>Buckingham Palace</b><br> Buckingham Palace is the official residence of the British monarch. The Palace is a setting for state occasions, royal entertaining and a major tourist attraction.</td></tr></table></div>");
	 });
	 break;

		 case 16:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>The City of London</b><br> Located in the heart of London and home primarily to the financial services industry, The City of London combines both modern and historic architecture and includes the famous gherkin building.</td></tr></table></div>");
	 });
	 break;

		 case 17:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>London Aquarium</b><br> Journey into the deep blue at the London Aquarium to come face-to-face with scary tiger sharks, explore rainforest streams where catfish dwell and find out the answers to perplexing questions.</td></tr></table></div>");
	 });
	 break;

		 case 18:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>Covent Garden Piazza</b><br> The site of the old flower, fruit and vegetable market in London's West End, Covent Garden Piazza has become a glorious pedestrianised area for boutiques, restaurants, bars, entertainers and thousands of people, both tourists and Londoners alike.</td></tr></table></div>");
	 });
	 break;

		 case 19:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>China Town</b><br> A vibrant part of London's Soho, China Town has a huge range of Chinese shops, bars and restaurants.</td></tr></table></div>");
	 });
	 break;

		 case 20:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>West End Theatre District</b><br> London's West End Theatres are some of the best in the world, rivalled only by Broadway.</td></tr></table></div>");
	 });
	 break;

		 case 21:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>Tate Modern</b><br> The industrial Bankside Power Station on the south bank of the Thames houses the Tate Modern gallery's world-class 20th-century and contemporary art collection. Catch temporary exhibitions too or take tea overlooking the River Thames.</td></tr></table></div>");
	 });
	 break;

		 case 22:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>Vinopolis</b><br> Vinopolis London offers a unique chance to explore the world’s wine producing regions. Located on Borough Market – on weekends, one of London’s most exciting foodie experiences- Vinopolis perfectly complements this bursting area. The Vinopolis ‘museum of wine’ offers wine tours including a variety of tastings and lectures.</td></tr></table></div>");
	 });
	 break;

		 case 23:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>London Dungeons</b><br> Bloodthirsty youngsters can brave the murky chambers and ghost towers of the London Dungeon, where interactive exhibits recreate everything from the Great Plague and Great Fire to the darker corners of Victorian London.</td></tr></table></div>");
	 });
	 break;

		 case 24:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>Tower of London</b><br> Since William the Conqueror in 1066, English kings have slept, eaten and executed rivals in the Tower of London on the River Thames. Find primitive Norman toilets in the White Tower and the Crown Jewels in the Jewel House.</td></tr></table></div>");
	 });
	 break;

		 case 25:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>Canary Wharf</b><br> A large modern business and shopping destination and home to the UK’s three tallest buildings.</td></tr></table></div>");
	 });
	 break;

		 case 26:
		 GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<div style=\"font:Arial, Helvetica, sans-serif;font-size:10px;color:#3F454F;text-autospace : ideograph-alpha;width:350px\"><table border=\"0\"><tr><td><b>Madam Tussuards</b><br> Madam Tussuards offers a unique opportunity to hang out with the wax counterparts of all the most famous stars of stage, screen and sport, as well as politicians, religious leaders and a host of fictional and historical heroes and villains.</td></tr></table></div>");
	 });
	 break;

	 default : 
	 break;
 }
	 return marker;
}
	 function setDirections(fromAddress, toAddress, locale) {
	 if(fromAddress=="The Langham London")
	 fromAddress = "1C Portland Pl, Westminster, London W1B";
	 if(toAddress=="")return;	 gdir.load("from: " + fromAddress + " London to: " + toAddress + " London",{locale:"en"});
	 }

	 function handleErrors(){
	 if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nError code: " + gdir.getStatus().code);
	 else if (gdir.getStatus().code == G_GEO_SERVER_ERROR)
	 alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: " + gdir.getStatus().code);
	 else if (gdir.getStatus().code == G_GEO_MISSING_QUERY)
	 alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: " + gdir.getStatus().code);
	 else if (gdir.getStatus().code == G_GEO_BAD_KEY)
	 alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: " + gdir.getStatus().code);
	 else if (gdir.getStatus().code == G_GEO_BAD_REQUEST)
	 alert("A directions request could not be successfully parsed.\n Error code: " + gdir.getStatus().code);
	 else alert("An unknown error occurred.");
}
function onGDirectionsLoad(){
 }