
var mmbRefMonthListLong = "January:February:March:April:May:June:July:August:September:October:November:December";
var mmbRefMonthListShort = "Jan:Feb:Mar:Apr:May:Jun:Jul:Aug:Sep:Oct:Nov:Dec";
var mmbRefDayListLong="Sunday:Monday:Tuesday:Wednesday:Thursday:Friday:Saturday";
var mmbRefDayListShort="Sun:Mon:Tue:Wed:Thu:Fri:Sat";
flightSellingMandatoryFields = new Array();
fsIndicatorLookup = new Array();
fsLabelLookup = new Array();
function getExtHolidaysUrl(CountryCode) {
return ("/bahols/?source=mmb&chosenCountry=" + CountryCode.toUpperCase());
}
function getBookCarHire() {
return ("http://tracker.tradedoubler.com/click?p=19090&a=991718&g=819535");
}
function getExtCurrencyExchangeUrl() {
return ("http://www.travelex.co.uk/ba/Converter.asp");
}
function getExtVisaInformationUrl() {
return ("http://thamesconsular.com");
}
var fxp_count = 0
function fxp_SetMandatoryFields(Fields) {
flightSellingMandatoryFields[fxp_count] = Fields.split(':');
fsIndicatorLookup[flightSellingMandatoryFields[fxp_count][0]] = flightSellingMandatoryFields[fxp_count][1];
fsLabelLookup[flightSellingMandatoryFields[fxp_count][0]] = flightSellingMandatoryFields[fxp_count][2];
fxp_count++
}
function isMandatory(aManFieldsArray,field) {
for (var i=0;i<aManFieldsArray.length;i++) {
if (aManFieldsArray[i]==field) {
return "True";
}
}
return "False";
}
function ba_SelectComponent (FieldName,Selected,Options,OptionsCode,Header){
OptionsArray = Options.split(':');
if (OptionsCode==""){
OptionsCode = Options;
}
OptionsCodeArray = OptionsCode.split(':');
document.write('<select class="nlflightbookingselect" name=',FieldName,'>');
if(Header != ""){document.write('<option value="">',Header,'</option>');}
for(var i=0;i<OptionsArray.length;i++) {
if (OptionsArray[i].toUpperCase() == Selected.toUpperCase()||OptionsCodeArray[i] == Selected) {selected="selected"} else {selected=""};
document.write('<option value="'+OptionsCodeArray[i]+'" '+selected+'>'+OptionsArray[i]+'</option>');
}
document.write('</select>');
}
function mmb_TableStart(ColumnWidths,ClassName) {
Columns = ColumnWidths.split(':');
currentTableColumns = Columns.length;
var TableWidth = 0
for(var i=0;i<Columns.length;i++) {Col = eval(Columns[i]);TableWidth = TableWidth + Col;}
document.write('<table width="',TableWidth,'" cellspacing="0" cellpadding="0" border="0" class="',ClassName,'"><tr valign="top" align="left">');
for(var i=0;i<Columns.length;i++) {
document.write('<td width="',Columns[i],'"><img src="/cms/s.gif" width="',Columns[i],'" height="1" border="0" alt=""/></td>');
}
document.write('</tr>');
}
function mmb_ItineraryRow(Label,LabelClass,Value,ValueClass){
document.write('<tr><td><img src="/cms/s.gif" border="0" alt="" width="1" height="1"/></td>');
document.write('<td class="',LabelClass,'" valign="top">',Label,'</td>');
document.write('<td class="',ValueClass,'">',Value,'</td>');
document.write('<td><img src="/cms/s.gif" border="0" alt="" width="1" height="1"/></td></tr>');
}
function mmb_ItineraryRowLink(Label,LabelClass,Url,Value,ValueClass){
document.write('<tr><td><img src="/cms/s.gif" border="0" alt="" width="1" height="1" /></td>');
document.write('<td class="',LabelClass,'" valign="top">',Label,'</td>');
document.write('<td class="',ValueClass,'"><a href="',Url,'">',Value,'</a></td>');
document.write('<td><img src="/cms/s.gif" border="0" alt="" width="1" height="1" /></td></tr>');
}
function mmb_LineBreak(x){
if (x == null){x=1};
for(var i=0;i<x;i++) {document.write('<br />')};
}
function mmb_StrongFormHeader(TableWidth,Text){
document.write('<table width="',TableWidth,'" cellspacing="0" cellpadding="0" border="0">');
document.write('<tr><td width="10"><img src="/cms/global/images/icons/formStrongTopLeft.gif" width="10" height="5" border="0" alt="" /></td><td class="nlstrongtabletitle"><img src="/cms/s.gif" width="1" height="5" alt="" border="0"/></td><td width="10"><img src="/cms/global/images/icons/formStrongTopRight.gif" width="10" height="5" border="0" alt="" /></td></tr>');
document.write('<tr><td width="10" class="nlstrongtabletitle"><img src="/cms/s.gif" width="1" height="1" border="0" alt="" /></td><td class="nlstrongtabletitle">' + Text + '</td><td width="10" class="nlstrongtabletitle"><img src="/cms/s.gif" width="1" height="1" border="0" alt="" /></td></tr>');
ba_SpacerRow("3","5","nlstrongtabletitle");
document.write('</table>');
}
function mmb_AdditionalServicesRowGreyed(text,linkTo,popwidth,popheight)
{
if(popwidth==null) popwidth=200;
if(popheight==null) popheight=200;
document.write('<tr>');
document.write('<td align="center" class="nltablecontentaltprimarystrongbgnone" valign="middle">x</td>');
document.write('<td class="nltablecontentaltprimarybgnone"><a class="rhscontentlinks" href="javascript:popUpScrolling(\'');
	document.write(linkTo);
	document.write('\','+popwidth+','+popheight+')\">' + text + '</a></td>');
	document.write('</tr>');
	document.write('<tr>');
	document.write('<td colspan="2"><img src="/cms/s.gif" width="1" height="5" border="0" alt="" /></td>');
	document.write('</tr>');
}


