var MM_contentVersion = 10;
var flashenabled = false;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i];
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}

function promoOver(promoNumber)
 {
    // As an alternative to display, the zIndex order can be reversed. Set zIndex with i=2 and h=1 in CSS first.
//  document.getElementById('promoImage' + promoNumber + 'i').style.zIndex='1';
//  document.getElementById('promoImage' + promoNumber + 'h').style.zIndex='2';
  document.getElementById('promoImage' + promoNumber + 'i').style.display='none';
  document.getElementById('promoImage' + promoNumber + 'h').style.display='inline';
 }
function promoOut(promoNumber)
 {
  document.getElementById('promoImage' + promoNumber + 'i').style.display='inline';
  document.getElementById('promoImage' + promoNumber + 'h').style.display='none';
 }

function showOver(showNumber)
 { document.getElementById('showcaseLink' + showNumber).style.backgroundColor='#144B81'; }

function showOut(showNumber)
 { document.getElementById('showcaseLink' + showNumber).style.backgroundColor='#4F78A1'; }

function menuOver(menuName)
 { document.getElementById('dropMenu' + menuName).style.display = 'inline'; }

function menuOut(menuName)
 { document.getElementById('dropMenu' + menuName).style.display='none'; }

function footerPlace()
 {
  var footerTop = document.getElementById("leftPane").clientHeight + 166;
  var Comp = document.getElementById("contentPane").clientHeight + 220; // 183;
  if (Comp > footerTop) { footerTop = Comp }
  var Comp = document.getElementById("rightPane").clientHeight + 110;
  if (Comp > footerTop) { footerTop = Comp }
  if (document.getElementById("columnComp"))
  {
   var Comp = document.getElementById("columnComp").clientHeight + 210;
   if (Comp > footerTop) { footerTop = Comp }
  }
  document.getElementById("footer").style.top = (footerTop+20) + "px";
  document.getElementById("main").style.height = (footerTop+80) + "px";
  document.getElementById("footer").style.display = 'inline';
  document.getElementById("body").style.backgroundColor='#520C02';
 }
 
 function GoogleMapParkingLoad()
 {
  if (GBrowserIsCompatible()) {
   var GoogleMapParking = new GMap2(document.getElementById("GoogleMapParking"));
   GoogleMapParking.addControl(new GSmallMapControl());
   GoogleMapParking.setCenter(new GLatLng(50.909838906046964,-1.4102840423583984), 15);
   
   var TheatreIcon = new GIcon();
   TheatreIcon.image = "http://www.mayflower.org.uk/art/pages/maps/theatre.png";
   TheatreIcon.iconSize = new GSize(33, 40);
   TheatreIcon.iconAnchor = new GPoint(16, 30);
   TheatreIcon.infoWindowAnchor = new GPoint(5, 1);

   var CarParkIcon = new GIcon();
   CarParkIcon.image = "http://www.mayflower.org.uk/art/pages/maps/carpark.png";
   CarParkIcon.iconSize = new GSize(15, 20);
   CarParkIcon.iconAnchor = new GPoint(7, 10);
   CarParkIcon.infoWindowAnchor = new GPoint(5, 1);
   
   var point = new GLatLng(50.90874296517347,-1.4102840423583984);
   GoogleMapParking.addOverlay(GoogleMapsCreateMarker(point, "<b>Mayflower Theatre</b><br />(no customer parking on site)", TheatreIcon));
   var point = new GLatLng(50.90791760995153,-1.409318447113037);
   GoogleMapParking.addOverlay(GoogleMapsCreateMarker(point, "West Park Road - 516 places", CarParkIcon));
   var point = new GLatLng(50.907863487786365,-1.4143824577331543);
   GoogleMapParking.addOverlay(GoogleMapsCreateMarker(point, "Southbrook Road - 113 places", CarParkIcon));
   var point = new GLatLng(50.91075893525165,-1.4074516296386719);
   GoogleMapParking.addOverlay(GoogleMapsCreateMarker(point, "Grosvenor Square - 545 places", CarParkIcon));
   var point = new GLatLng(50.905657956026815,-1.4085030555725098);
   GoogleMapParking.addOverlay(GoogleMapsCreateMarker(point, "Marlands - 817 places", CarParkIcon));
  }
 }

 function GoogleMapDirectionsLoad()
 {
  if (GBrowserIsCompatible()) {
   var GoogleMapNorth = new GMap2(document.getElementById("GoogleMapNorth"));
   GoogleMapNorth.addControl(new GSmallMapControl());
   GoogleMapDirectionsPanel = document.getElementById("my_textual_div");
   GoogleMapDirections = new GDirections(GoogleMapNorth, GoogleMapDirectionsPanel);
   GoogleMapDirections.load("50.97339986848276,-1.375265121459961 to 50.91075893525165,-1.4074516296386719");
   GoogleMapNorth.setCenter(new GLatLng(50.909838906046964,-1.4102840423583984), 11);

   var GoogleMapWest = new GMap2(document.getElementById("GoogleMapWest"));
   GoogleMapWest.addControl(new GSmallMapControl());
   GoogleMapDirectionsPanel = document.getElementById("my_textual_div");
   GoogleMapDirections = new GDirections(GoogleMapWest, GoogleMapDirectionsPanel);
   GoogleMapDirections.load("Bournemouth to 50.90791760995153,-1.409318447113037");
   GoogleMapWest.setCenter(new GLatLng(50.909838906046964,-1.4102840423583984), 11);

   var GoogleMapEast = new GMap2(document.getElementById("GoogleMapEast"));
   GoogleMapEast.addControl(new GSmallMapControl());
   GoogleMapDirectionsPanel = document.getElementById("my_textual_div");
   GoogleMapDirections = new GDirections(GoogleMapEast, GoogleMapDirectionsPanel);
   GoogleMapDirections.load("Portsmouth to 50.91075893525165,-1.4074516296386719");
   GoogleMapEast.setCenter(new GLatLng(50.909838906046964,-1.4102840423583984), 11);
   
   var TheatreIcon = new GIcon();
   TheatreIcon.image = "http://www.mayflower.org.uk/art/pages/maps/theatre.png";
   TheatreIcon.iconSize = new GSize(33, 40);
   TheatreIcon.iconAnchor = new GPoint(16, 30);
   TheatreIcon.infoWindowAnchor = new GPoint(5, 1);

   var point = new GLatLng(50.90874296517347,-1.4102840423583984);
   GoogleMapNorth.addOverlay(GoogleMapsCreateMarker(point, "<b>Mayflower Theatre</b>", TheatreIcon));
   GoogleMapWest.addOverlay(GoogleMapsCreateMarker(point, "<b>Mayflower Theatre</b>", TheatreIcon));
   GoogleMapEast.addOverlay(GoogleMapsCreateMarker(point, "<b>Mayflower Theatre</b>", TheatreIcon));
  }
 }

 function GoogleMapCoachesLoad()
 {
  if (GBrowserIsCompatible()) {
   var GoogleMapCoaches = new GMap2(document.getElementById("GoogleMapCoaches"));
   GoogleMapCoaches.addControl(new GSmallMapControl());
   GoogleMapCoaches.setCenter(new GLatLng(50.90839117621259,-1.4109277725219727), 17);
   
   var TheatreIcon = new GIcon();
   TheatreIcon.image = "http://www.mayflower.org.uk/art/pages/maps/theatre.png";
   TheatreIcon.iconSize = new GSize(33, 40);
   TheatreIcon.iconAnchor = new GPoint(16, 30);
   TheatreIcon.infoWindowAnchor = new GPoint(16, 30);

   var CoachNoIcon = new GIcon();
   CoachNoIcon.image = "http://www.mayflower.org.uk/art/pages/maps/coach-no.png";
   CoachNoIcon.iconSize = new GSize(150, 30);
   CoachNoIcon.iconAnchor = new GPoint(50, 15);
   CoachNoIcon.infoWindowAnchor = new GPoint(75, 15);

   var CoachYesIcon = new GIcon();
   CoachYesIcon.image = "http://www.mayflower.org.uk/art/pages/maps/coach-yes.png";
   CoachYesIcon.iconSize = new GSize(150, 30);
   CoachYesIcon.iconAnchor = new GPoint(50, 15);
   CoachYesIcon.infoWindowAnchor = new GPoint(75, 15);

   var point = new GLatLng(50.90843176738222,-1.40999436378479);
   GoogleMapCoaches.addOverlay(GoogleMapsCreateMarker(point, "<b>Mayflower Theatre</b>", TheatreIcon));
   var point = new GLatLng(50.90874296517347,-1.4102840423583984);
   GoogleMapCoaches.addOverlay(GoogleMapsCreateMarker(point, "No coach pick up or waiting at any time", CoachNoIcon));
   var point = new GLatLng(50.90808674131211,-1.4121723175048828);
   GoogleMapCoaches.addOverlay(GoogleMapsCreateMarker(point, "Coach Parking on road", CoachYesIcon));
  }
 }

 function GoogleMapTransportLoad()
 {
  if (GBrowserIsCompatible()) {
   var GoogleMapTransport = new GMap2(document.getElementById("GoogleMapTransport"));
   GoogleMapTransport.addControl(new GSmallMapControl());
   GoogleMapTransport.setCenter(new GLatLng(50.907180190038936,-1.4113998413085938), 16);
   
   var TheatreIcon = new GIcon();
   TheatreIcon.image = "http://www.mayflower.org.uk/art/pages/maps/theatre.png";
   TheatreIcon.iconSize = new GSize(33, 40);
   TheatreIcon.iconAnchor = new GPoint(16, 30);
   TheatreIcon.infoWindowAnchor = new GPoint(16, 30);

   var TrainIcon = new GIcon();
   TrainIcon.image = "http://www.mayflower.org.uk/art/pages/maps/train.png";
   TrainIcon.iconSize = new GSize(40, 20);
   TrainIcon.iconAnchor = new GPoint(20, 10);
   TrainIcon.infoWindowAnchor = new GPoint(20, 10);
   var BusIcon = new GIcon();
   BusIcon.image = "http://www.mayflower.org.uk/art/pages/maps/bus.png";
   BusIcon.iconSize = new GSize(40, 20);
   BusIcon.iconAnchor = new GPoint(20, 10);
   BusIcon.infoWindowAnchor = new GPoint(20, 10);
   var FerryIcon = new GIcon();
   FerryIcon.image = "http://www.mayflower.org.uk/art/pages/maps/ferry.png";
   FerryIcon.iconSize = new GSize(40, 20);
   FerryIcon.iconAnchor = new GPoint(20, 10);
   FerryIcon.infoWindowAnchor = new GPoint(20, 10);
   var CoachIcon = new GIcon();
   CoachIcon.image = "http://www.mayflower.org.uk/art/pages/maps/coach.png";
   CoachIcon.iconSize = new GSize(40, 20);
   CoachIcon.iconAnchor = new GPoint(20, 10);
   CoachIcon.infoWindowAnchor = new GPoint(20, 10);
   
   var point = new GLatLng(50.90874296517347,-1.4102840423583984);
   GoogleMapTransport.addOverlay(GoogleMapsCreateMarker(point, "<b>Mayflower Theatre</b>", TheatreIcon));
   var point = new GLatLng(50.90746433487489,-1.4136850833892822);
   GoogleMapTransport.addOverlay(GoogleMapsCreateMarker(point, "Southampton Central Train Station", TrainIcon));
   var point = new GLatLng(50.90846559332986,-1.4130520820617676);
   GoogleMapTransport.addOverlay(GoogleMapsCreateMarker(point, "Southampton Central Station Bus Interchange", BusIcon));
   var point = new GLatLng(50.907159893912855,-1.4131057262420654);
   GoogleMapTransport.addOverlay(GoogleMapsCreateMarker(point, "CityLink Bus service stop (for Red Funnel ferries)", FerryIcon));
   var point = new GLatLng(50.906016531186786,-1.4090394973754883);
   GoogleMapTransport.addOverlay(GoogleMapsCreateMarker(point, "National Express Coach Station", CoachIcon));
  }
 }
 
 function GoogleMapsCreateMarker(point, description, icon) {
  var marker = new GMarker(point, icon);
  GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml(description);
  });
  return marker;
 }
