var DataContainer = Class.create(); DataContainer.prototype = { initialize : function () { this.countries = [ new Country("AU","Australia"),new Country("NZ","New Zealand"),new Country("ZA","South Africa") ]; this.airports = [ new Airport("ABX","Albury","AU",this.countries),new Airport("ADL","Adelaide","AU",this.countries),new Airport("AKL","Auckland","NZ",this.countries),new Airport("ARM","Armidale","AU",this.countries),new Airport("ASP","Alice Springs","AU",this.countries),new Airport("AYQ","Ayers Rock (Uluru)","AU",this.countries),new Airport("BCI","Barcaldine","AU",this.countries),new Airport("BDB","Bundaberg","AU",this.countries),new Airport("BKQ","Blackall","AU",this.countries),new Airport("BLT","Blackwater","AU",this.countries),new Airport("BME","Broome","AU",this.countries),new Airport("BNE","Brisbane","AU",this.countries),new Airport("BNK","Ballina (Byron)","AU",this.countries),new Airport("CBR","Canberra","AU",this.countries),new Airport("CFS","Coffs Harbour","AU",this.countries),new Airport("CHC","Christchurch","NZ",this.countries),new Airport("CNS","Cairns","AU",this.countries),new Airport("CTL","Charleville","AU",this.countries),new Airport("DBO","Dubbo","AU",this.countries),new Airport("DPO","Devonport","AU",this.countries),new Airport("DRW","Darwin","AU",this.countries),new Airport("EMD","Emerald","AU",this.countries),new Airport("GLT","Gladstone","AU",this.countries),new Airport("GOV","Gove (Nhulunbuy)","AU",this.countries),new Airport("HBA","Hobart","AU",this.countries),new Airport("HID","Horn Island","AU",this.countries),new Airport("HTI","Hamilton Island","AU",this.countries),new Airport("ISA","Mount Isa","AU",this.countries),new Airport("JNB","Johannesburg","ZA",this.countries),new Airport("KGI","Kalgoorlie","AU",this.countries),new Airport("KTA","Karratha","AU",this.countries),new Airport("LDH","Lord Howe Island","AU",this.countries),new Airport("LRE","Longreach","AU",this.countries),new Airport("LST","Launceston","AU",this.countries),new Airport("MCY","Sunshine Coast","AU",this.countries),new Airport("MEL","Melbourne","AU",this.countries),new Airport("MKY","Mackay","AU",this.countries),new Airport("MQL","Mildura","AU",this.countries),new Airport("MRZ","Moree","AU",this.countries),new Airport("NAA","Narrabri","AU",this.countries),new Airport("NTL","Newcastle","AU",this.countries),new Airport("OOL","Gold Coast","AU",this.countries),new Airport("PBO","Paraburdoo","AU",this.countries),new Airport("PER","Perth","AU",this.countries),new Airport("PHE","Port Hedland","AU",this.countries),new Airport("PPP","Proserpine","AU",this.countries),new Airport("PQQ","Port Macquarie","AU",this.countries),new Airport("RMA","Roma","AU",this.countries),new Airport("ROK","Rockhampton","AU",this.countries),new Airport("SYD","Sydney","AU",this.countries),new Airport("TMW","Tamworth","AU",this.countries),new Airport("TSV","Townsville","AU",this.countries),new Airport("WEI","Weipa","AU",this.countries),new Airport("WGA","Wagga Wagga","AU",this.countries),new Airport("WLG","Wellington","NZ",this.countries),new Airport("ZNE","Newman","AU",this.countries),new Airport("ZQN","Queenstown","NZ",this.countries) ]; this.classes = [ new BookingClass("Y","ECO", "Economy"), new BookingClass("P","PRM", "Premium Economy"), new BookingClass("J","BUS", "Business/First") ]; this.isSaleDate = [ true ]; this.travelDate = [ 20080401 ]; this.currentDate = [ 20091121 ]; this.fromAirports = ["JNB"]; this.popularFromAirports = null; this.toAirports = ["ADL","ABX","ASP","ARM","AKL","AYQ","BNK","BCI","BKQ","BLT","BNE","BME","BDB","CNS","CBR","CTL","CHC","CFS","DRW","DPO","DBO","EMD","GLT","OOL","GOV","HTI","HBA","HID","KGI","KTA","LST","LRE","LDH","MKY","MEL","MQL","MRZ","ISA","NAA","NTL","ZNE","PBO","PER","PHE","PQQ","PPP","ZQN","ROK","RMA","MCY","SYD","TMW","TSV","WGA","WEI","WLG"]; this.popularToAirports = null; // This matrix contains business data to make decisions relating to city pair from/to // combinations. It is written like this to reduce the page weight and is queried by the // javascript model which in turns models it into sensible data. // The columns represent 'to' cities and must match the cities in order as specified in the // this.toCities array. // The rows represent 'from' cities and must match the cities in order as specified in the // this.fromCities array. // Each data item has a number of elements representing a boolean value for the // piece of data it is representing. The data they represent is defined in the constants // below. this.matrix = 'rrrrvrrrrrrrrrrrvrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrvrrrrv'; // item 0 = valid flight - if true then this from/to combination is valid. this.VALID_FLIGHT_INDEX = 0; // item 1 = economy - if true then economy is to be available for this from/to combination this.CLASS_ECONOMY_INDEX = 1; // item 2 = premium - if true then premium economy is to be available for this from/to combination this.CLASS_PREMIUM_INDEX = 2; // item 3 = business - if true then business is to be available for this from/to combination this.CLASS_BUSINESS_INDEX = 3; // item 4 = first - if true then first is to be available for this from/to combination this.CLASS_FIRST_INDEX = 4; }, // below are the getters for each piece of data within this object getClasses : function () { return this.classes; }, getAirports : function () { return this.airports; }, getCountries : function () { return this.countries; }, getToAirports : function () { return this.toAirports; }, getFromAirports : function () { return this.fromAirports; }, getPopularFromAirports : function () { return this.popularFromAirports; }, getValidFlightIndex : function () { return this.VALID_FLIGHT_INDEX; }, getEconomyClassIndex : function () { return this.CLASS_ECONOMY_INDEX; }, getPremiumClassIndex : function () { return this.CLASS_PREMIUM_INDEX; }, getBusinessClassIndex : function () { return this.CLASS_BUSINESS_INDEX; }, getFirstClassIndex : function () { return this.CLASS_FIRST_INDEX; }, getMatrix : function () { return this.matrix; }, getIsSaleDate : function(){ return this.isSaleDate; }, getTravelDate : function(){ return this.travelDate; }, getCurrentDate : function(){ return this.currentDate; } }