// Write a row of data with an href, pop up optional
function mmb_AdditionalServicesRow (text, linkTo, popup, print)
{
	document.write('<tr>');
	document.write('<td align="center" width="20"><a href="');
if (popup == true){
if (print == true)
document.write('javascript:mmb_PrintPopup(\'');
else
document.write('javascript:openNewWindow(\'');
}
document.write(linkTo);
if (popup == true){
document.write('\');');
}
document.write('"><img src="/cms/global/images/icons/icon_blue_triangle.gif" width="8" height="8" border="0" alt="&gt;" /></a></td>');
      	document.write('<td class="nltablecontentprimarystrongbgnone"><a class="maintextnounderline" href="');
if (popup == true){
if (print == true)
document.write('javascript:mmb_PrintPopup(\'');
else
document.write('javascript:openNewWindow(\'');
}
document.write(linkTo);
if (popup == true){
document.write('\');');
}
document.write('\">' + text + '</a></td>');
document.write('</tr>');
document.write('<tr>');
document.write('<td colspan="2"><img src="/cms/s.gif" width="1" height="5" border="0" alt="" /></td>');
document.write('</tr>');
}
function mmb_PriorityServicesRow (text, linkTo, popup, print)
{
document.write('<tr>');
document.write('<td align=\"center\" width=\"20\"><a href=\"');
if (popup == true){
if (print == true)
document.write('javascript:mmb_PrintPopup(\'');
else
document.write('javascript:openNewWindow(\'');
}
document.write(linkTo);
if (popup == true){
document.write('\');');
}
document.write('\"><img src=\"/cms/global/images/icons/icon_black_triangle.gif\" width=\"8\" height=\"8\" border=\"0\" alt=\"&gt;\" /></a></td>');
document.write('<td class=\"nltablecontentprimarystrongbgnone\"><a class=\"maintextnounderline\" href=\"');
if (popup == true){
if (print == true)
document.write('javascript:mmb_PrintPopup(\'');
else
document.write('javascript:openNewWindow(\'');
}
document.write(linkTo);
if (popup == true){
document.write('\');');
}
document.write('\">' + text + '</a></td>');
document.write('</tr>');
document.write('<tr>');
document.write('<td colspan=\"2\"><img src=\"/cms/s.gif\" width=\"1\" height=\"5\" border=\"0\" alt=\"\" /></td>');
document.write('</tr>');
}
function mmb_PriorityServicesSupportingRow (text, linkTo, popup, print)
{
document.write('<tr>');
document.write('<td align=\"center\" width=\"20\"><a href=\"');
if (popup == true){
if (print == true)
document.write('javascript:mmb_PrintPopup(\'');
else
document.write('javascript:openNewWindow(\'');
}
document.write(linkTo);
if (popup == true){
document.write('\');');
}
document.write('\"><img src=\"/cms/s.gif" width=\"8\" height=\"8\" border=\"0\" alt=\"&gt;\" /></a></td>');
      	document.write('<td class=\"nltablecontentprimarynobg\"><a class=\"maintextnounderline\" href=\"');
	if (popup == true){
		if (print == true)
			document.write('javascript:mmb_PrintPopup(\'');
		else
			document.write('javascript:openPopup(');
	}
	document.write(linkTo);
	if (popup == true){
		document.write(');');
	}
	document.write('\">' + text + '</a></td>');
	document.write('</tr>');
	document.write('<tr>');
        	document.write('<td colspan=\"2\"><img src=\"/cms/s.gif\" width=\"1\" height=\"5\" border=\"0\" alt=\"\" /></td>');
     		document.write('</tr>');
}

//ptr 3066 This function only used to created for link in "Important changes to USA entry requirements" in Intinerary summary page

function mmb_ImportantChangesToUSAEntryRequirements(text, linkTo, popup, print)
{
	document.write('<a href=\"');
	if (popup == true){
		if (print == true)
			document.write('javascript:mmb_PrintPopup(\'');
		else
			document.write('javascript:openNewWindow(\'');
	}
	document.write(linkTo);
	if (popup == true){
		document.write('\');');
	}
	document.write('\"></a>');
      	document.write('<a class=\"nltablecontentprimarynobg1\" href=\"');
	if (popup == true){
		if (print == true)
			document.write('javascript:mmb_PrintPopup(\'');
		else
			document.write('javascript:openPopup(');
	}
	document.write(linkTo);
	if (popup == true){
		document.write(');');
	}
	document.write('\">' + text + '</a>');
}

//end of 3066

function openPopup(URL,width,height){
 		   	var toolbar = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=" + width + ",height=" + height;
   			window.open(URL,"BA_Popup",toolbar);
   			window.name = "BA_Main";
}

function mmb_AdditionalServicesRowPop (text, linkTo, width, height)
{
	document.write('<tr>');
	document.write('<td align="center" width="20"><a href="javascript:popUpScrolling(\'' + linkTo + '\','+ width +','+ height + ')">');
	document.write('<img src="/cms/global/images/icons/icon_blue_triangle.gif" width="8" height="8" border="0" alt="&gt;" /></a></td>');
    document.write('<td class="nltablecontentprimarystrongbgnone"><a class="maintextnounderline" href="javascript:popUpScrolling(\'' + linkTo + '\','+ width +','+ height + ')">' + text + '</a></td>');
	document.write('</tr>');
	document.write('<tr>');
    document.write('<td colspan="2"><img src="/cms/s.gif" width="1" height="5" border="0" alt="" /></td>');
    document.write('</tr>');
}

//MMB2 new function to write a coloured, bordered table with text inside
//used on summerised itinarary to display email address ot option to enter email address.
//inputLink is optional and causes a space, then a 'click here' anchor to be added followed by a full stop.
function mmb_NoticeTable(noticeText,inputLink, endNoticeText) {
	document.write('<table width="430" cellspacing="0" cellpadding="0" border="0" class="nltablebg2borders">');
	document.write('<tr>');
	document.write('<td colspan="3"><img src="/cms/s.gif" width="1" height="3" border="0" alt="" /></td>');
	document.write('</tr>');
	document.write('<tr>');
	document.write('<td><img src="/cms/s.gif" width="5" height="1" border="0" alt="" /></td>');
	document.write('<td class="nltablecontentprimarynobg">'+noticeText);
	if(inputLink) { document.write(' <a href="'+inputLink+'">'+mmbClickHere+'</a> '+endNoticeText);}
	document.write('</td>');
	document.write('<td><img src="/cms/s.gif" width="5" height="1" border="0" alt="" /></td>');
	document.write('</tr>');
	document.write('<tr>');
	document.write('<td colspan="3"><img src="/cms/s.gif" width="1" height="3" border="0" alt="" /></td>');
	document.write('</tr>');
    document.write('</table>');
}

//Function to write a coloured, bordered table with text inside. Used on summerised itinarary to
//display mobile phone number or option to enter mobile phone number.
//inputLink is optional and causes  anchor text specified by the linkText parameter to be added.
function mmb_NoticeTableLinkTextSpecified(noticeText, linkText, inputLink, endNoticeText) {
	document.write('<table width="430" cellspacing="0" cellpadding="0" border="0" class="nltablebg2borders">');
	document.write('<tr>');
	document.write('<td colspan="3"><img src="cms/s.gif" width="1" height="3" border="0" alt="" /></td>');
	document.write('</tr>');
	document.write('<tr>');
	document.write('<td><img src="cms/s.gif" width="5" height="1" border="0" alt="" /></td>');
	document.write('<td class="nltablecontentprimarynobg">'+noticeText);
	if(inputLink) { document.write(' <a href="'+inputLink+'">'+linkText+'</a>'+endNoticeText);}
	document.write('</td>');
	document.write('<td><img src="cms/s.gif" width="5" height="1" border="0" alt="" /></td>');
	document.write('</tr>');
	document.write('<tr>');
	document.write('<td colspan="3"><img src="cms/s.gif" width="1" height="3" border="0" alt="" /></td>');
	document.write('</tr>');
    document.write('</table>');
}

//***************************************************************************
// Actions
//***************************************************************************

// Print the current page
function mmb_printPage(){
	if (window.print != null) {
		window.print();
	}
	else {
		alert('Please select Print from the File menu.');
	}
}

