var path = "";
var imagePath = "";
var section;
//,
//,
var menus = new Array("Home","London Hotels","Britain Hotels","Attraction Tickets","Box Office","Dinner and Theatre","Airport Transfers","London Pass","Sightseeing","Unique Experiences","Events","Directory","London Blog","London Maps","Contact");
var links = new Array("/","/hotels/","/hotels/britain","/attractionstickets/","/tickets/","/TheatreAndDinner/","/transfer","/londonpass","/sightseeing/","/UniqueExperiences/index.phtml?prodcateg=21&referer=hom","/LondonEvent.php/","/directory","/LondonBlog/Nelsons","/maps/","/contact/");
//,,

// If we're on the secure server we don't want the menu to also point to the secure server
var currURL = window.location.href;

if(currURL.indexOf("https:") == -1)
{
	imagePath = "http://images.londontown.com";

	// Are we on dev2?
	if(currURL.indexOf('dev2') == -1)
	{
		path="http://www.londontown.com";
	}
	else
	{
		path="http://dev2";
	}
}

// LONDON PASS
if (section == "londonpass") {
  MenuOn = "London Pass";
  MenuSub=0;

// MAPS
} else if (section == "maps") {
  MenuOn = "London Maps";
  MenuSub=0;


// SIGHTSEEING
} else if (section == "London Blog"){

	MenuOn = "London Blog";
	MenuSub = 0;

} else if (section == "sight") {

	ue = new RegExp("UniqueExperiences");

	if (ue.test(location.href))
	{
		MenuOn = "Unique Experiences";
	}
	else
	{
		MenuOn = "Sightseeing";
	}
	MenuSub=0;
// CAR RENTAL
} else if (section == "carrental") {
  MenuOn = "Car Rental";
  MenuSub=0;

// AIRPORT TRANSFERS
} else if (section == "Airport Transfers") {
  MenuOn = "Airport Transfers";
  MenuSub=0;

// THEATRE
} else if (section == "theatre" || section == "boxoffice") {
  MenuOn = "Box Office";
  MenuArc= new Array("Discounted tickets");
  MenuLnk= new Array("/halfpricetickets");
  MenuSub= 1;

// CANCEL HOTELS
} else if (section == "cancelHotels") {
  MenuOn = "Hotels";
  MenuSub=1;
  MenuArc= new Array("Cancel a booking");
  MenuLnk= new Array("/cancel/");

// HOTELS
} else if (section == "Hotels") {

	MenuOn = "London Hotels";
	urlquery= new Array();
	//urlterms= new Array();
	urlquery=location.href.split("?")

	// Britain hotels check
	var bre  = new RegExp("britain");
	var bre2  = new RegExp("searchFormSkin=");

	if (bre.test(location.href) || bre2.test(location.href))
	{
		MenuOn = "Britain Hotels";
	}

	MenuSub=1;

	re = new RegExp("\/booking\/");
	result = re.test(urlquery[0]);
	re2 = new RegExp("indep=yes");
	result2 = re2.test(urlquery[1]);
	re3 = new RegExp("stage=1");
	result3 = re3.test(urlquery[1]);
	if (result==false && result2==false) {
		if (urlquery[1]) {
	//	  urlterms=urlquery[1].split("&")
	//	  var starsurl3="/progress_multi.phtml?"+urlquery[1]+"&changeto=3";
	//	  var starsurl4="/progress_multi.phtml?"+urlquery[1]+"&changeto=4";
	//	  var starsurl5="/progress_multi.phtml?"+urlquery[1]+"&changeto=5";
		  if (!result3)
		  {
			  MenuSub=4;
		  }
		}
	}
	if (MenuSub==4) {
		MenuSub=1;
	//  MenuArc= new Array("Cancel a booking","Search 3 stars","Search 4 stars","Search 5 stars");
	//  MenuLnk= new Array("/cancel/",starsurl3,starsurl4,starsurl5);
		MenuArc= new Array("Cancel a booking","Search Again");
		MenuLnk= new Array("/cancel/","/hotels/");
	} else {
		MenuArc= new Array("Cancel a booking");
		MenuLnk= new Array("/cancel/");
	}

// SECTIONLESS
} else if (section == "sectionless") {
  MenuOn = "";
  MenuSub=0;

// GIFTSHOP
} else if (section == "giftshop") {
  MenuOn = "Giftshop";
  MenuSub=0;

}

var i;

var j;
var MenuSub;
var MenuArc;
var menus;


function golink(url){
	//alert(''+url+'');
	location.href= url;
}



