var SOURCE_URL = "/cms/global/json/novsale2009/woffersdataallcabins.json";
var SOURCE_TYPE = "json";
var DOCUMENT_ELEMENT_ID = "tableDiv"
var ONEWAY_PRICE_POSTPIN_DISCOUNT = 0;
var RETURN_PRICE_POSTPIN_DISCOUNT = 0;
var HOTEL_PRICE_POSTPIN_DISCOUNT = 0;
var ONEWAY_PRICE_TYPE = "ow";
var RETURN_PRICE_TYPE = "rt";
var TABLE_HEADERS = [["Destination", "1", "Click to change sort order.", "", "HYBRID"],
["Flight only from", "1", "", "", "HYBRID"],
["Packages per person<br/><div class='needHelp'>Need help with your booking? Call 0844&nbsp;493&nbsp;0760</div>","1","","", "HYBRID"],
["Destination", "1", "Click to change sort order.", "", "FLIGHTS"],
["Flight only from", "1", "", "", "FLIGHTS"],
["Travel dates <span><br />Click <img src=\"/cms/global/assets/images/promotion/uk/may_campaign_2009/twisty-closed.gif\" width=\"9\" height=\"9\" alt=\"Plus sign.\" /> to see more</span>","1","","", "FLIGHTS"],
["Plan or book your trip", "1", "", "", "FLIGHTS"]
];
var LOCATIONS = [["ABZ", "Aberdeen", "ABZ", "Aberdeen", "EUR"],
["BRS", "Bristol", "", "", "EUR"],
["ORK", "Cork", "", "", "EUR"],
["DUB", "Dublin", "", "", "EUR"],
["EMA", "East Midlands", "", "", "EUR"],
["EDI", "Edinburgh", "", "", "EUR"],
["GLA", "Glasgow", "", "", "EUR"],
["INV", "Inverness", "", "", "EUR"],
["IOM", "Isle of Man", "", "", "EUR"],
["JER", "Jersey", "", "", "EUR"],
["LON", "London (All)", "LON", "London", "EUR"],
["LCY", "London City", "LON", "London", "EUR"],
["LGW", "London Gatwick", "LON", "London", "EUR"],
["LHR", "London Heathrow", "LON", "London", "EUR"],
["MAN", "Manchester", "", "", "EUR"],
["NCL", "Newcastle", "", "", "EUR"],
["NAM", "North America", "", "North America", "NAM"],
["AFR", "Africa", "", "Africa", "AFR"],
["SASIA", "South Asia", "", "South Asia", "SASIA"],
["FEA", "Asia and Far East", "", "Asia and Far East", "FEA"],
["LAC", "Latin America and Caribbean", "", "Latin America and Caribbean", "LAC"],
["ME", "Middle East", "", "Middle East", "ME"],
["NAF", "North Africa", "", "North Africa", "NAF"],
["NQY", "Newquay", "", "Newquay", "NQY"],
["SNN", "Shannon", "", "", "EUR"],
["EUR", "Europe", "", "Europe", "EUR"],
["UKI", "UK and Ireland", "", "UK and Ireland", "UKI"]
];
var PRICE_BANDS = [["PRICEBAND1", "0", "50"],
["PRICEBAND2", "51", "150"],
["PRICEBAND3", "151", "300"],
["PRICEBAND4", "301", "450"],
["PRICEBAND5", "451", "9999999"]];
var VALID_DEPARTURES = ["ABZ",
"EDI",
"GLA",
"JER",
"LON",
"LCY",
"LHR",
"LGW",
"MAN",
"NCL"];
var VALID_REGIONS = ["NAM",
"SASIA",
"EUR",
"FEA",
"LAC",
"ME",
"NAF",
"AFR",
"UKI"];
var VALID_TYPES = ["BEACH",
"EUROPE",
"CITY"];
var VALID_PRICEBANDS = ["PRICEBAND1",
"PRICEBAND2",
"PRICEBAND3",
"PRICEBAND4",
"PRICEBAND5"];
var VALID_CABINS = ["M",
"W",
"J",
"F"];
var ALERT_DESTINATIONS = ["XXX"];
var TECHNICAL_DIFFICULTIES = false;
var TECHNICAL_DIFFICULTIES_MESSAGE = "Sorry, we are experiencing technical difficulties at the moment, please try again later.";
var gWoffersData = new WoffersData(SOURCE_URL, SOURCE_TYPE);
var gWofferTable = null;
var gPageType = "";
var gNavType = "";
var gFromCode = "";
var gToCode = "";
var gLinkType = "";
var navObj = "";
var gPlanTripInitialised = false;
var gTravelClass = "";
var gTravelClassName = "";
var gFlightFound = false;
var gPackageFound = false;
$(pageSetup);
function setPageParameters() {
gPageType = "HYBRID";
gNavType = "REGIONS";
gFromCode = "LON";
gToCode = "NAM";
gLinkType = "FXPAGE";
gTravelClass = "M";
gPageType = getQueryValue("pagetype").toUpperCase();
gLinkType = getQueryValue("linktype").toUpperCase();
if(gPageType == "NOT FOUND") {
gPageType = getCookie("BA_SALE_PAGE_TYPE");
}
switch(gPageType) {
case "0": {
gPageType = "HYBRID";
break;
}
case "1": {
gPageType = "HYBRID";
break;
}
default: {
gPageType = "HYBRID";
}
}
if(gLinkType == "NOT FOUND") {
gLinkType = getCookie("BA_SALE_LINK_TYPE");
}
switch(gLinkType) {
case "0": {
gLinkType = "FXPAGE";
break;
}
case "1": {
gLinkType = "LPBMPAGE";
break;
}
default: {
gLinkType = "FXPAGE";
}
}
gFromCode = getQueryValue("from").toUpperCase();
var foundLocation = false;
if(gFromCode && (gFromCode != "NOT FOUND")) {
for(var locationIndex = 0; locationIndex < VALID_DEPARTURES.length; ++locationIndex) {
if(VALID_DEPARTURES[locationIndex] == gFromCode) {
foundLocation = true;
break;
}
}
}
if(!foundLocation) {
gFromCode = "LON";
}
gToCode = getQueryValue("to").toUpperCase();
var foundRegion = false;
if(gToCode && (gToCode != "NOT FOUND")) {
for(var regionIndex = 0; regionIndex < VALID_REGIONS.length; ++regionIndex) {
if(VALID_REGIONS[regionIndex] == gToCode) {
foundRegion = true;
break;
}
}
}
if(!foundRegion) {
gToCode = "NAM";
}
gTravelClass = getQueryValue("cabin").toUpperCase();
var foundCabin = false;
if(gTravelClass && (gTravelClass != "NOT FOUND")) {
for(var cabinIndex = 0; cabinIndex < VALID_CABINS.length; ++cabinIndex) {
if(VALID_CABINS[cabinIndex] == gTravelClass) {
foundCabin = true;
break;
}
}
}
if(!foundCabin) {
gTravelClass = "M";
}
}
function pageSetup() {
try {
if ($.browser.safari) { $("#t-centre>.clearBoth").height(0); }
setNavType("REGIONS");
setTravelClass();
$("#departureSelection").keyup(function() {gWofferTable.processFromChange(this);});
$("#departureSelection").change(function() {gWofferTable.processFromChange(this);});
$(".regionNavigation a").click(function() {gWofferTable.processRegionChangeEvent(this);});
$("#travelClassPod input[name='travelClassOption']").click(function() {gWofferTable.processTravelClassEvent(this);});
gWofferTable = new WofferTable(DOCUMENT_ELEMENT_ID, gWoffersData, gFromCode, gToCode);
gWoffersData.build();
}
catch(e) {
alert(e.toString());
}
}
function setTravelClass() {
$("#travelClassPod input[value='" + gTravelClass.toUpperCase() + "']").attr({"checked":"checked"});
}
function setNavType(navType) {
var typeNavItems = $(".typeNavigation li a");
var regionNavItems = $(".regionNavigation li a");
var matchedDepartureLocations = $("select.departureSelection  option[value='" + gFromCode + "']");
if(matchedDepartureLocations) {
matchedDepartureLocations[0].selected = true;
}
$("#pageTypeSelectionDiv input[value='" + navType.toUpperCase() + "']").attr({"checked":"checked"});
navObj = $("#pageTypeSelectionDiv input[value='" + navType.toUpperCase() + "']");
switch(navType.toUpperCase()) {
case "TYPES" :{
$(".regionNavigation:visible").hide();
$(".typeNavigation").show();
$("#t-topic-content").removeClass('regions').addClass('types');
typeNavItems.removeClass("selected");
$(".typeNavigation li." + gToCode.toLowerCase() + " a").addClass("selected");
gNavType = "TYPES";
break;
}
case "REGIONS" : {
$(".typeNavigation:visible").hide();
$(".regionNavigation").show();
$("#t-topic-content").removeClass('types').addClass('regions');
regionNavItems.removeClass("selected");
$(".regionNavigation li." + gToCode.toLowerCase() + " a").addClass("selected");
gNavType = "REGIONS";
break;
}
default: {
$(".regionNavigation:visible").hide();
$(".typeNavigation").show();
gNavType = "TYPES";
$("#topBanner img").attr("src","/cms/global/assets/images/promotion/uk/may_campaign_2009/beaches_wide.gif");
$("#t-topic-content").addClass('types');
$("#tableHeadText").html("Flight offers");
imageNavItems.removeClass("selected");
$(".typeNavigation li." + gToCode.toLowerCase() + " a").addClass("selected");
break;
}
}
}
function initialisePlantrip() {
if(!gPlanTripInitialised) {
var packageType = getQueryValue("packagetype").toUpperCase();
switch(packageType) {
case "FH": {
$("#hotelPackage").click();
gPlanTripInitialised = true;
break;
}
case "FC": {
$("#carPackage").click();
gPlanTripInitialised = true;
break;
}
default: {
}
}
}
}
function WoffersData(sourceURL, sourceType) {
if(sourceType != "json") {
throw new Error("Invalid source type (" + sourceType + ") supplied to Woffers constructor.");
}
this.sourceURL = sourceURL;
this.sourceType = sourceType;
}
WoffersData.prototype.build = function() {
var instance = this;
var ajaxXmlhttp = null;
this.woffers = new Array();
if(window.XMLHttpRequest && !(window.ActiveXObject)) {
try {
ajaxXmlhttp = new XMLHttpRequest();
}
catch(e) {
ajaxXmlhttp = null;
}
}
else if(window.ActiveXObject) {
try {
ajaxXmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e) {
try {
ajaxXmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e) {
ajaxXmlhttp = null;
}
}
}
if(ajaxXmlhttp) {
ajaxXmlhttp.onreadystatechange = function() {
if(ajaxXmlhttp.readyState == '4') {
var response = ajaxXmlhttp.responseText;
response = response.replace(/\r\n/g, '');
response = eval('(' + response + ')');
instance.parseJson(response);
}
};
ajaxXmlhttp.open("GET", this.sourceURL, true);
ajaxXmlhttp.send(null);
}
}
WoffersData.prototype.parseJson = function(json) {
for(var index = 0; index < json.routes.length; ++index) {
this.woffers.push(new Woffer(json.routes[index]));
}
gWofferTable.buildOutput();
}
WoffersData.prototype.getWoffersForRegion = function(region) {
var matchingWoffers = new Array();
for(var index = 0; index < this.woffers.length; ++index) {
if(this.woffers[index].regionCode == region) {
matchingWoffers.push(this.woffers[index]);
}
}
return(matchingWoffers);
}
WoffersData.prototype.getWoffersForLocations = function(fromCode, toCode, includeNonSale) {
var matchingWoffers = new Array();
var currentWoffer = null;
var currentTravelClass = '';
for(var index = 0; index < this.woffers.length; ++index) {
currentWoffer = this.woffers[index];
if(
((fromCode == "A_W") || (currentWoffer.matchesDepartureCode(fromCode))) &&
((toCode == "A_W") || (currentWoffer.matchesDestinationCode(toCode)))
) {
currentTravelClass = currentWoffer.getOption("optional3").value;
if ((gTravelClass == 'M' || gTravelClass == 'W') && currentTravelClass != 'M') {
continue;
}
if ((gTravelClass == 'J' || gTravelClass == 'F') && currentTravelClass != 'J') {
continue;
}
if(includeNonSale == true) {
matchingWoffers.push(currentWoffer);
}
else if(currentWoffer.hasSaleFare()) {
matchingWoffers.push(currentWoffer);
}
}
}
return(matchingWoffers);
}
WoffersData.prototype.getWoffersThatMatchDepartureAndPrice = function(departureCode, fromPrice, toPrice, includeNonSale) {
var matchingWoffers = new Array();
var currentWoffer = null;
var prices = null;
var currentPrice = null;
var priceIndex = 0;
var addonPriceIndex = 0;
var addonPrices = null;
var foundPrice = false;
for(var index = 0; index < this.woffers.length; ++index) {
currentWoffer = this.woffers[index];
if((departureCode != "A_W") && (!currentWoffer.matchesDepartureCode(departureCode))) {
continue;
}
foundPrice = false;
prices = currentWoffer.prices.prices;
for(priceIndex = 0; priceIndex < prices.length; ++priceIndex) {
currentPrice = prices[priceIndex];
if(currentWoffer.originAirport == departureCode) {
if((currentPrice.price >= fromPrice) && (currentPrice.price <= toPrice)) {
foundPrice = true;
}
}
else {
addonPrices = currentPrice.addonPrices;
for(addonPriceIndex = 0; addonPriceIndex < addonPrices.length; ++addonPriceIndex) {
currentPrice = addonPrices[addonPriceIndex];
if((currentPrice.location == departureCode) && (currentPrice.price >= fromPrice) && (currentPrice.price <= toPrice)) {
foundPrice = true;
break;
}
}
}
if(foundPrice) {
if(includeNonSale == true) {
matchingWoffers.push(currentWoffer);
break;
}
else if(currentWoffer.hasSaleFare()) {
matchingWoffers.push(currentWoffer);
break;
}
}
}
}
return(matchingWoffers);
}
WoffersData.prototype.processError = function(ajaxResponse, text, exception) {
throw new Error("Encountered a problem retreiving the JSON file." +
" Reported status is: " + text + ".\n\n" +
" Exception details are: " + exception.toString());
}
function Woffer(wofferData) {
this.originAirport = "";
this.destinationAirport = "";
this.destinationName = "";
this.regionCode = "";
this.priceType = "";
this.footnote = "";
this.prices = null;
this.addons = null;
this.wofferOptions = new Array();
if(wofferData.from) {
this.originAirport = wofferData.from;
}
if(wofferData.to) {
this.destinationAirport = wofferData.to;
}
if(wofferData.to_name) {
this.destinationName = wofferData.to_name;
}
else if(wofferData.destinations) {
this.destinationName = wofferData.destinations;
}
if(wofferData.region) {
this.regionCode = wofferData.region;
}
if(wofferData.price_type) {
this.priceType = wofferData.price_type;
}
if(wofferData.footnote) {
this.footnote = wofferData.footnote;
}
if(wofferData.datesprices) {
this.prices = new Prices(wofferData.datesprices);
}
var tempOptionTitle = "";
var tempOptionValue = "";
if(wofferData.non_flight) {
tempOptionTitle = "nonFlight";
tempOptionValue = wofferData.non_flight;
this.wofferOptions.push(new WofferOption(tempOptionTitle, tempOptionValue));
}
if(wofferData.non_flight_price) {
tempOptionTitle = "nonFlightPrice";
tempOptionValue = wofferData.non_flight_price;
this.wofferOptions.push(new WofferOption(tempOptionTitle, tempOptionValue));
}
if(wofferData.optional1) {
tempOptionTitle = "optional1";
tempOptionValue = wofferData.optional1;
this.wofferOptions.push(new WofferOption(tempOptionTitle, tempOptionValue));
}
if(wofferData.optional2) {
tempOptionTitle = "optional2";
tempOptionValue = wofferData.optional2;
this.wofferOptions.push(new WofferOption(tempOptionTitle, tempOptionValue));
}
if(wofferData.optional3) {
tempOptionTitle = "optional3";
tempOptionValue = wofferData.optional3;
this.wofferOptions.push(new WofferOption(tempOptionTitle, tempOptionValue));
}
if(wofferData.optional4) {
tempOptionTitle = "optional4";
tempOptionValue = wofferData.optional4;
this.wofferOptions.push(new WofferOption(tempOptionTitle, tempOptionValue));
}
}
Woffer.prototype.getLowestPrice = function() {
var lowestPrice = null;
var currentPrice = null;
for(var index = 0; index < this.prices.prices.length; ++index) {
currentPrice = this.prices.prices[index];
if((lowestPrice == null) || (currentPrice.price < lowestPrice.price)) {
lowestPrice = currentPrice;
}
}
return(lowestPrice);
}
Woffer.prototype.matchesDepartureCode = function(fromCode) {
var matched = false;
var currentPrice = null;
if((this.originAirport == fromCode) || (fromCode == "LON" && ((this.originAirport == "LHR") || (this.originAirport == "LGW") || (this.originAirport == "LCY")))) {
matched = true;
}
else {
for(var priceIndex = 0; priceIndex < this.prices.prices.length; ++priceIndex) {
currentPrice = this.prices.prices[priceIndex];
if(currentPrice.hasAddonLocation(fromCode)) {
matched = true;
break;
}
}
}
return(matched);
}
Woffer.prototype.matchesDestinationCode = function(toCode) {
var matched = false;
if(this.regionCode == toCode) {
matched = true;
}
else {
var holidayTypes = this.getOption("optional3")
if(holidayTypes && (holidayTypes.value.toUpperCase().search(toCode.toUpperCase()) != -1)) {
matched = true;
}
}
return(matched);
}
Woffer.prototype.matchesPriceBand = function(fromPrice, toPrice) {
var matched = false;
var lowestPrice = null;
var currentPrice = null;
for(var index = 0; index < this.prices.prices.length; ++index) {
currentPrice = this.prices.prices[index];
if((lowestPrice == null) || (currentPrice.price < lowestPrice.price)) {
lowestPrice = currentPrice;
}
}
return(matched);
}
Woffer.prototype.hasSaleFare = function() {
var matched = false;
var currentPrice = null;
for(var index = 0; index < this.prices.prices.length; ++index) {
currentPrice = this.prices.prices[index];
if(currentPrice.valueFare == false) {
matched = true;
break;
}
}
return(matched);
}
Woffer.prototype.getOption = function(optionKey) {
var returnOption = null;
var currentOption = null;
for(var index = 0; index < this.wofferOptions.length; ++index) {
currentOption = this.wofferOptions[index];
if(currentOption.title == optionKey) {
returnOption = currentOption;
break;
}
}
return(returnOption);
}
function Prices(priceData) {
this.prices = new Array();
var newPrice = null;
for(var index = 0; index < priceData.length; ++index) {
newPrice = new Price(priceData[index]);
if(newPrice.price && (newPrice.price != "")) {
this.prices.push(new Price(priceData[index]));
}
}
}
function Price(priceData) {
this.price = null;
var tempPrice = 0;
this.valueFare = false;
this.outboundFromDate = "";
this.outboundToDate = "";
this.addonPrices = new Array();
if(priceData.fare_info && (priceData.fare_info.toUpperCase().search("VALUE") != -1)) {
this.valueFare = true;
}
if(priceData.price) {
tempPrice = priceData.price.replace(/\,/g, '');
this.price = Math.round(tempPrice);
}
if(priceData.out_from) {
this.outboundFromDate = priceData.out_from;
}
if(priceData.out_to) {
this.outboundToDate = priceData.out_to;
}
var tempDepartureCode = "";
if(priceData.abz_add_on) {
tempDepartureCode = "ABZ";
tempPrice = priceData.abz_add_on.replace(/\,/g, '');
this.addonPrices.push(new AddonPrice(tempDepartureCode, Math.round(tempPrice),Math.round(tempPrice)-this.price));
}
if(priceData.man_add_on) {
tempDepartureCode = "MAN";
tempPrice = priceData.man_add_on.replace(/\,/g, '');
this.addonPrices.push(new AddonPrice(tempDepartureCode, Math.round(tempPrice),Math.round(tempPrice)-this.price));
}
if(priceData.edi_add_on) {
tempDepartureCode = "EDI";
tempPrice = priceData.edi_add_on.replace(/\,/g, '');
this.addonPrices.push(new AddonPrice(tempDepartureCode, Math.round(tempPrice),Math.round(tempPrice)-this.price));
}
if(priceData.ncl_add_on) {
tempDepartureCode = "NCL";
tempPrice = priceData.ncl_add_on.replace(/\,/g, '');
this.addonPrices.push(new AddonPrice(tempDepartureCode, Math.round(tempPrice),Math.round(tempPrice)-this.price));
}
if(priceData.gla_add_on) {
tempDepartureCode = "GLA";
tempPrice = priceData.gla_add_on.replace(/\,/g, '');
this.addonPrices.push(new AddonPrice(tempDepartureCode, Math.round(tempPrice),Math.round(tempPrice)-this.price));
}
if(priceData.jer_add_on) {
tempDepartureCode = "JER";
tempPrice = priceData.jer_add_on.replace(/\,/g, '');
this.addonPrices.push(new AddonPrice(tempDepartureCode, Math.round(tempPrice),Math.round(tempPrice)-this.price));
}
if(priceData.bfs_add_on) {
tempDepartureCode = "BFS";
tempPrice = priceData.bfs_add_on.replace(/\,/g, '');
this.addonPrices.push(new AddonPrice(tempDepartureCode, Math.round(tempPrice),Math.round(tempPrice)-this.price));
}
}
Price.prototype.hasAddonLocation = function(locationCode) {
var matched = false;
var currentAddon = null;
for(var index = 0; index < this.addonPrices.length; ++index) {
currentAddon = this.addonPrices[index];
if(currentAddon.location == locationCode) {
matched = true;
break;
}
}
return(matched);
}
Price.prototype.getAddonPrice = function(locationCode) {
var returnPrice = null;
var currentAddon = null;
for(var index = 0; index < this.addonPrices.length; ++index) {
currentAddon = this.addonPrices[index];
if(currentAddon.location == locationCode) {
returnPrice = currentAddon;
break;
}
}
return(returnPrice);
}
function AddonPrice(location, price, addon) {
this.location = location;
this.price = price;
this.addon = addon;
}
function WofferOption(title, value) {
this.title = title;
this.value = value;
}
function WofferTable(elementId, wofferData, fromCode, toCode) {
this.elementId = elementId;
this.wofferData = wofferData;
this.fromCode = fromCode;
this.toCode = toCode;
this.footnotes = new Array();
this.includeNonSale = false;
}
WofferTable.prototype.processTravelClassEvent = function(element) {
gTravelClass = element.getAttribute("value");
this.buildOutput();
}
WofferTable.prototype.processFromChange = function(element) {
for(var index = 0; index < element.options.length; ++index) {
if(element.options[index].selected) {
this.fromCode = element.options[index].value;
gFromCode = this.fromCode;
break;
}
}
this.buildOutput();
}
WofferTable.prototype.processRegionChangeEvent = function(element) {
var clickedRegionCode = element.getAttribute("regionCode");
this.toCode = clickedRegionCode;
var imageNavItems = $(".regionNavigation li a");
var CaribLinkItem = $(".LAClink");
imageNavItems.removeClass("selected");
clickedRegionCode = clickedRegionCode.toLowerCase();
$(".regionNavigation li." + clickedRegionCode + " a").addClass("selected");
this.buildOutput();
}
WofferTable.prototype.trackChanges = function()
{
trackingInfo["MARSALE1"] = gNavType;
trackingInfo["LKDeparturePoint"] = this.fromCode;
trackingInfo["MARSALE2"] = this.toCode;
trackingInfo["pageidextra"] = gNavType + "-" + this.toCode;
document.getElementById("t-tracking-fragment").innerHTML = vsDoTracking();
}
WofferTable.prototype.buildOutput = function() {
$("#tablePodBottom").show();
$("#tableDiv").slideUp(500, function() {gWofferTable.buildOutput2();
$("#tableDiv").slideDown(500);
$("#tablePodBottom").hide();
$("#salepageBottom").show();});
}
WofferTable.prototype.buildOutput2 = function() {
var valueFareFooter = false;
var priceHTML = "";
var datesHTML = "";
var upgradeHTML = "";
var prices = null;
var currentPrice = null;
var priceType = "";
var tempPrice = 0;
var tempHTML = "";
var rowID;
var nonFlightTokens;
var tempUpgradeData;
var	usedPriceCount = 0;
var lb_fromCode;
var lb_toCode;
this.footnotes.length = 0;
tempHTML += "<table id=\"table1\" class=\"tablesorter peekFix ngtable\" cellspacing=\"0\" border=\"0\" summary=\"World offers fares\" style=\"width: 100%;\">\n";
tempHTML += "<thead>\n";
tempHTML += "<tr valign=\"top\" >\n";
for(var index = 0; index < TABLE_HEADERS.length; ++index) {
if(TABLE_HEADERS[index][4] == gPageType) {
tempHTML += "<th id=\"tableHeaderCell" + index +
"\" colspan=\"" +
TABLE_HEADERS[index][1] +
"\" title=\"" +
TABLE_HEADERS[index][2] +
"\">" +
TABLE_HEADERS[index][0] +
TABLE_HEADERS[index][3] +
"</th>\n";
}
}
tempHTML += "</tr>\n";
tempHTML += "</thead>";
tempHTML += "<tbody id=\"table2body\">";
var matchingWoffers = null;
var currentWoffer = null;
var tempOption = null;
var tempOption2 = null;
if ( TECHNICAL_DIFFICULTIES ) {
tempHTML += "<tr><td class=\"noMatchResult\" colspan=\"9\">" + TECHNICAL_DIFFICULTIES_MESSAGE + ".</td></tr>\n";
} else {
matchingWoffers = gWoffersData.getWoffersForLocations(this.fromCode, this.toCode, this.includeNonSale);
}
if(matchingWoffers.length <= 0) {
tempHTML += "<tr><td class=\"noMatchResult\" colspan=\"9\">Sorry, no destinations available from ";
tempHTML += getAirportName(this.fromCode) + " match your search";
tempHTML += ".</td></tr>\n";
}
else {
matchingWoffers.sort(function(first, second) {
var result = 0;
if((first.originAirport == this.gWofferTable.fromCode) && (second.originAirport != this.gWofferTable.fromCode)) {
result = -1;
}
else if((first.originAirport != this.gWofferTable.fromCode) && (second.originAirport == this.gWofferTable.fromCode)) {
result = 1;
}
else if(first.destinationName < second.destinationName) {
result = -1;
}
else if(first.destinationName > second.destinationName) {
result = 1;
}
return(result);
});
}
var rowClass = "";
var countRowsToDisplay = 0;
for(var index = 0; index < matchingWoffers.length; ++index) {
currentWoffer = matchingWoffers[index];
rowID = "wofferRow" + index;
rowClass="";
var tempTableRowHTML = "";
gFlightFound = false;
gPackageFound = false;
var urlTCO = null;
if (this.toCode == "EUR") {
tempOption = currentWoffer.getOption("optional4");
if(tempOption && tempOption.value == "new" && !currentWoffer.getLowestPrice().valueFare) {
rowClass = "justadded";
}
}
tempOption2 = currentWoffer.getOption("optional3");
if(tempOption2 && tempOption2.value == "so" && !currentWoffer.getLowestPrice().valueFare) {
rowClass = "specialoffer";
}
tempTableRowHTML += "<tr id=\"" +rowID + "\"" + (rowClass!=""?" class='" + rowClass + "'":"") + ">\n";
tempTableRowHTML +="<td class=\"destinationCell\">";
urlTCO = currentWoffer.getOption("optional4");
if (urlTCO != null) {
tempTableRowHTML += '<a href="' + urlTCO.value;
			tempTableRowHTML += "\" title=\"Destination guides.\">";
			// Add the departure name
			tempTableRowHTML += currentWoffer.destinationName + "</a>";
			tempTableRowHTML += '<a href="' + urlTCO.value;
tempTableRowHTML += "\" title=\"Destination guides.\">";
tempTableRowHTML += getHTMLforThumbnail(currentWoffer.destinationAirport, currentWoffer.destinationName) + "</a>";
} else {
tempTableRowHTML += currentWoffer.destinationName;
tempTableRowHTML += getHTMLforThumbnail(currentWoffer.destinationAirport, currentWoffer.destinationName);
}
if ( currentWoffer.footnote ) {
var footnotenumber = currentWoffer.footnote.match(/^[^\sA-Za-z]+/);
if (footnotenumber && footnotenumber.length == 1) {
tempTableRowHTML += "&nbsp;<sup>" + footnotenumber[0] + "</sup>";
}
}
if(gFromCode == "LON" ) {
tempTableRowHTML += "<span class=\"londonAll\"><br/>from "+getAirportName(currentWoffer.originAirport)+"</span>";
} else if ( gFromCode != "LON" && gFromCode != "LHR" && gFromCode != "LGW" && gFromCode != "LCY" && gFromCode != currentWoffer.originAirport ) {
tempTableRowHTML += "<span class=\"londonAll\"><br/>via "+getAirportName(currentWoffer.originAirport)+"</span>";
}
tempTableRowHTML += "</td>\n";
if (gPageType == "HYBRID") {
tempTableRowHTML += getHybridFlightCell(currentWoffer, this.fromCode, this.includeNonSale);
}
if (gPageType == "HYBRID") {
tempTableRowHTML += getDealCell(currentWoffer.destinationAirport, currentWoffer.originAirport, this.fromCode);
}
if (gPageType == "FLIGHTS") {
tempTableRowHTML += getFlightCell(currentWoffer, this.fromCode, this.includeNonSale);
}
if(currentWoffer.footnote) {
this.addFootnote(currentWoffer.footnote);
}
if (gTravelClass == 'F' || gTravelClass == 'W') {
if (gFlightFound == true || gPackageFound == true) {
++countRowsToDisplay;
tempHTML += tempTableRowHTML;
} else {
}
} else {
++countRowsToDisplay;
tempHTML += tempTableRowHTML;
}
}
if (countRowsToDisplay == 0) {
tempHTML += "<tr><td class=\"noMatchResult\" colspan=\"3\">Sorry, no destinations available from ";
tempHTML += getAirportName(this.fromCode) + " match your search";
tempHTML += ".</td></tr>";
}
tempHTML += "</tbody>\n</table>";
$("#tableDiv").html(tempHTML);
$(".flightDetail").hide();
$(".datesDetail").hide();
$(".flightOutlineDup").hide();
$(".dealDetail").hide();
$(".flightCell .twiddly").toggle(
function () {
$(this).html("show less travel dates");
$(this).parent().children('.flightDetail').show().children().show();
},
function () {
$(this).html("show more travel dates");
$(this).parent().children('.flightDetail').hide().children().hide();
}
);
$(".datesCell .twiddly").click(function() {
$(this).hide();
$(this).parent().children('.datesOutline').hide();
$(this).parent().children('.datesDetail').show().children().show();
});
$(".datesCell .datesDetail .twiddly").click(function() {
$(this).parent().hide();
$(this).parent().parent().children(".twiddly").show();
$(this).parent().parent().children(".datesOutline").show();
});
$(".deal .twiddly").click(function() {
$(this).parent().parent().children().toggle();
});
if(matchingWoffers && matchingWoffers.length > 0) {
$(document).ready(function() {
$.tablesorter.defaults.widgets = ['zebra'];
$("table").tablesorter({
sortList: [[gLastColSorted,gLastColSortOrder]],
headers: {0: {sorter:'imageDestinations'}, 1: {sorter: false}, 2: {sorter: false}, 3: {sorter: false}, 4: {sorter: false}, 5: {sorter: false}, 6: {sorter: false} }
,textExtraction: 'complex'
});
});
}
if(!this.includeNonSale) {
var trjustadded = $("tr.justadded");
if(trjustadded.length) {
var tbody = trjustadded[0].parentNode;
$(tbody).prepend(trjustadded);
$(tbody).find("tr:odd").removeClass("even").addClass("odd");
$(tbody).find("tr:even").removeClass("odd").addClass("even");
$("tr.justadded:first").before( "<tr class='sectionHeader'><th colspan='5'>New routes added</th></tr>" );
$("tr.justadded:last").after( "<tr class='sectionHeader'><th colspan='5'>Also on sale</th></tr>" );
$(".header").click(function(){ $(".sectionHeader").remove() });
}
}
if(!this.includeNonSale) {
var trjustadded = $("tr.specialoffer");
if(trjustadded.length) {
var tbody = trjustadded[0].parentNode;
$(tbody).prepend(trjustadded);
$(tbody).find("tr:odd").removeClass("even").addClass("odd");
$(tbody).find("tr:even").removeClass("odd").addClass("even");
$("tr.specialoffer:first").before( "<tr class='spoffHeader'><th>This week only</th><th>&nbsp;</th><th colspan='3'>GET 3 NIGHTS HOTEL FROM &pound;50<br />Book by midnight Wednesday</th></tr>" );
$("tr.specialoffer:last").after( "<tr class='spoffHeader2'><th colspan='5'>Book by 22 September 2009</th></tr>" );
$(".header").click(function(){ $(".spoffHeader").remove() });
$(".header").click(function(){ $(".spoffHeader2").remove() });
}
}
var tempFootnoteHTML = "<p>";
for(var footnoteIndex = 0; footnoteIndex < this.footnotes.length; ++footnoteIndex) {
tempFootnoteHTML += this.footnotes[footnoteIndex] + "";
}
tempFootnoteHTML += "</p>";
$('#footnotes').empty().append(tempFootnoteHTML);
initialisePlantrip();
}
WofferTable.prototype.addFootnote = function(footnote) {
var foundFootnote = false;
for(var footnoteIndex = 0; footnoteIndex < this.footnotes.length; ++footnoteIndex) {
if(this.footnotes[footnoteIndex] == footnote) {
foundFootnote = true;
break;
}
}
if(!foundFootnote) {
this.footnotes.push(footnote);
}
}
function getAirportName(airportCode) {
var airportName = "";
for(var locationIndex = 0; locationIndex < LOCATIONS.length; ++locationIndex) {
if(LOCATIONS[locationIndex][0] == airportCode) {
airportName = LOCATIONS[locationIndex][1];
break;
}
}
return(airportName);
}
function isPostPin() {
var isPostpin = false;
if(document.nav_form.logintype.value != 'public') {
isPostpin = true;
}
return(isPostpin);
}
function getAdjustedPrice(originalPrice, priceType) {
var tempPrice = originalPrice;
if(isPostPin()) {
switch(priceType) {
case ONEWAY_PRICE_TYPE: {
tempPrice = parseInt(tempPrice) - parseInt(ONEWAY_PRICE_POSTPIN_DISCOUNT);
break;
}
case RETURN_PRICE_TYPE: {
tempPrice = parseInt(tempPrice) - parseInt(RETURN_PRICE_POSTPIN_DISCOUNT);
break;
}
}
}
return(tempPrice);;
}
function getAdjustedHotelPrice(price) {
var tempPrice = parseFloat(price);
if(isPostPin()) {
var discount = HOTEL_PRICE_POSTPIN_DISCOUNT;
if(discount) {
discount = tempPrice * (parseFloat(discount) / 100);
tempPrice -= discount;
}
}
return Math.ceil(tempPrice);
}
function getCookie(cName)
{
if (document.cookie.length > 0)
{
cStart=document.cookie.indexOf(cName + "=");
if(cStart!=-1)
{
cStart = cStart + cName.length + 1;
cEnd = document.cookie.indexOf(";" , cStart);
if(cEnd==-1)
{
cEnd = document.cookie.length;
}
return unescape(document.cookie.substring(cStart,cEnd));
}
}
return "";
}
function setCookie(cName,cValue)
{
var expireDate = new Date();
expireDate.setFullYear(expireDate.getFullYear() + 1);
document.cookie = cName + "=" + escape(cValue) + "; expires=" + expireDate;
switch(cValue) {
case 0: {
gLinkType = "FXPAGE";
break;
}
case 1: {
gLinkType = "LPBMPAGE";
break;
}
default: {
gLinkType = "FXPAGE";
}
}
}
function isAddon(wofferDeparture, requiredDeparture)
{
var isAddon = true;
if((wofferDeparture == requiredDeparture) || ((requiredDeparture == "LON") && ((wofferDeparture == "LHR") || (wofferDeparture == "LGW") || (wofferDeparture == "LCY")))) {
isAddon = false;
}
return(isAddon);
}
function tb_plan_book() {
var params = {};
vsSplitParameters($("#batbox_iframeContent")[0].src,params);
fromCode = (params.from ? params.from : "");
toCode = (params.to ? params.to : "");
self.parent.location = "/main/fx?from=" + fromCode + "&to=" + toCode;
}
function FXUrl(fromCode, currentWoffer) {
var url = "/main/FX?to=";
url += currentWoffer.destinationAirport + "&amp;from=";
url += fromCode;
url += "&amp;cabin="+gTravelClass;
return url;
}
function FXUpgradeUrl(fromCode, currentWoffer) {
var url = "/main/FX?to=";
url += currentWoffer.destinationAirport + "&amp;from=";
url += fromCode;
url += "&amp;cabin=W";
return url;
}
function LPBMUrl(fromCode, currentWoffer) {
var url = "";
if ( ((fromCode == "LCY") || (fromCode == "LGW") || (fromCode == "LHR") || (fromCode == "LON")) && (currentWoffer.destinationAirport != "BWI") ) {
url = "http://www.britishairways.com/travel/low-price-finder/public/en_gb?eId=113021&origin=";
url += fromCode + "&destination=";
url += currentWoffer.destinationAirport + "&amp;cabin=" + gTravelClass;
}
else {
url = "/main/FX?to=";
url += currentWoffer.destinationAirport + "&amp;from=";
url += fromCode;
url += "&amp;cabin="+gTravelClass;
}
return url;
}
function StringBuilder(str) {
if ( $.browser.msie ) {
var internal = str?[str]:[];
this.append = function(str) {
internal[internal.length]=str;
}
this.toString = function() {
return internal.join("");
}
} else {
var internal = str || "";
this.append = function(str) {
internal+=str;
}
this.toString = function() {
return internal;
}
}
return this;
}
function getHybridFlightCell(currentWoffer, sOrigin, includeNonSale)
{
var flightHTML = "<td class='flightCell'>";
var flightOutline = "";
var flightOutlineDup = "";
var notNullPrice = true;
var leadPrice = "";
var leadOutboundFromDate = "";
var leadOutboundToDate = "";
priceFirst = currentWoffer.getOption("optional1");
if (priceFirst == null && (gTravelClass == 'F' || gTravelClass == 'W')) {
gFlightFound = false;
return ('<td></td>');
}
gFlightFound = true;
switch (gTravelClass) {
case 'M': {
gTravelClassName = "Economy";
break;
}
case 'W': {
gTravelClassName = "Premium Economy";
break;
}
case 'J': {
gTravelClassName = "Business/Club";
break;
}
case 'F': {
gTravelClassName = "First";
break;
}
}
currentPrice = currentWoffer.getLowestPrice();
leadPrice = currentPrice.price;
leadOutboundFromDate = currentPrice.outboundFromDate;
leadOutboundToDate = currentPrice.outboundToDate;
if(isAddon(currentWoffer.originAirport, sOrigin)) {
tempPrice = parseInt(currentPrice.getAddonPrice(sOrigin).price);
}
else {
tempPrice = parseInt(currentPrice.price);
}
if ((gTravelClass == 'F' || gTravelClass == 'W') && priceFirst != null) {
if(isAddon(currentWoffer.originAirport, sOrigin)) {
tempPrice = parseInt(currentPrice.getAddonPrice(sOrigin).addon) + parseInt(priceFirst.value) + parseInt(currentPrice.price);
}
else {
tempPrice = parseInt(priceFirst.value) + parseInt(currentPrice.price);
}
}
lb_toCode = currentWoffer.destinationAirport;
if(this.fromCode == "LON") {
lb_fromCode = currentWoffer.originAirport;
}
else {
lb_fromCode = sOrigin;
}
flightOutline = "<div class='flightOutline'>"
if(gLinkType == "FXPAGE") {
flightOutline += '<div class="leadPrice"><a href="' + FXUrl(lb_fromCode, currentWoffer) + '" title="Plan or book.">';
}
else {
flightOutline += '<div class="leadPrice"><a href="' + LPBMUrl(lb_fromCode, currentWoffer) + '" title="See lowest price by month.">';
}
flightOutline += "&pound;" + tempPrice;
flightOutlineDup = "<div class='flightOutlineDup'>"
if(gLinkType == "FXPAGE") {
flightOutlineDup += '<div class="leadPrice"><a href="' + FXUrl(lb_fromCode,currentWoffer) + '" title="Plan or book.">';
}
else {
flightOutlineDup += '<div class="leadPrice"><a href="' + LPBMUrl(lb_fromCode, currentWoffer) + '" title="See lowest price by month.">';
}
flightOutlineDup += "&pound;" + tempPrice;
if(currentWoffer.priceType == RETURN_PRICE_TYPE) {
priceType = "return flight"
}
else {
priceType = "one-way flight";
}
flightOutline += "</a><span class='priceType'>"+priceType+"</span>";
flightOutlineDup += "</a><span class='priceType'>"+priceType+"</span>";
if(currentPrice.valueFare) {
flightOutline += "<sup>1</sup>";
flightOutlineDup += "<sup>1</sup><br/>";
valueFareFooter = true;
}
flightOutline += "</div><span class=\"travelClass\"><a href=\"javascript:popUpScrolling('/main/pop_cabininfo',590,630)\" title=\"Class of travel.\">"+gTravelClassName+"</a></span>";
flightOutlineDup += "</div>";
flightOutline += "<div class=\"leadDates\">";
flightOutline += currentPrice.outboundFromDate + " - " + currentPrice.outboundToDate;
flightOutline += "</div>";
flightOutline += "</div>"
flightOutlineDup += "<div class=\"leadDates\">";
flightOutlineDup += currentPrice.outboundFromDate + " - " + currentPrice.outboundToDate;
flightOutlineDup += "</div>";
flightOutlineDup += "</div>"
flightDetail = "<div class='flightDetail'>"
flightDetail += "<div class='detail'>";
prices = currentWoffer.prices.prices;
usedPriceCount = 0;
for(var pricesIndex = 0; pricesIndex < prices.length; ++pricesIndex)
{
if(gLinkType == "FXPAGE") {
flightDetail += '<div class="detailPrice"><a href="' + FXUrl(lb_fromCode,currentWoffer) + '" title="Plan or book.">';
}
else {
flightDetail += '<div class="detailPrice"><a href="' + LPBMUrl(lb_fromCode,currentWoffer) + '" title="Plan or book.">';
}
currentPrice = prices[pricesIndex];
if(currentPrice.valueFare && (includeNonSale == false)) {
}
else {
++usedPriceCount;
if (currentPrice.price == leadPrice && currentPrice.outboundFromDate == leadOutboundFromDate && currentPrice.outboundToDate == leadOutboundToDate) {
continue;
}
if(isAddon(currentWoffer.originAirport, sOrigin)) {
if(currentPrice.getAddonPrice(sOrigin) == null) {
--usedPriceCount;
notNullPrice = false;
}
else {
tempPrice = parseInt(currentPrice.getAddonPrice(sOrigin).price);
if ((gTravelClass == 'F' || gTravelClass == 'W') && priceFirst != null) {
tempPrice = parseInt(currentPrice.getAddonPrice(sOrigin).addon) + parseInt(priceFirst.value) + parseInt(currentPrice.price);
}
}
}
else {
tempPrice = parseInt(currentPrice.price);
if ((gTravelClass == 'F' || gTravelClass == 'W') && priceFirst != null) {
tempPrice = parseInt(priceFirst.value) + parseInt(currentPrice.price);
}
}
if(currentPrice.valueFare == false) {
tempPrice = getAdjustedPrice(tempPrice, currentWoffer.priceType);
}
if(notNullPrice) {
flightDetail += "&pound;" + tempPrice;
if(currentPrice.valueFare) {
flightDetail += "</a><sup>1</sup> ";
valueFareFooter = true;
}
else {
flightDetail += "</a></div> ";
}
flightDetail += '<div class="detailDates">' + currentPrice.outboundFromDate + ' - ' + currentPrice.outboundToDate + '</div>';
flightDetail += '<div class="clearBoth peekFix"></div>';
}
}
}
flightDetail += "</div>"
flightDetail += "</div>"
if(usedPriceCount > 1) {
flightHTML += flightOutline;
flightHTML += "<div class='twiddly'>";
flightHTML += "show more travel dates";
flightHTML += "</div>";
flightHTML += flightDetail;
}
else {
flightHTML += flightOutline;
flightHTML += flightOutlineDup;
}
flightHTML += "</td>";
return flightHTML;
}
function getFlightCell(currentWoffer, sOrigin, includeNonSale)
{
var flightHTML = "<td class='flightCell'>";
var datesHTML = "<td class='datesCell'>";
var actionHTML = "<td class='actionCell'>";
var flightOutline = "";
var flightOutlineDup = "";
var datesOutline = "";
var datesOutlineDup = "";
var actionOutline = "";
var notNullPrice = true;
var url = "";
currentPrice = currentWoffer.getLowestPrice();
if(isAddon(currentWoffer.originAirport, sOrigin)) {
tempPrice = parseInt(currentPrice.getAddonPrice(sOrigin).price);
}
else {
tempPrice = parseInt(currentPrice.price);
}
if(currentPrice.valueFare == false) {
tempPrice = getAdjustedPrice(tempPrice, currentWoffer.priceType);
}
lb_toCode = currentWoffer.destinationAirport;
if(this.fromCode == "LON") {
lb_fromCode = currentWoffer.originAirport;
}
else {
lb_fromCode = sOrigin;
}
if(gLinkType == "FXPAGE") {
url = FXUrl(lb_fromCode,currentWoffer);
}
else {
url = LPBMUrl(lb_fromCode,currentWoffer);
}
flightOutline = "<div class='flightOutline'>"
flightOutline += '<div class="leadPrice"><a href="' + url + '" title="Plan or book.">';
flightOutline += "&pound;" + tempPrice;
flightOutlineDup = "<div class='flightOutlineDup'>"
flightOutlineDup += '<div class="leadPrice"><a href="' + url + '" title="Plan or book.">';
flightOutlineDup += "&pound;" + tempPrice;
actionOutline += '<a href="' + url + '" title="Plan or book.">Plan or book</a>';
actionHTML += actionOutline + '</td>';
if(currentWoffer.priceType == RETURN_PRICE_TYPE) {
priceType = " return"
}
else {
priceType = " one-way";
}
flightOutline += priceType;
flightOutlineDup += priceType;
if(currentPrice.valueFare) {
flightOutline += "<sup>1</sup><br />";
flightOutlineDup += "<sup>1</sup><br />";
valueFareFooter = true;
}
flightOutline += "</a></div>";
flightOutlineDup += "</a></div>";
flightOutline += "</div>"
flightOutlineDup += "</div>"
datesOutline = "<div class='datesOutline'>"
datesOutline += "<div class=\"leadDates\">";
datesOutline += currentPrice.outboundFromDate + " - " + currentPrice.outboundToDate;
datesOutline += "</div>";
datesOutline += "</div>";
datesOutlineDup = "<div class='datesOutlineDup'>"
datesOutlineDup += "<div class=\"leadDates\">";
datesOutlineDup += currentPrice.outboundFromDate + " - " + currentPrice.outboundToDate;
datesOutlineDup += "</div>";
datesOutlineDup += "</div>";
flightDetail = "<div class='flightDetail'>"
flightDetail += "<div class='detail'>";
datesDetail = "<div class='datesDetail'>"
datesDetail += "<div class='twiddly'>";
datesDetail += "<img height='9' width='9' title='Click to show less details.' alt='Minus sign.' src='/cms/global/assets/images/promotion/uk/may_campaign_2009/twisty-open.gif'/>";
datesDetail += "</div>";
datesDetail += "<div class='detail'>";
prices = currentWoffer.prices.prices;
usedPriceCount = 0;
for(var pricesIndex = 0; pricesIndex < prices.length; ++pricesIndex)
{
flightDetail += '<div class="detailPrice"><a href="' + getDpUrl(currentWoffer.destinationAirport, currentWoffer.originAirport, lb_fromCode) + '" title="Plan or book.">';
currentPrice = prices[pricesIndex];
if(currentPrice.valueFare && (includeNonSale == false)) {
}
else {
++usedPriceCount;
if(isAddon(currentWoffer.originAirport, sOrigin)) {
if(currentPrice.getAddonPrice(sOrigin) == null) {
--usedPriceCount;
notNullPrice = false;
}
else {
tempPrice = parseInt(currentPrice.getAddonPrice(sOrigin).price);
}
}
else {
tempPrice = parseInt(currentPrice.price);
}
if(currentPrice.valueFare == false) {
tempPrice = getAdjustedPrice(tempPrice, currentWoffer.priceType);
}
if(notNullPrice) {
flightDetail += "&pound;" + tempPrice + priceType;
if(currentPrice.valueFare) {
flightDetail += "</a><sup>1</sup> ";
valueFareFooter = true;
}
else {
flightDetail += "</a></div> ";
}
datesDetail += '<div class="detailDates">' + currentPrice.outboundFromDate + ' - ' + currentPrice.outboundToDate + '</div>';
}
}
}
flightDetail += "</div>"
flightDetail += "</div>"
datesDetail += "</div>"
datesDetail += "</div>"
if(usedPriceCount > 1) {
flightHTML += flightOutline;
flightHTML += flightDetail;
datesHTML += "<div class='twiddly'>";
datesHTML += "<img height='9' width='9' title='Click to show more details.' alt='Plus sign.' src='/cms/global/assets/images/promotion/uk/may_campaign_2009/twisty-closed.gif'/>";
datesHTML += "</div>";
datesHTML += datesOutline;
datesHTML += datesDetail;
}
else
{
flightHTML += "<div class='twiddly'>";
flightHTML += "</div>";
flightHTML += flightOutline;
flightHTML += flightOutlineDup;
datesHTML += "<div class='twiddly'>";
datesHTML += "</div>";
datesHTML += datesOutline;
datesHTML += datesOutlineDup;
}
flightHTML += "</td>";
datesHTML += "</td>";
return flightHTML+datesHTML+actionHTML;
}