// Big red action button
function mmb_actionButton(buttonText,URL,buttonWidth){
	document.write('<table border="0" cellspacing="0" cellpadding="0" bgcolor="#EFEFEF"><tr><td>');
	document.write('<table width="' + buttonWidth + '" border="2" cellspacing="0" cellpadding="4" bordercolorlight="#EFEFEF" bordercolordark="Black"><tr>');
	document.write('<td class="nlsubmit" align="center"><div id="submitLayer"><a class="actiontextnounderline" href="' + URL + '">' + buttonText + ' <img src="/cms/global/images/icons/icon_white_triangle.gif" border="0" width="15" alt="&gt;" height="10" /></a></div></td>');
	document.write('</tr></table></td></tr></table>');
}
function mmb_actionButtonWithTabIndex(buttonText,URL,buttonWidth,tabIndex){
	document.write('<table border="0" cellspacing="0" cellpadding="0" bgcolor="#EFEFEF"><tr><td>');
	document.write('<table width="' + buttonWidth + '" border="2" cellspacing="0" cellpadding="4" bordercolorlight="#EFEFEF" bordercolordark="Black"><tr>');
	document.write('<td class="nlsubmit" align="center"><div id="submitLayer"><a class="actiontextnounderline" tabindex="'+tabIndex+'" href="' + URL + '">' + buttonText + ' <img src="/cms/global/images/icons/icon_white_triangle.gif" border="0" width="15" alt="&gt;" height="10" /></a></div></td>');
	document.write('</tr></table></td></tr></table>');
}


// table with return links to summary and detailed itinerary
// and action button to link passed in
function mmb_actionBar (text, linkTo, buttonWidth, summary_eId, detailed_eId, booking){
	summary_url = 'javascript:newloc(&quot;managebooking&quot;,&quot;https&quot;,&quot;?eId=' +summary_eId+ '&amp;BookingSessionStamp=' +booking+ '&quot;)';
	detailed_url = 'javascript:newloc(&quot;managebooking&quot;,&quot;https&quot;,&quot;?eId=' +detailed_eId+ '&amp;BookingSessionStamp=' +booking+ '&quot;)';
	document.write('<table width="430" cellpadding="0" cellspacing="0" border="0">');
	document.write('<tr><td width="12"><a href="' + summary_url +'"><img src="/cms/global/images/icons/icon_blue_revarrow.gif" border="0" width="12" height="13" alt="&lt;" /></a></td><td class="nltablecontentprimarynobg"><a class="alttextnounderline" href="' + summary_url +'">' + mmbReturnToSummarisedItinerary + '</a></td>');
	document.write('<td align="right">');
	document.write('<script language="Javascript">');
	document.write('mmb_actionButton("' + text + '","' + linkTo + '","' + buttonWidth + '");');
	document.write('</script>');
	document.write('</td></tr>');
	document.write('<tr><td width="12"><a href="' + detailed_url + '"><img src="/cms/global/images/icons/icon_blue_revarrow.gif" border="0" width="12" height="13" alt="&lt;" /></a></td><td class="nltablecontentprimarynobg"><a class="alttextnounderline" href="' + detailed_url + '">' + mmbReturnToDetailedItinerary + '</a></td>');
	document.write('<td align="right"><img src="/cms/s.gif" height="1" width="1" border="0" alt="" /></td></tr>');
	document.write('</table>');
}

// table with 1 or 2 return links on left and action button on right
function mmb_actionBarTwoLinks (tableWidth, link1_eId, link1_txt, link2_eId, link2_txt, buttonWidth, buttonLink, buttonTxt, booking){
	url1 = 'javascript:newloc(&quot;managebooking&quot;,&quot;https&quot;,&quot;?eId=' +link1_eId+ '&amp;BookingSessionStamp=' +booking+ '&quot;)';
	url2 = 'javascript:newloc(&quot;managebooking&quot;,&quot;https&quot;,&quot;?eId=' +link2_eId+ '&amp;BookingSessionStamp=' +booking+ '&quot;)';
	document.write('<table width="'+tableWidth+'" cellpadding="0" cellspacing="0" border="0">');
	document.write('<tr><td width="12"><a href="' + url1 +'"><img src="/cms/global/images/icons/icon_blue_revarrow.gif" border="0" width="12" height="13" alt="&lt;" /></a></td><td class="nltablecontentprimarynobg"><a class="alttextnounderline" href="' + url1 +'">' + link1_txt + '</a></td>');
	document.write('<td align="right">');
	document.write('<script language="Javascript">');
	document.write('mmb_actionButton("' + buttonTxt + '","' + buttonLink + '","' + buttonWidth + '");');
	document.write('</script>');
	document.write('</td></tr>');
	document.write('<tr><td width="12"><a href="' + url2 + '"><img src="/cms/global/images/icons/icon_blue_revarrow.gif" border="0" width="12" height="13" alt="&lt;" /></a></td><td class="nltablecontentprimarynobg"><a class="alttextnounderline" href="' + url2 + '">' + link2_txt + '</a></td>');
	document.write('<td align="right"><img src="/cms/s.gif" height="1" width="1" border="0" alt="" /></td></tr>');
	document.write('</table>');
}

// table with 1 or 2 return links on left and action button on right
function mmb_actionBarTwoLinksUpdateBooking (tableWidth, link1_eId, link1_txt, link2_eId, link2_txt, buttonWidth, buttonLink, buttonTxt, booking){
	url1 = 'javascript:newloc(&quot;updatebooking&quot;,&quot;https&quot;,&quot;?eId=' +link1_eId+ '&amp;BookingSessionStamp=' +booking+ '&quot;)';
	url2 = 'javascript:newloc(&quot;managebooking&quot;,&quot;https&quot;,&quot;?eId=' +link2_eId+ '&amp;BookingSessionStamp=' +booking+ '&quot;)';
	document.write('<table width="'+tableWidth+'" cellpadding="0" cellspacing="0" border="0">');
	document.write('<tr><td width="12"><a href="' + url1 +'"><img src="/cms/global/images/icons/icon_blue_revarrow.gif" border="0" width="12" height="13" alt="&lt;" /></a></td><td class="nltablecontentprimarynobg"><a class="alttextnounderline" href="' + url1 +'">' + link1_txt + '</a></td>');
	document.write('<td align="right">');
	document.write('<script language="Javascript">');
	document.write('mmb_actionButton("' + buttonTxt + '","' + buttonLink + '","' + buttonWidth + '");');
	document.write('</script>');
	document.write('</td></tr>');
	document.write('<tr><td width="12"><a href="' + url2 + '"><img src="/cms/global/images/icons/icon_blue_revarrow.gif" border="0" width="12" height="13" alt="&lt;" /></a></td><td class="nltablecontentprimarynobg"><a class="alttextnounderline" href="' + url2 + '">' + link2_txt + '</a></td>');
	document.write('<td align="right"><img src="/cms/s.gif" height="1" width="1" border="0" alt="" /></td></tr>');
	document.write('</table>');
}