var isNav = (navigator.appName.indexOf("Netscape")!=-1);		// Is Netscape running (yuk)
var navVar = (navigator.appVersion.indexOf("4.")==0);			// If version 4 running (even more yuk)

if (isNav&&navVar){
//&&(section!="Hotels")
document.write('<table width="121" border="0" cellspacing="0" cellpadding="0">');
document.write('  <tr bgcolor="#003366">');
document.write('<td colspan="2"><img src="' + imagePath + '/LTtemplates/template_images/londontown.trans.gif" width="10" height="1"></td>');
document.write('</tr><tr>');
document.write('    <td width="117"  bgcolor="#437CB0" class="tail_white9pxbold">&nbsp;&nbsp;<a href='+path+'/  class="tail_white9pxbold">Homer</a></td>');
document.write('    <td width="4"><img name="HotelImage" border="0" src="' + imagePath + '/LTtemplates/template_images/arrow.unhighlight.gif" width="13" height="19"></td>');
document.write('  </tr>');
document.write('<tr><td colspan="2" bgcolor="#003366"><img src="' + imagePath + '/LTtemplates/template_images/londontown.trans.gif" width="10" height="1"></td></tr>');
document.write('<tr bgcolor="#003366">');
document.write('    <td bgcolor="#437CB0" >&nbsp;&nbsp;<a href="'+path+'/hotels/" class="tail_white9pxbold" onMouseOver="imgswap(\'HotelImage\')" onMouseOut="restore();">Hotels</a></td>');
document.write('<td><img name="HotelImage" border="0" src="' + imagePath + '/LTtemplates/template_images/arrow.unhighlight.gif" width="13" height="19"></td>');
document.write('</tr><tr><td colspan="2" bgcolor="#003366"><img src="' + imagePath + '/LTtemplates/template_images/londontown.trans.gif" width="10" height="1"></td></tr>');
document.write('<tr bgcolor="#003366">');
document.write('    <td bgcolor="#437CB0" >&nbsp;&nbsp;<a href="'+path+'/theatre/" class="tail_white9pxbold" onMouseOver="imgswap(\'Theatre\')" onMouseOut="restore();">Box ');
document.write('      Office</a></td>');
document.write('<td><img name="Theatre" border="0" src="' + imagePath + '/LTtemplates/template_images/arrow.unhighlight.gif" width="13" height="19"></td>');
document.write('</tr><tr><td colspan="2" bgcolor="#003366"><img src="' + imagePath + '/LTtemplates/template_images/londontown.trans.gif" width="10" height="1"></td></tr>');
document.write('<tr bgcolor="#003366">');
document.write('    <td bgcolor="#437CB0" >&nbsp;&nbsp;<a href="'+path+'/LondonEvent.php" class="tail_white9pxbold" onMouseOver="imgswap(\'Event\')" onMouseOut="restore();">Events</a></td>');
document.write('<td><img name="Event" border="0" src="' + imagePath + '/LTtemplates/template_images/arrow.unhighlight.gif" width="13" height="19"></td>');
document.write('</tr><tr><td colspan="2" bgcolor="#003366"><img src="' + imagePath + '/LTtemplates/template_images/londontown.trans.gif" width="10" height="1"></td></tr>');
document.write('<tr bgcolor="#003366">');
document.write('    <td bgcolor="#437CB0" >&nbsp;&nbsp;<a href="'+path+'/directory/" class="tail_white9pxbold" onMouseOver="imgswap(\'Directory\')" onMouseOut="restore();">Directory</a></td>');
document.write('<td><img name="Directory" border="0" src="' + imagePath + '/LTtemplates/template_images/arrow.unhighlight.gif" width="13" height="19"></td>');
document.write('</tr><tr><td colspan="2" bgcolor="#003366"><img src="' + imagePath + '/LTtemplates/template_images/londontown.trans.gif" width="10" height="1"></td></tr>');
document.write('<tr bgcolor="#003366">');
document.write('    <td bgcolor="#437CB0" >&nbsp;&nbsp;<a href="'+path+'/maps/" class="tail_white9pxbold" onMouseOver="imgswap(\'Map\')" onMouseOut="restore();">Maps</a></td>');
document.write('<td><img name="Map" border="0" src="' + imagePath + '/LTtemplates/template_images/arrow.unhighlight.gif" width="13" height="19"></td>');
document.write('</tr><tr><td colspan="2" bgcolor="#003366"><img src="' + imagePath + '/LTtemplates/template_images/londontown.trans.gif" width="10" height="1"></td></tr>');
document.write('<tr bgcolor="#003366">');
document.write('    <td bgcolor="#437CB0" >&nbsp;&nbsp;<a href="'+path+'/postcards/" class="tail_white9pxbold" onMouseOver="imgswap(\'Postcard\')" onMouseOut="restore();">Postcards</a></td>');
document.write('<td><img name="Postcard" border="0" src="' + imagePath + '/LTtemplates/template_images/arrow.unhighlight.gif" width="13" height="19"></td>');
document.write('</tr><tr><td colspan="2" bgcolor="#003366"><img src="' + imagePath + '/LTtemplates/template_images/londontown.trans.gif" width="10" height="1"></td></tr>');
//document.write('<tr bgcolor="#003366">');
//document.write('    <td bgcolor="#437CB0" >&nbsp;&nbsp;<a href="'+path+'/giftshop/" class="tail_white9pxbold" onMouseOver="imgswap(\'Giftshop\')" onMouseOut="restore();">Giftshop</a></td>');
//document.write('<td><img name="Giftshop" border="0" src="/LTtemplates/template_images/arrow.unhighlight.gif" width="13" height="19"></td>');
//document.write('</tr><tr><td colspan="2" bgcolor="#003366"><img src="/LTtemplates/template_images/londontown.trans.gif" width="10" height="1"></td></tr>');
document.write('<tr bgcolor="#003366">');
document.write('    <td bgcolor="#437CB0" >&nbsp;&nbsp;<a href="'+path+'/contact" class="tail_white9pxbold" onMouseOver="imgswap(\'Contact\')" onMouseOut="restore();">Contact</a></td>');
document.write('<td><img name="Contact" border="0" src="' + imagePath + '/LTtemplates/template_images/arrow.unhighlight.gif" width="13" height="19"></td>');
document.write('</tr><tr><td colspan="2" bgcolor="#003366"><img src="' + imagePath + '/LTtemplates/template_images/londontown.trans.gif" width="10" height="1"></td></tr>');
document.write('</table>');


} else {

document.write('<table width="121" border="0" cellspacing="0" cellpadding="0">');



for (i=0;i<=menus.length-1;i++){
	if (menus[i] != "Giftshop"){
		if (menus[i] == MenuOn){
			document.writeln('<tr bgcolor="#003366"><td colspan="2"><img src="' + imagePath + '/LTtemplates/template_images/londontown.trans.gif" width="10" height="1"></td></tr><tr><td width="117" onMouseDown="golink(\''+path+links[i]+'\');"  bgcolor=#18558A class="tail_white9pxbold"style="cursor:hand">&nbsp;&nbsp;&nbsp;<a href='+path+links[i]+'  class="tail_white9pxbold">'+menus[i]+'</a></td><td width="4"><img src="' + imagePath + '/LTtemplates/template_images/arrow.highlight.gif" width="13" height="19"></td></tr>');
			if (MenuSub==1){
				for (j=0;j<=MenuArc.length-1;j++){
					document.writeln('<tr><td colspan="2" bgcolor="#003366" background="' + imagePath + '/LTtemplates/template_images/directory.dotted.menu.gif"><img src="' + imagePath + '/LTtemplates/template_images/londontown.trans.gif" width="10" height="1"></td></tr><tr><td bgcolor="#98BDE0" style="cursor:hand" onMouseDown="golink(\''+path+MenuLnk[j]+'\');" width="117"><a class="tail_blue9pxbold" href="'+path+MenuLnk[j]+'">&nbsp;&nbsp;&nbsp;'+MenuArc[j]+'</a></td><td width="4"><img src="' + imagePath + '/LTtemplates/template_images/arrow.lightblue.gif" width="13" height="19"></td></tr>');
				}
			}

		} else {
			document.write('<tr><td colspan="2" bgcolor="#003366"><img src="' + imagePath + '/LTtemplates/template_images/londontown.trans.gif" width="10" height="1"></td></tr><tr bgcolor="#003366"><td bgcolor="#437CB0" style="cursor:hand" onMouseDown="golink(\''+path+links[i]+'\');"  onMouseOver="col_change(this,\''+menus[i]+'\');" onMouseOut="col_back(this);">&nbsp;&nbsp;<a href='+path+links[i]+' class="tail_white9pxbold" onMouseOver="imgswap(\''+menus[i]+'\')"onMouseOut="restore();">'+menus[i]+'</a></td><td><img name="'+menus[i]+'" border="0" src="' + imagePath + '/LTtemplates/template_images/arrow.unhighlight.gif" width="13" height="19"></td></tr>');

		}
	}

}

document.write('<tr><td colspan=2 bgcolor=#003366><img src=' + imagePath + '/LTtemplates/template_images/londontown.trans.gif width=10 height=1></td></tr></table>');

}