// table with  return links to summary and detailed itinerary
function mmb_returnBar (summary_eId, detailed_eId, booking){
	summary_url = 'javascript:newloc(&quot;managebooking&quot;,&quot;https&quot;,&quot;?eId=' +summary_eId+ '&amp;BookingSessionStamp=' +booking+ '&quot;)';
	detailed_url = 'javascript:newloc(&quot;managebooking&quot;,&quot;https&quot;,&quot;?eId=' +detailed_eId+ '&amp;BookingSessionStamp=' +booking+ '&quot;)';
	document.write('<table width="430" cellpadding="0" cellspacing="0" border="0">');
	document.write('<tr><td width="12"><a href="' + summary_url + '"><img src="/cms/global/images/icons/icon_blue_revarrow.gif" border="0" width="12" height="13" alt="<" /></a></td><td class="nltablecontentprimarynobg"><a class="alttextnounderline" href="' + summary_url + '">' + mmbReturnToSummarisedItinerary + '</a></td></tr>');
	document.write('<tr><td colspan="2"><img src="/cms/s.gif" width="1" height="5" border="0" alt="" /></td></tr>');
	document.write('<tr><td width="12"><a href="' + detailed_url + '"><img src="/cms/global/images/icons/icon_blue_revarrow.gif" border="0" width="12" height="13" alt="<" /></a></td><td class="nltablecontentprimarynobg"><a class="alttextnounderline" href="' + detailed_url + '">' + mmbReturnToDetailedItinerary + '</a></td></tr>');
	document.write('</table>');
}

// table with return links to Manage my booking
// and action button to link passed in
function mmb_actionBarSingle (text, linkTo, buttonWidth, summary_eId, booking){
	summary_url = 'javascript:newloc(&quot;managebooking&quot;,&quot;https&quot;,&quot;?eId=' +summary_eId+ '&amp;BookingSessionStamp=' +booking+ '&quot;)';
	document.write('<table width="430" cellpadding="0" cellspacing="0" border="0">');
	document.write('<tr><td width="12"><a href="' + summary_url +'"><img src="/cms/global/images/icons/icon_blue_revarrow.gif" border="0" width="12" height="13" alt="&lt;" /></a></td><td class="nltablecontentprimarynobg"><a class="alttextnounderline" href="' + summary_url +'">' + mmbReturnToManageMyBooking + '</a></td>');
	document.write('<td align="right">');
	document.write('<script language="Javascript">');
	document.write('mmb_actionButton("' + text + '","' + linkTo + '","' + buttonWidth + '");');
	document.write('</script>');
	document.write('</td></tr>');
	document.write('</table>');
}

// table with return links to Manage my booking
// and action button to link passed in
function mmb_actionBarSingleForEmailItinerary (text, linkTo, buttonWidth, summary_eId, booking){
	summary_url = 'javascript:newloc(&quot;managebooking&quot;,&quot;https&quot;,&quot;?eId=' +summary_eId+ '&amp;BookingSessionStamp=' +booking+ '&quot;)';
	document.write('<div class="button primary right"><a class="arrow" href="' + linkTo + '">' + text + ' </a></div>');
	document.write('<div class="lbutton secondary"><a class="plain" href="' + summary_url +'">' + mmbReturnToManageMyBooking + '</a></div>');
}

// table with  return links to Manage my booking
function mmb_returnBarSingle (summary_eId, booking){
	summary_url = 'javascript:newloc(&quot;managebooking&quot;,&quot;https&quot;,&quot;?eId=' +summary_eId+ '&amp;BookingSessionStamp=' +booking+ '&quot;)';
	document.write('<table width="430" cellpadding="0" cellspacing="0" border="0">');
	document.write('<tr><td width="12"><a href="' + summary_url + '"><img src="/cms/global/images/icons/icon_blue_revarrow.gif" border="0" width="12" height="13" alt="<" /></a></td><td class="nltablecontentprimarynobg"><a class="alttextnounderline" href="' + summary_url + '">' + mmbReturnToManageMyBooking + '</a></td></tr>');
	document.write('</table>');
}

//NASD 38.2 Offshore
// table with  return links to Manage my booking
function mmb_returnBarSingleWithTabIndex (summary_eId, booking, tabIndex){
	summary_url = 'javascript:newloc(&quot;managebooking&quot;,&quot;https&quot;,&quot;?eId=' +summary_eId+ '&amp;BookingSessionStamp=' +booking+ '&quot;)';
	document.write('<table width="430" cellpadding="0" cellspacing="0" border="0">');
	document.write('<tr><td width="12" ><a href="' + summary_url + '"><img src="/cms/global/images/icons/icon_blue_revarrow.gif" border="0" width="12" height="13" alt="<" /></a></td><td class="nltablecontentprimarynobg" ><a class="alttextnounderline" tabindex="'+tabIndex+'"href="' + summary_url + '">' + mmbReturnToManageMyBooking + '</a></td></tr>');
	document.write('</table>');
}
//NASD 38.2 Offshore

// table with  return links to Manage my booking
function mmb_returnBarSingleExtra (eId, text, booking){
	url = 'javascript:newloc(&quot;managebooking&quot;,&quot;https&quot;,&quot;?eId=' +eId+ '&amp;BookingSessionStamp=' +booking+ '&quot;)';
	document.write('<table width="430" cellpadding="0" cellspacing="0" border="0">');
	document.write('<tr><td width="12"><a href="' + url + '"><img src="/cms/global/images/icons/icon_blue_revarrow.gif" border="0" width="12" height="13" alt="<" /></a></td><td class="nltablecontentprimarynobg"><a class="alttextnounderline" href="' + url + '">' + text + '</a></td></tr>');
	document.write('</table>');
}

// table with  return links to updatebooking booking
function mmb_returnBarToUpdateBooking(eId, text, booking){
	url = 'javascript:newloc(&quot;updatebooking&quot;,&quot;https&quot;,&quot;?eId=' +eId+ '&amp;BookingSessionStamp=' +booking+ '&quot;)';
	document.write('<table width="430" cellpadding="0" cellspacing="0" border="0">');
	document.write('<tr><td width="12"><a href="' + url + '"><img src="/cms/global/images/icons/icon_blue_revarrow.gif" border="0" width="12" height="13" alt="<" /></a></td><td class="nltablecontentprimarynobg"><a class="alttextnounderline" href="' + url + '">' + text + '</a></td></tr>');
	document.write('</table>');
}

//****************************************************************************************
// Right Hand Side functions
//****************************************************************************************

// RHS header - font smaller than for FS
function mmb_RHSFormHeader(Text){
	document.write('<table width="150" cellspacing="0" cellpadding="0" border="0">');
	document.write('<tr><td width="10"><img src="/cms/global/images/icons/formTopLeft.gif" width="10" height="5" border="0" alt="" /></td><td class="nlbg1"><img src="/cms/s.gif" width="130" height="5" border="0" alt="" /></td><td width="10"><img src="/cms/global/images/icons/formTopRight.gif" width="10" height="5" border="0" alt="" /></td></tr>');
	document.write('<tr><td class="nlbg1"><img src="/cms/s.gif" width="1" height="1" border="0" alt="" /></td><td class="nlbg1"><span class="headertextbold">' + Text + '</span></td><td class="nlbg1"><img src="/cms/s.gif" width="1" height="1" border="0" alt="" /></td></tr>');
	ba_SpacerRow("3","5","nlbg1");
	document.write('</table>');
}

function mmb_RHSContentStart (){
	document.write('<table width="150" cellspacing="0" cellpadding="0" border="0" class="nltable">');
    document.write('<tr><td colspan="2"><img src="/cms/s.gif" width="1" height="5" border="0" alt="" /></td></tr>');
}

function mmb_RHSContentEnd() {
   document.write('<tr><td colspan="2"><img src="/cms/s.gif" width="1" height="5" border="0" alt="" /></td></tr>');
   document.write('</table>');
}

//simple link
function mmb_RHSContentRow (Text, Link){
    document.write('<tr><td valign="top"><a href="' + Link + '"><img src="/cms/global/images/icons/icon_blue_triangle.gif" width="8" height="8" border="0" hspace="5" vspace="5" alt="&gt;" /></a></td><td><a href="' + Link + '"  class="rhscontentlinks">' + Text + '</a></td></tr>');
}

//simple greyed out link
function mmb_RHSContentRowGreyed (Text, Link){
    document.write('<tr><td valign="top" class="nltablecontentaltprimarystrongbgnone" align="center">x</td><td><a href="' + Link + '"  class="rhscontentlinks">' + Text + '</a></td></tr>');
}

//link opens in pop up
function mmb_RHSContentRowPop (Text, Link){
    document.write('<tr><td valign="top"><a href="javascript:openNewWindow(\'' + Link + '\');"><img src="/cms/global/images/icons/icon_blue_triangle.gif" width="8" height="8" border="0" hspace="5" vspace="5" alt="&gt;" /></a></td><td><a href="javascript:openNewWindow(\'' + Link + '\');"  class="rhscontentlinks">' + Text + '</a></td></tr>');
}

//link opens in srolling pop up
function mmb_RHSContentRowPopScrolling (Text, Link, width, height){
    document.write('<tr><td valign="top"><a href="javascript:popUpScrolling(\'' + Link + '\','+ width +','+ height + ');"><img src="/cms/global/images/icons/icon_blue_triangle.gif" width="8" height="8" border="0" hspace="5" vspace="5" alt="&gt;" /></a></td><td><a href="javascript:popUpScrolling(\'' + Link + '\','+ width +','+ height + ');"  class="rhscontentlinks">' + Text + '</a></td></tr>');
}

//Open Detailed Itinerary in a new window, with no address bar
function mmb_PrintPopup(LINK){
	window.open(LINK,"PRINTITIN","toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=470,height=500");
}

//Print link opens in pop up
function mmb_RHSContentRowPrintPop (Text, Link){
    document.write('<tr><td valign="top"><a href="javascript:mmb_PrintPopup(\'' + Link + '\');"><img src="/cms/global/images/icons/icon_blue_triangle.gif" width="8" height="8" border="0" hspace="5" vspace="5" alt="&gt;" /></a></td><td><a href="javascript:mmb_PrintPopup(\'' + Link + '\');"  class="rhscontentlinks">' + Text + '</a></td></tr>');
}

function mmb_RHSStrongFormHeader(Text){
	document.write('<table width="150" cellspacing="0" cellpadding="0" border="0">');
	document.write('<tr><td width="10"><img src="/cms/global/images/icons/formStrongTopLeft.gif" width="10" height="5" border="0" alt="" /></td><td class="nlbg4"><img src="/cms/s.gif" width="130" height="5" border="0" alt="" /></td><td width="10"><img src="/cms/global/images/icons/formStrongTopRight.gif" width="10" height="5" border="0" alt="" /></td></tr>');
	document.write('<tr><td class="nlstrongtabletitle"><img src="/cms/s.gif" width="1" height="1" border="0" alt="" /></td><td class="nlbg4"><span class="headertextbold">' + Text + '</span></td><td class="nlbg4"><img src="/cms/s.gif" width="1" height="1" border="0" alt="" /></td></tr>');
	ba_SpacerRow("3","5","nlstrongtabletitle");
	document.write('</table>');
}

function mmb_RHSStrongContentStart (){
	document.write('<table width="150" cellspacing="0" cellpadding="0" border="0" class="nltablebg4">');
    document.write('<tr><td colspan="2"><img src="/cms/s.gif" width="1" height="5" border="0" alt="" /></td></tr>');
}

function mmb_RHSStrongContentRow (Text, Link){
    document.write('<tr><td valign="top"><a href="' + Link + '"><img src="/cms/global/images/icons/icon_black_triangle.gif" width="8" height="8" border="0" hspace="5" vspace="5" alt="&gt;" /></a></td><td><a href="' + Link + '"  class="rhscontentlinks"><span class="nlnonselectedsteptxt">' + Text + '</span></a></td></tr>');
}

//MMB2 added for summ itin page
function mmb_RHSContentRowExtraLink (Text, Link){
    document.write('<tr><td valign="top"></td><td><a href="' + Link + '" >' + Text + '</a></td></tr>');
}

//*******************************************************************************
// Right Hand Side summary
//*******************************************************************************
function mmb_RHSSummaryStart (){
	document.write('<table width="150" cellspacing="0" cellpadding="2" border="0" class="nltable">');
}
function mmb_RHSSummaryRow (Text){
    document.write('<tr><td colspan="2" class="nlbg3">' + Text + '</td></tr>');
}
function mmb_RHSSummaryLabelledRow (Label,Text){
    document.write('<tr><td width="30" class="nlbg3" valign="top"><b>',Label,'</b></td>');
	document.write('<td class="nlbg3">' + Text + '</td></tr>');
}
function mmb_RHSSummaryHead (Text){
	document.write('<tr><td colspan="2" class="nlbg1"><span class="headertextbold">' + Text + '</span></td></tr>');
}
function mmb_RHSSummaryEnd (){
	document.write('</table>');
}

//*******************************************************************************
// Formatting
//*******************************************************************************
//Capitalise a String - allow for acronyms for BA and GB Airways
function mmb_capitalise(oldString) {
	var newString = "";
	oldString = oldString.toLowerCase();
	oldString = oldString.split(' ');
	for (var c=0; c<oldString.length; c++) {
	if(oldString[c] != 'ba' && oldString[c] != 'gb'){
		newString += oldString[c].substring(0,1).toUpperCase() + oldString[c].substring(1) + ' ';
	}
	else{
		newString += oldString[c].toUpperCase() + ' ';
	}
	}
	return newString;
}

// format the booking record date correctly for the detailed itinerary
// input format:  2003-11-15T16:50:00-00:00
// output format: Wed 12 November 2003 10:40
function mmb_formatBookingRecordDate(xmlDate) {
	alert("inside function");
	if (xmlDate == '') return '';
	dateObj = new displayDate(xmlDate);
	return dateObj.getShortDay + ' ' + dateObj.getDayNum + ' ' + dateObj.getLongMonth + ' ' + dateObj.getYear + ' ' + mmb_getTime(dateObj);
}

// format the booking record date correctly for the booking list
// input format:  2003-11-15T16:50:00-00:00 2003-08-18+00:00
// output format: Wed 12 Nov 2003
function mmb_formatShortBookingListDate	(xmlDate) {
	if (xmlDate == '') return '';
	dateObj = new displayDate(xmlDate);
	return dateObj.getShortDay + ' ' + dateObj.getDayNum + ' ' + dateObj.getShortMonth + ' ' + dateObj.getYear;
}

// gets the time in the format hh:mm from a date object
function mmb_getTime(dateObj) {
    var hours = dateObj.getHours;
	var minutes = dateObj.getMinutes;
	var time = ""
	if (hours<10)
		time = "0" + hours + ":";
	else
		time = hours + ":";
	if (minutes<10)
		time = time + "0" + minutes;
	else
		time = time + minutes;
	return time;
}

///////////////////////////////////////////////////////////////////////////////////
// THE FOLLOWING SHOULD PROBABLY GOING INTO A MORE GENERIC JS FILE RATHER THAN MMB
///////////////////////////////////////////////////////////////////////////////////

// Decode baggage allowance codes
function mmb_decodeBaggage(baggageAllowance)
{
	var allowance;
	var baggageAllowanceString = "";
	if (baggageAllowance.search("PC$") >=0)
	{
		allowance = baggageAllowance.substring(0, baggageAllowance.search("PC$"))
		if (allowance == "1")
			baggageAllowanceString = allowance + ' ' + mmbRefTextPiece;
		else
			baggageAllowanceString = allowance + ' ' + mmbRefTextPieces;
	}
	else if (baggageAllowance.search("KG$") >=0)
	{
		allowance = baggageAllowance.substring(0, baggageAllowance.search("KG$"))
		baggageAllowanceString = allowance + ' ' + mmbRefTextKg;
	}
	else if (baggageAllowance.search("K$") >=0)
	{
		allowance = baggageAllowance.substring(0, baggageAllowance.search("K$"))
		baggageAllowanceString = allowance + ' ' + mmbRefTextKg;
	}
	else if (baggageAllowance!="")
	{
		baggageAllowanceString = baggageAllowance;
	}
	return baggageAllowanceString;
}

// convert xml format date to javascript object
// takes in date formats:
// 2003-08-06T10:21:01-00:00
// 2003-08-06+00:00
// 2003-08-06 by default
function displayDate(xmlDate)
{
	var yy=xmlDate.substr(0,4);
	var mm=xmlDate.substr(5,2) - 1;
	var dd=xmlDate.substr(8,2);

	if (xmlDate.charAt(10)== 'T'){
		var hh=xmlDate.substr(11,2);
		var mi=xmlDate.substr(14,2);
		var dummyDate = new Date(yy, mm, dd, hh, mi);
	}
	else {
		var dummyDate = new Date(yy, mm, dd);
	}

	var monthsLong = mmbRefMonthListLong;
	monthsLong = monthsLong.split(':');
	var monthsShort = mmbRefMonthListShort;
	monthsShort = monthsShort.split(':');
	var weekdaysLong = mmbRefDayListLong;
	weekdaysLong = weekdaysLong.split(':');
	var weekdaysShort = mmbRefDayListShort;
	weekdaysShort = weekdaysShort.split(':');

	this.getDayNum = dummyDate.getDate();
	this.getLongDayNum = (this.getDayNum<10) ? "0" + this.getDayNum : this.getDayNum;

	this.getLongMonth = monthsLong[dummyDate.getMonth()];
	this.getShortMonth = monthsShort[dummyDate.getMonth()];

	this.getLongDay = weekdaysLong[dummyDate.getDay()];
	this.getShortDay = weekdaysShort[dummyDate.getDay()];

	this.getYear = dummyDate.getFullYear();

	this.getHours = dummyDate.getHours();
	this.getMinutes = dummyDate.getMinutes();

	this.getFullDate = this.getLongDay + ", " + this.getDayNum + " " + this.getLongMonth + " " + this.getYear;
	this.getShortFullDate = this.getShortDay + ", " + this.getDayNum + " " + this.getShortMonth + " " + this.getYear;
}

// Trim leading and trailing spaces of a string
function trim(string) {
    return string.replace(/^\s+/,'').replace(/\s+$/,'');
}

// Validate that the email address is in an acceptable format
function validateEmailAddress(addr)
{
	// Leading and trailing spaces are ignored.
	emailAddress = trim(addr);

    var atIndex = emailAddress.indexOf("@");

    //first dot after '@' symbol
    var firstDotIndex = emailAddress.indexOf(".", atIndex);

    // The email emailAddress does not exceed maximum size, (150).
    // and is not below the minimum size, (6).
    // Apart from alphanumerics, the following are allowed "@.-_"
    if (!isValidAlphaNum(emailAddress, "@.-_", 6, 150))
       return false;

    // The email emailAddress does not end with full stop.
    if (emailAddress.search("[.]$")>=0)
        return false;

    // The email emailAddress does not end with '-'.
    if (emailAddress.search("[-]$")>=0)
        return false;

    // The email emailAddress does not end with '_'.
    if (emailAddress.search("[_]$")>=0)
        return false;

    // There are no consecutive full stops.
    if (emailAddress.indexOf("..") > -1)
        return false;

    // There are no spaces within the emailAddress.
    if (emailAddress.indexOf(" ") > -1)
        return false;

    // The 1st character is not an '@' symbol.
    // and more than one '@' is invalid.
    var pos = emailAddress.indexOf("@");
    if ((pos <= 0) || emailAddress.lastIndexOf("@") > pos)
        return false;

    // '.' do not immediately follow the '@' symbol.
    if ((firstDotIndex == -1) || (firstDotIndex == emailAddress.length - 1) || (firstDotIndex - atIndex == 1) || (emailAddress.lastIndexOf(".") == emailAddress.length - 1))
        return false;

    // '-' do not immediately follow the '@' symbol.
    var hypenIndex = emailAddress.indexOf("-");
    if ( (hypenIndex - atIndex == 1) )
    	return false;

	 // '_' do not immediately follow the '@' symbol.
    var underscoreIndex = emailAddress.indexOf("_");
    if ( (underscoreIndex - atIndex == 1) )
    	return false;

    return true;
}

// The isValidAlphaNum method will check for valid alphanumeric characters,
// any special characters that are passed in, minimum and maximum values.
//
// chkField 	-	The value that needs to be verified.
// specialChars	-	Any special characters that are valid,
// minLength	-	The minimum length this value can be.
// maxLength	-	The maximum length this value can be.  Zero indicates no boundry.
function isValidAlphaNum(chkField, specialChars, minLength, maxLength)
{
    var result = new Boolean(true);
    var specChar = new Boolean(false);
	var lettersAndNumbers = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
    if (chkField == null)
        return false;
    checkField = trim(chkField);
    var fieldSize = checkField.length;

    if ( (minLength > 0) && (fieldSize < minLength) )
        result = Boolean(false);
    else if ( (maxLength != 0) && (fieldSize > maxLength))
        result = Boolean(false);
    else
    {
      for (i=0; i < fieldSize; i++)
      {
        if(lettersAndNumbers.indexOf(checkField.charAt(i))<0 )
        {
            if ( specialChars != null )
            {
                specChar = Boolean(false);
                for (j=0; j < specialChars.length; j++ )
                {
                    if ( checkField.charAt(i) == specialChars.charAt(j))
                    {
                        specChar = Boolean(true);
                        break;
                    }
                }
                if ( !specChar )
                {
                    result = Boolean(false);
                    break;
                }
            }
            else
            {
                result = Boolean(false);
                break;
            }
        }
      }
    }
  return result;
}


// The isValidNumeric method will check for valid numeric characters,
// any special characters that are passed in, minimum and maximum values.
//
// chkField 	-	The value that needs to be verified.
// specialChars	-	Any special characters that are valid,
// minLength	-	The minimum length this value can be.
// maxLength	-	The maximum length this value can be.  Zero indicates no boundry.
function isValidNumeric(chkField, specialChars, minLength, maxLength)
{
    var result = new Boolean(true);
    var specChar = new Boolean(false);
	var numbers = "0123456789";
    if (chkField == null)
        return false;
    checkField = trim(chkField);
    var fieldSize = checkField.length;

    if ( (minLength > 0) && (fieldSize < minLength) )
        result = Boolean(false);
    else if ( (maxLength != 0) && (fieldSize > maxLength))
        result = Boolean(false);
    else
    {
      for (i=0; i < fieldSize; i++)
      {
        if(numbers.indexOf(checkField.charAt(i))<0 )
        {
            if ( specialChars != null )
            {
                specChar = Boolean(false);
                for (j=0; j < specialChars.length; j++ )
                {
                    if ( checkField.charAt(i) == specialChars.charAt(j))
                    {
                        specChar = Boolean(true);
                        break;
                    }
                }
                if ( !specChar )
                {
                    result = Boolean(false);
                    break;
                }
            }
            else
            {
                result = Boolean(false);
                break;
            }
        }
      }
    }
  return result;
}

// Sets the title on the browser
function ba_SetPagetitle(pageTitleText) {
	document.title = "British Airways - " + pageTitleText;
}

// Sets the header title of the page
function ba_SetHeadertitle(headerTitleText) {
	headertitleObject = getPageObject("headertitle");
	if (headertitleObject.innerHTML) { headertitleObject.innerHTML=headerTitleText }
}

// Detects whether the return key has been hit.  If it has, submit the form.
function detectKey() {
	if (window.event)
	        if (event.keyCode==13) { thisSubmitAndCheckForm(); }
}

//Changes the submit button text to 'processing', disables it and submits the form.
function mmbSubmitForm(aForm,processingTextIn) {

        var processingText = "";

        // Check if any text value passed for "Processing" - used for translations
        if (processingTextIn == null) {
                processingText = "<P>&nbsp;&nbsp;Processing&nbsp;&nbsp;</p>";
        } else {
                processingText = "<P>&nbsp;&nbsp;" + processingTextIn + "&nbsp;&nbsp;</p>";
        }

	if (document.all) {
		document.all['submitLayer'].innerHTML = processingText;
	} else if (document.layers) {
		document.layers['submitLayer'].document.open();
		document.layers['submitLayer'].document.write(processingText);
		document.layers['submitLayer'].document.close();
 	}
 	aForm.submit();
}

// Display ticket timeout message
function mmb_ExpiryTime(hours, minutes) {

	var expiryTime = mmbExpiryMsg + ' ';

	if(hours >= 72)	// display as days
	{
		expiryTime = expiryTime + Math.round(hours / 24) + ' ' + mmbDays;
	}
	else if(hours >= 1) // display as hours and minutes
	{
		expiryTime = expiryTime + hours;
		if (hours == 1)
			expiryTime = expiryTime + ' ' + mmbHour;
		else
			expiryTime = expiryTime + ' ' + mmbHours;
		if (minutes > 0) {
			expiryTime = expiryTime + ' ' + minutes;
			if (minutes == 1)
				expiryTime = expiryTime + ' ' + mmbMinute;
			else
				expiryTime = expiryTime + ' ' + mmbMinutes;
		}
	}
	else	// display as minutes only
	{
		if (minutes == 1)
			expiryTime = expiryTime + minutes + ' ' + mmbMinute;
		else
			expiryTime = expiryTime + minutes + ' ' +  mmbMinutes;
	}

	document.write(expiryTime+'. ');

}

// MMB2 22APR u758932
// Function to provide error checking for simple and complex authenticate
function mmbLoginCheck(pageToCheck, genErrorId) {

	var oForm;
	var errorCount=-1;
	var errorHeading=mmbCannotProcessUntilFixedErrors+':';
	var aErrorList=new Array();
	var form_ok=true;
	var oGenErr;

	switch (pageToCheck) {
		case 'SIMPLEAUTH':
			oForm=document.simpleform;
			break;
		case 'COMPLEXAUTH':
			oForm=document.complexform;
			break;
		default: return false;
	}

	var sBRef=oForm.bookingRef.value;
	var sLName=oForm.lastname.value;

	oGenErr=getPageObject(genErrorId);

	// validate the booking reference
	if (!isValidAlphaNum(sBRef,'', 6, 6)){
		errorCount = errorCount +1;
		form_ok=false;
		aErrorList[errorCount]='bookingRef';
	}

	// remove alpha numeric validation from last name so that user can input foreign characters
	// validate the last name
	//if (!isValidAlphaNum(sLName,'- ', 1, 0)){
	if (sLName.length<1){
		errorCount = errorCount +1;
		form_ok=false;
		aErrorList[errorCount]='lastname';
	}

	//check these only for complex
	if (pageToCheck=="COMPLEXAUTH") {
		var sFName=oForm.firstname.value;
		var sDeptCity=oForm.departureCity.value;
		var sDay=oForm.Day.selectedIndex;
		var sMonth=oForm.Month.selectedIndex;
		var sFlightNo=oForm.flightNumber.value;

		if (sFName.length<1){
			errorCount = errorCount +1;
			form_ok=false;
			aErrorList[errorCount]='firstname';
		}
		if (sDeptCity.length<1){
			errorCount = errorCount +1;
			form_ok=false;
			aErrorList[errorCount]='departureCity';
		}
		if (sDay==0){
			errorCount = errorCount +1;
			form_ok=false;
			aErrorList[errorCount]='Day';
		}
		if (sMonth==0){
			errorCount = errorCount +1;
			form_ok=false;
			aErrorList[errorCount]='Month';
		}
		if (sFlightNo.length<1){
			errorCount = errorCount +1;
			form_ok=false;
			aErrorList[errorCount]='flightNumber';
		}

	}

	if (!form_ok) {
		if (!document.layers) {  // Do not action for NS4
			if(sBRef=="" && sLName=="") {
				errorHeading=mmbFollowingFieldsMissing+':';
			}
		}

		// Fix for JS error if function does not exist. These may well be redundant...
		//resetAllAddressLabelColor();
		//resetAllLabelColor();
		//resetSharedLabelColor();

		content='<table cellspacing="0" cellpadding="0"><tr><td><img src="/cms/s.gif" width="1" height="3" border="0" alt="" /></td></tr><tr><td class="maintextintroerror">'+errorHeading+'</td></tr>';
		//oGenErr.style.display='none';

		for (i=0;i<aErrorList.length;i++) {
			currentLabel = fsLabelLookup[aErrorList[i]];
			previousLabel = (i!=0) ? fsLabelLookup[aErrorList[i-1]] : null;
			changeLblColor(currentLabel,'Red');
			divObject = getPageObject(currentLabel);
			if (!hasSecondaryTitle(aErrorList[i],divObject)) {
				if (divObject && (currentLabel != previousLabel)) {
					if(aErrorList[i]=='lastname') {
						content+='<tr><td><img src="/cms/s.gif" width="1" height="3" border="0" alt="" /></td></tr><tr><td class="maintextintroerror">- '+mmbPaxLastName+' '+mmbNameSpelling+'</td></tr>';
					}
					if(aErrorList[i]=='bookingRef') {
						content+='<tr><td><img src="/cms/s.gif" width="1" height="3" border="0" alt="" /></td></tr><tr><td class="maintextintroerror">- '+mmbBookingRefMustContain;
						content+=" <a href=\"javascript:popUpScrolling(\'/travel/ba6.jsp/FINDBOOKING\',475,575);\">"+mmbWhatIsThis+"</script></a></td></tr>";
					}
					if(aErrorList[i]=='firstname') {
						content+='<tr><td><img src="/cms/s.gif" width="1" height="3" border="0" alt="" /></td></tr><tr><td class="maintextintroerror">- '+mmbFirstName+' </td></tr>';
					}
					if(aErrorList[i]=='departureCity') {

						content+='<tr><td><img src="/cms/s.gif" width="1" height="3" border="0" alt="" /></td></tr><tr><td class="maintextintroerror">- '+mmbLeavingFrom+' </td></tr>';
					}
					if(aErrorList[i]=='Day') {

						content+='<tr><td><img src="/cms/s.gif" width="1" height="3" border="0" alt="" /></td></tr><tr><td class="maintextintroerror">- '+mmbDepartingOn+' </td></tr>';
					}
					if(aErrorList[i]=='Month') {

						content+='<tr><td><img src="/cms/s.gif" width="1" height="3" border="0" alt="" /></td></tr><tr><td class="maintextintroerror">- '+mmbDepartingOn+' </td></tr>';
					}
					if(aErrorList[i]=='flightNumber') {

						content+='<tr><td><img src="/cms/s.gif" width="1" height="3" border="0" alt="" /></td></tr><tr><td class="maintextintroerror">- '+mmbFlightNumber+' </td></tr>';
					}
				}
			}
		}
		content+='</table>';
		changeLayerContent(genErrorId,content);
		//oGenErr.style.display='block';
		return false;
	} else {
		return true;
	}
}

function dayOptions(id,selected)
{
	var el=document.getElementById(id);
	el.remove(0); // Remove the one initial option needed for XHTML
	for (var i = 1; i < 32; i++)
	{
		var opt = document.createElement("option");
		opt.setAttribute("value", i);
		if (i == selected) opt.setAttribute ("selected", "selected");
		opt.appendChild(document.createTextNode(i));
		el.appendChild (opt);
	}
}

function monthOptions(id,selected)
{
	var months = ["January","February","March","April","May","June","July","August","September","October","November","December"];
	var el=document.getElementById(id);
	el.remove(0); // Remove the one initial option needed for XHTML
	for (var i = 0; i < 12; i++)
	{
		var opt = document.createElement("option");
		opt.setAttribute("value", months[i]);
		if (months[i] == selected) opt.setAttribute ("selected", "selected");
		opt.appendChild(document.createTextNode(months[i]));
		el.appendChild (opt);
	}
}


//
//--------------------------------------------------------------------------------------------------------
//
function delimitedString(mainArray,delim)
{
	var cdArray = new Array();
	var nmArray = new Array();

	for (i=0; i<mainArray.length;)
	{
		cdArray[cdArray.length] = mainArray[i++];
		nmArray[nmArray.length] = mainArray[i++];
	}

	this.codeString = cdArray.join(delim);
	this.nameString = nmArray.join(delim);
}

//
//--------------------------------------------------------------------------------------------------------
//
function setDropdown(selectedArray,selectedParam,plsSel,id)
{
	var optObj = new delimitedString(selectedArray,":");
	setDropdownOptions(optObj.codeString,optObj.nameString,selectedParam,plsSel,id);
}

//
//--------------------------------------------------------------------------------------------------------
//
function setDropdownOptions(cdString,nmString,selectedParam,plsSel,id)
{
	var cdArray = cdString.split(":");
	var nmArray = nmString.split(":");

	if (typeof id == 'undefined' || id == '' || id == null)
	{
		return;
	}

	if (typeof selectedParam == 'undefined' || selectedParam == '' || selectedParam == null)
	{
		selectedParam = "";
	}

	var el=document.getElementById(id);
	el.remove(0);

	if (typeof plsSel != 'boolean' || plsSel)
	{
		var opt0 = document.createElement("OPTION");
		el.appendChild(opt0);
		opt0.text = plsSel;
		opt0.value = plsSel;
		opt0.value = "";
	}

	for(var i=0; i < cdArray.length; i++)
	{
		var opt = document.createElement("OPTION");
		el.appendChild(opt);
		opt.value = cdArray[i];
		opt.text = nmArray[i];

		if(cdArray[i].toLowerCase() == selectedParam.toLowerCase())
		{
			opt.selected = true;
		}
	}
}

//
//--------------------------------------------------------------------------------------------------------
//


function mmb_formatBookingRecordDate(xmlDate) {
//alert(xmlDate);
	if (xmlDate == '') return '';
	dateObj = new displayDate(xmlDate);
	return dateObj.getShortDay + ' ' + dateObj.getDayNum + ' ' + dateObj.getLongMonth + ' ' + dateObj.getYear + ' ' + mmb_getTime(dateObj);
}

function mmb_formatShortBookingListDate	(xmlDate) {
	if (xmlDate == '') return '';
	dateObj = new displayDate(xmlDate);
	return dateObj.getShortDay + ' ' + dateObj.getDayNum + ' ' + dateObj.getShortMonth + ' ' + dateObj.getYear;
}

function mmb_getTime(dateObj) {
    var hours = dateObj.getHours;
	var minutes = dateObj.getMinutes;
	var time = ""
	if (hours < 10)
		time = "0" + hours + ":";
	else
		time = hours + ":";
	if (minutes < 10)
		time = time + "0" + minutes;
	else
		time = time + minutes;
	return time;
}


function displayDate(xmlDate)
{
	var yy=xmlDate.substr(0,4);
	var mm=xmlDate.substr(5,2) - 1;
	var dd=xmlDate.substr(8,2);

	if (xmlDate.charAt(10)== 'T'){
		var hh=xmlDate.substr(11,2);
		var mi=xmlDate.substr(14,2);
		var dummyDate = new Date(yy, mm, dd, hh, mi);
	}
	else {
		var dummyDate = new Date(yy, mm, dd);
	}

	var monthsLong = mmbRefMonthListLong;
	monthsLong = monthsLong.split(':');
	var monthsShort = mmbRefMonthListShort;
	monthsShort = monthsShort.split(':');
	var weekdaysLong = mmbRefDayListLong;
	weekdaysLong = weekdaysLong.split(':');
	var weekdaysShort = mmbRefDayListShort;
	weekdaysShort = weekdaysShort.split(':');

	this.getDayNum = dummyDate.getDate();
	this.getLongDayNum = (this.getDayNum < 10) ? "0" + this.getDayNum : this.getDayNum;

	this.getLongMonth = monthsLong[dummyDate.getMonth()];
	this.getShortMonth = monthsShort[dummyDate.getMonth()];

	this.getLongDay = weekdaysLong[dummyDate.getDay()];
	this.getShortDay = weekdaysShort[dummyDate.getDay()];

	this.getYear = dummyDate.getFullYear();

	this.getHours = dummyDate.getHours();
	this.getMinutes = dummyDate.getMinutes();

	this.getFullDate = this.getLongDay + ", " + this.getDayNum + " " + this.getLongMonth + " " + this.getYear;
	this.getShortFullDate = this.getShortDay + ", " + this.getDayNum + " " + this.getShortMonth + " " + this.getYear;
}
//
//---------------------------------------------------------------------------------------------------------------------------------------
//
function setTitle(size1){
					for(i=1;i<=size1;i++){
						var goImg=document.getElementById("goButton"+i);
						goImg.title=xLate2(mmbColManageBooking);
						
					}	
				}


function xLate2 (refCode){
return refCode;
}

//05-may-06end of insert 
		



