function populateCities(c)
{
	c.add("ABZ", "GB", "", "Aberdeen", false);
c.add("CAK", "US", "OH", "Akron / Canton", true);
c.add("ALB", "US", "NY", "Albany International Airport", true);
c.add("ABQ", "US", "NM", "Albuquerque", true);
c.add("ALG", "DZ", "", "Alger", false);
c.add("ABE", "US", "PA", "Allentown / Bethlehem", true);
c.add("AMM", "JO", "", "Amman", false, "", "", "27/10/2007");
c.add("AMS", "NL", "", "Amsterdam", false);
c.add("ANC", "US", "AK", "Anchorage", true, "", "17/05/2007", "17/09/2007");
c.add("ANU", "AG", "", "Antigua", false, "", "24/02/2007", "10/02/2008");
c.add("AUA", "AW", "", "Aruba", false, "", "15/04/2007*", "14/12/2007*");
c.add("ATH", "GR", "", "Athens", false);
c.add("ATL", "US", "GA", "Atlanta", true);
c.add("AKL", "NZ", "", "Auckland", false);
c.add("AUS", "US", "TX", "Austin", true);
c.add("YBG", "CA", "QC", "Bagotville", true);
c.add("YBC", "CA", "QC", "Baie Comeau", true);
c.add("BWI", "US", "MD", "Baltimore", true);
c.add("BKK", "TH", "", "Bangkok", false);
c.add("BCN", "ES", "", "Barcelona", false);
c.add("BSL", "CH", "", "Basel", false, "", "14/03/2007*", "24/03/2007*");
c.add("ZBF", "CA", "NB", "Bathurst", true);
c.add("PEK", "CN", "", "Beijing", false);
c.add("BHD", "GB", "", "Belfast City", false);
c.add("TXL", "DE", "", "Berlin", false);
c.add("BDA", "BM", "", "Bermuda", false);
c.add("BIL", "US", "MT", "Billings", true);
c.add("BOG", "CO", "", "Bogota", false);
c.add("BOI", "US", "ID", "Boise", true);
c.add("BOS", "US", "MA", "Boston", true);
c.add("BRE", "DE", "", "Bremen", false);
c.add("BGI", "BB", "", "Bridgetown", false);
c.add("BNE", "AU", "", "Brisbane", false, "CALLRESERVATIONS");
c.add("BRU", "BE", "", "Brussels", false);
c.add("OTP", "RO", "", "Bucharest", false);
c.add("BUD", "HU", "", "Budapest", false);
c.add("EZE", "AR", "", "Buenos Aires", false);
c.add("BUF", "US", "NY", "Buffalo", true);
c.add("BUR", "US", "CA", "Burbank", true);
c.add("BTV", "US", "VT", "Burlington", true);
c.add("SJD", "MX", "", "San Jose Del Cabo", false);
c.add("CNS", "AU", "", "Cairns", false, "CALLRESERVATIONS", "", "06/02/2008");
c.add("YYC", "CA", "AB", "Calgary", true);
c.add("YBL", "CA", "BC", "Campbell River", true);
c.add("CUN", "MX", "", "Cancun", false);
c.add("CCS", "VE", "", "Caracas", false, "", "22/02/2007", "");
c.add("YCG", "CA", "BC", "Castlegar", true);
c.add("CTA", "IT", "", "Catania", false);
c.add("CCC", "CU", "", "Cayo Coco", false, "", "23/02/2007", "10/02/2008");
c.add("CYO", "CU", "", "Cayo Largo del Sur", false, "", "08/04/2007*", "21/12/2007*");
c.add("CID", "US", "IA", "Cedar Rapids", true);
c.add("CNX", "TH", "", "Chiang Mai", false, "", "", "27/10/2007");
c.add("CLT", "US", "NC", "Charlotte", true);
c.add("YYG", "CA", "PE", "Charlottetown", true);
c.add("YMT", "CA", "QC", "Chibougamau", true);
c.add("ORD", "US", "IL", "Chicago O'Hare", true);
c.add("CHC", "NZ", "", "Christchurch", false);
c.add("CVG", "US", "OH", "Cincinnati", true);
c.add("CLE", "US", "OH", "Cleveland Hopkins", true);
c.add("CGN", "DE", "", "Cologne", false);
c.add("COS", "US", "CO", "Colorado Springs", true);
c.add("CMH", "US", "OH", "Columbus", true);
c.add("YQQ", "CA", "BC", "Comox", true);
c.add("CPH", "DK", "", "Copenhagen Airport", false);
c.add("CZM", "MX", "", "Cozumel", false, "", "22/02/2007", "08/02/2008");
c.add("YXC", "CA", "BC", "Cranbrook", true);
c.add("DFW", "US", "TX", "Dallas International", true);
c.add("DAY", "US", "OH", "Dayton", true);
c.add("YDF", "CA", "NL", "Deer Lake", true);
c.add("DEL", "IN", "", "Delhi", false, "", "", "01/05/2007");
c.add("DEN", "US", "CO", "Denver", true);
c.add("DSM", "US", "IA", "Des Moines", true);
c.add("DTW", "US", "MI", "Detroit", true);
c.add("DRS", "DE", "", "Dresden", false);
c.add("DXB", "AE", "", "Dubai", false);
c.add("DUB", "IE", "", "Dublin", false, "", "15/06/2007", "30/09/2007");
c.add("DUS", "DE", "", "Düsseldorf", false);
c.add("EDI", "GB", "", "Edinburgh", false);
c.add("YEG", "CA", "AB", "Edmonton International", true);
c.add("EUG", "US", "OR", "Eugene", false);
c.add("RSW", "US", "FL", "Fort Myers", true, "", "30/04/2007*", "27/10/2007*");
c.add("FRA", "DE", "", "Frankfurt", false);
c.add("YFC", "CA", "NB", "Fredericton", true);
c.add("FAT", "US", "CA", "Fresno", true);
c.add("FLL", "US", "FL", "Fort Lauderdale", true);
c.add("YMM", "CA", "AB", "Fort McMurray", true);
c.add("YXJ", "CA", "BC", "Fort St John", true);
c.add("FUK", "JP", "", "Fukuoka", false);
c.add("YQX", "CA", "NL", "Gander", true);
c.add("YGP", "CA", "QC", "Gaspe", true);
c.add("GDN", "PL", "", "Gdansk", false);
c.add("GVA", "CH", "", "Geneva", false);
c.add("GLA", "GB", "", "Glasgow", false);
c.add("YYR", "CA", "NL", "Goose Bay", true);
c.add("GOT", "SE", "", "Gothenburg", false);
c.add("GCM", "KY", "", "Grand Cayman", false, "", "", "10/02/2008");
c.add("GRR", "US", "MI", "Grand Rapids", true);
c.add("YQU", "CA", "AB", "Grande Prairie", true);
c.add("GRZ", "AT", "", "Graz", false);
c.add("GSO", "US", "NC", "Greensboro / High Point", true);
c.add("GND", "GD", "", "Grenada", false, "", "02/04/2007*", "22/12/2007*");
c.add("GUA", "GT", "", "Guatemala City", false);
c.add("YHZ", "CA", "NS", "Halifax", true);
c.add("HAM", "DE", "", "Hamburg Fuhlsbuettel", false);
c.add("HAJ", "DE", "", "Hanover", false);
c.add("MDT", "US", "PA", "Harrisburg", true);
c.add("BDL", "US", "CT", "Hartford", true);
c.add("HAV", "CU", "", "Havana", false);
c.add("HEL", "FI", "", "Helsinki", false);
c.add("SGN", "VN", "", "Ho Chi Minh City", false);
c.add("HOG", "CU", "", "Holguin", false, "", "22/02/2007", "10/02/2008");
c.add("HKG", "HK", "", "Hong Kong", false);
c.add("HNL", "US", "HI", "Oahu / Honolulu", true);
c.add("IAH", "US", "TX", "Houston Intercontinental", true);
c.add("YGR", "CA", "QC", "Iles de la Madeleine", true);
c.add("IND", "US", "IN", "Indianapolis", true);
c.add("INN", "AT", "", "Innsbruck", false);
c.add("INV", "GB", "", "Inverness", false);
c.add("ZIH", "MX", "", "Ixtapa / Zihuatanejo", false, "", "26/08/2007*", "21/12/2007*");
c.add("JAX", "US", "FL", "Jacksonville", true);
c.add("YKA", "CA", "BC", "Kamloops", true);
c.add("MCI", "US", "MO", "Kansas City", true);
c.add("YLW", "CA", "BC", "Kelowna", true);
c.add("KBP", "UA", "", "Kiev", false);
c.add("YGK", "CA", "ON", "Kingston", true);
c.add("KIN", "JM", "", "Kingston Norman Manley", false, "", "", "07/02/2008");
c.add("KLU", "AT", "", "Klagenfurt", false);
c.add("KOA", "US", "HI", "Kona / Kailua", true);
c.add("KRK", "PL", "", "Krakow", false);
c.add("SUF", "IT", "", "Lamezia Terme", false);
c.add("LAS", "US", "NV", "Las Vegas", true);
c.add("LBA", "GB", "", "Leeds", false);
c.add("LEJ", "DE", "", "Leipzig", false);
c.add("YQL", "CA", "AB", "Lethbridge", true);
c.add("LIM", "PE", "", "Lima", false);
c.add("LNZ", "AT", "", "Linz", false);
c.add("LHR", "GB", "", "London Heathrow", false);
c.add("YXU", "CA", "ON", "London", true);
c.add("LAX", "US", "CA", "Los Angeles", true);
c.add("MAD", "ES", "", "Madrid", false);
c.add("MAN", "GB", "", "Manchester", false);
c.add("MHT", "US", "NH", "Manchester", true);
c.add("OGG", "US", "HI", "Maui / Kahului", true);
c.add("MDE", "CO", "", "Medellin", false, "", "22/02/2007", "31/03/2007");
c.add("YXH", "CA", "AB", "Medicine Hat", true);
c.add("MEL", "AU", "", "Melbourne", false, "CALLRESERVATIONS");
c.add("MEM", "US", "TN", "Memphis", true);
c.add("MEX", "MX", "", "Mexico City", false);
c.add("MIA", "US", "FL", "Miami", true);
c.add("MXP", "IT", "", "Milan Malpensa", false);
c.add("MKE", "US", "WI", "Milwaukee", true);
c.add("MSP", "US", "MN", "Minneapolis", true);
c.add("YQM", "CA", "NB", "Moncton", true);
c.add("YYY", "CA", "QC", "Mont Joli", true);
c.add("MBJ", "JM", "", "Montego Bay", false);
c.add("MRY", "US", "CA", "Monterey", true);
c.add("YUL", "CA", "QC", "Montreal Trudeau", true);
c.add("SVO", "RU", "", "Moscow Sheremetyevo", false);
c.add("BOM", "IN", "", "Mumbai", false);
c.add("MUC", "DE", "", "Munich", false);
c.add("NGO", "JP", "", "Nagoya", false);
c.add("YCD", "CA", "BC", "Nanaimo", true);
c.add("BNA", "US", "TN", "Nashville", true);
c.add("NAS", "BS", "", "Nassau", false);
c.add("MSY", "US", "LA", "New Orleans", true);
c.add("LGA", "US", "NY", "New York La Guardia", true);
c.add("EWR", "US", "NJ", "New York Newark", true);
c.add("JFK", "US", "NY", "New York Kennedy", true);
c.add("HPN", "US", "NY", "New York Westchester County", true);
c.add("YYB", "CA", "ON", "North Bay", true);
c.add("NUE", "DE", "", "Nuremberg", false);
c.add("OAK", "US", "CA", "Oakland", true);
c.add("OKA", "JP", "", "Okinawa Naha", false);
c.add("OKC", "US", "OK", "Oklahoma City", true);
c.add("OMA", "US", "NE", "Omaha", true);
c.add("ONT", "US", "CA", "Ontario", true);
c.add("MCO", "US", "FL", "Orlando", true);
c.add("KIX", "JP", "", "Osaka Kansai", false);
c.add("OSL", "NO", "", "Oslo Airport", false);
c.add("YOW", "CA", "ON", "Ottawa", true);
c.add("PMO", "IT", "", "Palermo", false);
c.add("PSP", "US", "CA", "Palm Springs", true);
c.add("PMI", "ES", "", "Palma", false);
c.add("CDG", "FR", "", "Paris Charles De Gaulle", false);
c.add("YYF", "CA", "BC", "Penticton", true);
c.add("PER", "AU", "", "Perth", false, "CALLRESERVATIONS");
c.add("PHL", "US", "PA", "Philadelphia", true);
c.add("PHX", "US", "AZ", "Phoenix", true);
c.add("HKT", "TH", "", "Phuket", false);
c.add("PIT", "US", "PA", "Pittsburgh", true);
c.add("PTP", "GP", "", "Pointe-à-Pitre", false, "", "22/02/2007", "09/02/2008");
c.add("PAP", "HT", "", "Port Au Prince", false, "", "27/02/2007", "");
c.add("POS", "TT", "", "Port Of Spain", false, "", "23/02/2007", "");
c.add("PDX", "US", "OR", "Portland", true);
c.add("POZ", "PL", "", "Poznan", false);
c.add("PRG", "CZ", "", "Prague", false);
c.add("YXS", "CA", "BC", "Prince George", true);
c.add("YPR", "CA", "BC", "Prince Rupert", true);
c.add("PVD", "US", "RI", "Providence", true);
c.add("PLS", "TC", "", "Providenciales", false, "", "22/04/2007*", "02/11/2007*");
c.add("POP", "DO", "", "Puerto Plata", false);
c.add("PVR", "MX", "", "Puerto Vallarta", false);
c.add("PUJ", "DO", "", "Punta Cana", false, "", "22/02/2007", "");
c.add("YQB", "CA", "QC", "Quebec City", true);
c.add("YQZ", "CA", "BC", "Quesnel", true);
c.add("RDU", "US", "NC", "Raleigh / Durham", true);
c.add("YQR", "CA", "SK", "Regina", true);
c.add("RNO", "US", "NV", "Reno", true);
c.add("RIC", "US", "VA", "Richmond", true);
c.add("YRJ", "CA", "QC", "Roberval", true);
c.add("ROC", "US", "NY", "Rochester", true);
c.add("FCO", "IT", "", "Rome Leonardo da Vinci", false);
c.add("YUY", "CA", "QC", "Rouyn-Noranda", true);
c.add("SMF", "US", "CA", "Sacramento International", true);
c.add("YSJ", "CA", "NB", "Saint John", true);
c.add("SLC", "US", "UT", "Salt Lake City", true);
c.add("SZG", "AT", "", "Salzburg", false);
c.add("SAT", "US", "TX", "San Antonio", true);
c.add("SAN", "US", "CA", "San Diego", true);
c.add("SFO", "US", "CA", "San Francisco", true);
c.add("SJC", "US", "CA", "San Jose", true);
c.add("SJO", "CR", "", "San José", false, "", "", "11/02/2008");
c.add("SJU", "PR", "", "San Juan Luis Munoz Marin", false, "", "23/04/2007*", "02/11/2007*");
c.add("SAL", "SV", "", "San Salvador", false);
c.add("YZP", "CA", "BC", "Sandspit", true);
c.add("SNA", "US", "CA", "Santa Ana / Orange County", true);
c.add("SBA", "US", "CA", "Santa Barbara", true);
c.add("SCL", "CL", "", "Santiago", false);
c.add("GRU", "BR", "", "Sao Paulo", false);
c.add("CTS", "JP", "", "Sapporo Chitose", false);
c.add("YZR", "CA", "ON", "Sarnia", true);
c.add("SRQ", "US", "FL", "Sarasota", true, "", "30/04/2007*", "02/11/2007*");
c.add("YXE", "CA", "SK", "Saskatoon", true);
c.add("YAM", "CA", "ON", "Sault Ste. Marie", true);
c.add("SAV", "US", "GA", "Savannah", true);
c.add("SEA", "US", "WA", "Seattle International", true);
c.add("ICN", "KR", "", "Seoul Inchon", false);
c.add("YZV", "CA", "QC", "Sept-Îles", true);
c.add("PVG", "CN", "", "Shanghai Pu Dong", false);
c.add("SNN", "IE", "", "Shannon", false, "", "16/06/2007", "30/09/2007");
c.add("SIN", "SG", "", "Singapore Changi", false);
c.add("YYD", "CA", "BC", "Smithers", true);
c.add("GEG", "US", "WA", "Spokane", true);
c.add("YYT", "CA", "NL", "St Johns", true);
c.add("STL", "US", "MO", "St Louis", true);
c.add("UVF", "LC", "", "St Lucia Hewanorra", false, "", "24/02/2007", "11/02/2008");
c.add("SXM", "AN", "", "St Maarten", false, "", "22/04/2007*", "14/12/2007*");
c.add("LED", "RU", "", "St Petersburg", false);
c.add("SVG", "NO", "", "Stavanger", false);
c.add("ARN", "SE", "", "Stockholm", false);
c.add("STR", "DE", "", "Stuttgart", false);
c.add("YSB", "CA", "ON", "Sudbury", true);
c.add("YQY", "CA", "NS", "Sydney", true);
c.add("SYD", "AU", "", "Sydney Kingsford", false);
c.add("SYR", "US", "NY", "Syracuse", true);
c.add("TPE", "TW", "", "Taipei", false, "", "", "27/10/2007");
c.add("TPA", "US", "FL", "Tampa", true);
c.add("MME", "GB", "", "Teesside", false);
c.add("TLV", "IL", "", "Tel Aviv", false);
c.add("YXT", "CA", "BC", "Terrace", true);
c.add("YQT", "CA", "ON", "Thunder Bay", true);
c.add("YTS", "CA", "ON", "Timmins", true);
c.add("HND", "JP", "", "Tokyo Haneda", false);
c.add("NRT", "JP", "", "Tokyo Narita", false);
c.add("YYZ", "CA", "ON", "Toronto Pearson", true);
c.add("TRN", "IT", "", "Turin", false);
c.add("YHM", "CA", "ON", "Hamilton - 80km from Toronto", true);
c.add("TUS", "US", "AZ", "Tucson", true);
c.add("TUL", "US", "OK", "Tulsa", true);
c.add("YVO", "CA", "QC", "Val d Or", true);
c.add("YVR", "CA", "BC", "Vancouver", true);
c.add("YXX", "CA", "BC", "Abbotsford - 74km from Vancouver", true);
c.add("VRA", "CU", "", "Varadero", false, "", "22/02/2007", "11/02/2008");
c.add("VCE", "IT", "", "Venice Marco Polo", false);
c.add("YYJ", "CA", "BC", "Victoria", true);
c.add("VIE", "AT", "", "Vienna", false);
c.add("YWK", "CA", "NL", "Wabush", true);
c.add("WAW", "PL", "", "Warsaw", false);
c.add("IAD", "US", "DC", "Washington Dulles", true);
c.add("DCA", "US", "DC", "Washington National", true);
c.add("WLG", "NZ", "", "Wellington", false);
c.add("PBI", "US", "FL", "West Palm Beach", true, "", "30/04/2007*", "27/10/2007*");
c.add("YXY", "CA", "YT", "Whitehorse", true);
c.add("ICT", "US", "KS", "Wichita", true);
c.add("YWL", "CA", "BC", "Williams Lake", true);
c.add("YQG", "CA", "ON", "Windsor", true);
c.add("YWG", "CA", "MB", "Winnipeg", true);
c.add("WRO", "PL", "", "Wroclaw", false);
c.add("YZF", "CA", "NT", "Yellowknife", true);
c.add("ZRH", "CH", "", "Zurich", false);
}
var subtitutionsList;
function initSubtitutesList(){
	 subtitutionsList = new Array();

	 var steSub = new Subtitution("ste. ");
	 steSub.replacementStrings = new Array("ste ","ste-","ste- ","sainte","sainte-");
	 subtitutionsList.push(steSub);

	 var stSub = new Subtitution("st. ");
	 stSub.replacementStrings = new Array( "st ","st-","sai","sain","saint","saint-");
	 subtitutionsList.push(stSub);

	 var ftSub = new Subtitution("ft. ");
	 ftSub.replacementStrings = new Array( "ft ","ft-","for","fort","fort-");
	 subtitutionsList.push(ftSub);

	 var mtlSub = new Subtitution("Montreal");
	 mtlSub.replacementStrings = new Array( "mtl","dorval");
	 subtitutionsList.push(mtlSub);

}
initSubtitutesList();
function cleanUpAbreviation(userParam){
	var cpt=0;
	for(cpt=0;cpt<subtitutionsList.length;cpt++){userParam=subtitutionsList[cpt].getSubtitute(userParam.toLowerCase());}
	return  userParam;
}

function Subtitution(dataAbbreviation){
	this.abbreviation = dataAbbreviation;
	this.replacementStrings;
}

Subtitution.prototype.getSubtitute = function(stringToSubtitute){
	var cpt=0;
	var cleanedString="";
	var abrvLength=0;
	for(cpt=0;cpt<this.replacementStrings.length;cpt++){
		if(stringToSubtitute.toLowerCase().indexOf(this.replacementStrings[cpt].toLowerCase())!=-1 && this.replacementStrings[cpt].length>abrvLength){
			cleanedString=stringToSubtitute.replace(this.replacementStrings[cpt],this.abbreviation);
			abrvLength=this.replacementStrings[cpt].length;
		}
	}
	return cleanedString==""?stringToSubtitute:cleanedString;
}

function MessagesList()
{
	this.errorMessages = new Array();
	this.messages =
	{
		AMBIGUOUS:"There is more than one airport matching the city you requested. Please select one of the city in the list to continue.", 
BADBOTHDATES:"Flights to/from {CITYNAME} may only be booked at aircanada.com between {STARTDATE} and {ENDDATE}.<br><br>For any other dates, please call <a href='http://www.aircanada.com/en/customercare/reservation_na.html'>Air Canada Reservations</a> to check if one of our Star Alliance partners serves this route (no service fee applies).", 
BADENDDATE:"Currently, flights to/from {CITYNAME} may not be booked at aircanada.com after {ENDDATE}.<br><br>If you need to travel after this date, please call <a href='http://www.aircanada.com/en/customercare/reservation_na.html'>Air Canada Reservations</a> to check if one of our Star Alliance partners serves this route (no service fee applies).", 
BADSTARTDATE:"Flights to/from {CITYNAME} will be available for booking at aircanada.com starting on {STARTDATE}.<br><br>For any other dates, please call <a href='http://www.aircanada.com/en/customercare/reservation_na.html'>Air Canada Reservations</a> to check if one of our Star Alliance partners serves this route (no service fee applies).", 
BOTHUSA:"There are no flights scheduled between two USA airports.", 
CALLRESERVATIONS:"Reservations to/from {CITYNAME} can only be completed by calling <a href='http://www.aircanada.com/en/customercare/reservation_na.html'>Air Canada Reservations</a>.", 
EXCLUDEDDATES:"Flights to/from {CITYNAME} are not available for booking at aircanada.com between {STARTDATE} and {ENDDATE}.<br><br>If you need to travel during these dates, please call <a href='http://www.aircanada.com/en/customercare/reservation_na.html'>Air Canada Reservations</a> to check if one of our Star Alliance partners serves this route (no service fee applies).", 
NBINFANTS:"Only one infant per adult is permitted.", 
NBPASSENGERS:"Adults/Children.en:The total number of passengers per reservation cannot exceed 9. Please review number of adults or children. If your booking is for more than 9 passengers, please call <a href='http://www.aircanada.com/en/customercare/reservation_na.html'>Air Canada Reservations</a>.", 
NOFLIGHTS:"We were unable to find the flights you requested. Please try alternate dates or if the option is available, select 'I am flexible with my dates'. Please check our <a href='http://www.aircanada.com/en/travelinfo/traveller/timetables/index.html'>Online Timetable</a> for more information on flight schedules.<br><br>Also, some routes are not offered through aircanada.com, even though one of our Star Alliance partners may fly there. Many of these routes can be booked by calling <a href='http://www.aircanada.com/en/customercare/reservation_na.html'>Air Canada Reservations</a> (no service fee applies).", 
NORESULTSDESTINATION:"There are no results for the search on the destination airport.", 
NORESULTSORIGIN:"There are no results for the search on the departure airport.", 
PROMOTIONCODEERROR:"The promotion code entered doesn't exist or is expired. Make sure your promotion code is entered correctly.", 
PROMOTIONCODEINFANTSERROR:"Infants are not allowed with a promotion code. Please correct by selecting either infants or by entering a promotion code.", 
SAMEAIRPORTS:"The airports of departure and arrival are the same. Please modify your entry and try again.", 
USACUBA:"There are no flights scheduled between any USA and Cuba airports.", 
WRONGDATES:"The date of return should not precede the departure  date."

	};
}
var mP =  MessagesList.prototype;
mP.getMessage = function(messageName,airport){
	if(this.messages[messageName] != null && airport!=null){
		var oriMsgCus=this.messages[messageName];
		if(oriMsgCus.indexOf("{CITYNAME}")!=-1)
			oriMsgCus=oriMsgCus.replace("{CITYNAME}",airport.name);
		if(oriMsgCus.indexOf("{STARTDATE}")!=-1)
			oriMsgCus=oriMsgCus.replace("{STARTDATE}",getFullNamedDate(airport.startDate.replace(/\*/,'')));
		if(oriMsgCus.indexOf("{ENDDATE}")!=-1)
			oriMsgCus=oriMsgCus.replace("{ENDDATE}",getFullNamedDate(airport.endDate.replace(/\*/,'')));
		return oriMsgCus;
	}
	else if(this.messages[messageName] != null) return this.messages[messageName];
	else return null;
}
mP.addMessage = function(messageName,airport){
    this.errorMessages.push(this.getMessage(messageName,airport));
}
mP.addLitteralMessage = function(message){
    this.errorMessages.push(message);
}
mP.isMessageAlreadyPresent = function(messageName){
    for(var cpt = 0;cpt < this.errorMessages.length;cpt++){
        if(this.errorMessages[cpt] ==  this.messages[messageName]) return true;
    }
    return false;
}
mP.removeMessage = function(messageName){
	var needAnotherPass = false;
	for(var cpt = 0;cpt < this.errorMessages.length;cpt++){
		if(this.errorMessages[cpt] ==  this.messages[messageName]){
			this.errorMessages.splice(cpt, 1);
			needAnotherPass = true;
			break;
		}
	}
	if(needAnotherPass)this.removeMessage(messageName);
}

function CountriesList()
{
this.countries =
{
TK:"Tokelau", 
TJ:"Tajikistan", 
TH:"Thailand", 
TG:"Togo", 
TF:"French Southern Territories", 
GY:"Guyana", 
TD:"Chad", 
GW:"Guinea Bissau", 
TC:"Turks And Caicos Islands", 
GU:"Guam", 
GT:"Guatemala", 
GS:"South Georgia & Sandwich Islands", 
GR:"Greece", 
GQ:"Equatorial Guinea", 
GP:"Guadeloupe", 
SZ:"Swaziland", 
GN:"Guinea", 
SY:"Syrian Arab Republic", 
GM:"Gambia", 
GL:"Greenland", 
SV:"El Salvador", 
GI:"Gibraltar", 
ST:"Sao Tome and Principe", 
GH:"Ghana", 
SR:"Suriname", 
GF:"French Guyana", 
GE:"Georgia", 
GD:"Grenada", 
SO:"Somalia", 
SN:"Senegal", 
GB:"United Kingdom", 
SM:"San Marino", 
GA:"Gabon", 
SL:"Sierra Leone", 
SK:"Slovakia", 
SJ:"Svalbard & Jan Mayen Island", 
SI:"Slovenia", 
SH:"St. Helena", 
SG:"Singapore", 
SE:"Sweden", 
SD:"Sudan", 
SC:"Seychelles", 
SB:"Solomon Islands", 
SA:"Saudi Arabia", 
FR:"France", 
FO:"Faroe Islands", 
FM:"Micronesia", 
RW:"Rwanda", 
FK:"Falkland Islands", 
FJ:"Fiji", 
RU:"Russia", 
FI:"Finland", 
RO:"Romania", 
RE:"Reunion Island", 
ET:"Ethiopia", 
ES:"Spain and Canary Islands", 
ER:"Eritrea", 
EG:"Egypt", 
EE:"Estonia", 
EC:"Ecuador", 
DZ:"Algeria", 
QA:"Qatar", 
DO:"Dominican Republic", 
PY:"Paraguay", 
DM:"Dominica", 
PW:"Palau", 
DK:"Denmark", 
DJ:"Djibouti", 
PT:"Portugal", 
PR:"Puerto Rico", 
DE:"Germany", 
PN:"Pitcairn Island", 
PM:"St. Pierre and Miquelon", 
PL:"Poland", 
PK:"Pakistan", 
PH:"Philippines", 
PG:"Papua New Guinea", 
CZ:"Czech Republic", 
PF:"French Polynesia", 
CY:"Cyprus", 
PE:"Peru", 
CX:"Christmas Island (Indian Ocean)", 
CV:"Cape Verde", 
CU:"Cuba", 
PA:"Panama", 
CR:"Costa Rica", 
CO:"Colombia", 
CN:"China", 
CM:"Cameroon", 
CL:"Chile", 
CK:"Cook Islands", 
CI:"Ivory coast", 
CH:"Switzerland", 
CG:"Congo", 
CF:"Central African Republic", 
CD:"Democratic Republic of Congo", 
CC:"Cocos (Keeling) Island", 
OM:"Oman", 
CA:"Canada", 
BZ:"Belize", 
BY:"Belarus", 
BW:"Botswana", 
BV:"Bouvet Islands", 
BT:"Bhutan", 
BS:"Bahamas", 
BR:"Brazil", 
BO:"Bolivia", 
NZ:"New Zealand", 
BN:"Brunei", 
BM:"Bermuda", 
BJ:"Benin", 
NU:"Niue", 
BI:"Burundi", 
BH:"Bahrain", 
BG:"Bulgaria", 
NR:"Nauru", 
BF:"Burkina Faso", 
BE:"Belgium", 
NP:"Nepal", 
BD:"Bangladesh", 
NO:"Norway", 
BB:"Barbados", 
BA:"Bosnia-Herzegovina", 
NL:"Netherlands", 
NI:"Nicaragua", 
NG:"Nigeria", 
AZ:"Azerbaijan", 
NF:"Norfolk Island", 
NE:"Niger", 
AW:"Aruba", 
NC:"New caledonia", 
AU:"Australia", 
NA:"Namibia", 
AT:"Austria", 
AS:"American Samoa", 
AR:"Argentina", 
AQ:"Antarctica", 
AO:"Angola", 
MZ:"Mozambique", 
AN:"Netherlands Antilles", 
MY:"Malaysia", 
AM:"Armenia", 
MX:"Mexico", 
AL:"Albania", 
MW:"Malawi", 
MV:"Maldives", 
MU:"Mauritius", 
ZA:"South Africa", 
AI:"Anguilla", 
MT:"Malta", 
MS:"Montserrat", 
AG:"Antigua and Barbuda", 
MR:"Mauritania", 
AF:"Afghanistan", 
MQ:"Martinique", 
AE:"United Arab Emirates", 
MP:"Northern Mariana Islands", 
AD:"Andorra", 
MO:"Macau", 
MN:"Mongolia", 
MM:"Myanmar", 
ML:"Mali", 
MK:"Macedonia", 
YT:"Mayotte", 
MH:"Marshall Islands", 
MG:"Madagascar", 
MD:"Moldova", 
MC:"Monaco", 
MA:"Morroco", 
LY:"Libya", 
LV:"Latvia", 
LU:"Luxemburg", 
LT:"Lithuania", 
LS:"Lesotho", 
LR:"Liberia", 
LK:"Sri Lanka", 
LI:"Liechtenstein", 
LC:"Saint Lucia", 
LB:"Lebanon", 
LA:"Laos", 
KZ:"Kazakhstan", 
KY:"Cayman Islands", 
KW:"Kuwait", 
KR:"Republic of Korea (South Korea)", 
KP:"Dem.People's Rep.(North Korea)", 
KN:"St. Kitts and Nevis", 
KM:"Comoros", 
KI:"Kiribati", 
KH:"Cambodia", 
WS:"Samoa", 
KG:"Kyrgyzstan", 
KE:"Kenya", 
JP:"Japan", 
JO:"Jordan", 
JM:"Jamaica", 
VU:"Vanuatu", 
VN:"Vietnam", 
VI:"Us Virgin Islands", 
VG:"British Virgin Islands", 
VE:"Venezuela", 
VC:"St. Vincent and the Grenadines", 
VA:"Vatican City State", 
IT:"Italy", 
IS:"Iceland", 
IR:"Islamic Republic Of Iran", 
IQ:"Iraq", 
IO:"British Indian Ocean Territory", 
UZ:"Uzbekistan", 
IN:"India", 
UY:"Uruguay", 
IL:"Israel", 
US:"Usa", 
IE:"Ireland", 
ID:"Indonesia", 
UM:"United States Minor Outlying Island", 
UK:"United Kingdom", 
UG:"Uganda", 
HU:"Hungary", 
UA:"Ukraine", 
HT:"Haiti", 
HR:"Croatia", 
TZ:"Tanzania", 
HN:"Honduras", 
HM:"Heard And McDonald Islands", 
TW:"Taiwan", 
HK:"Hong kong", 
TV:"Tuvalu", 
TT:"Trinidad And Tobago", 
TR:"Turkey", 
TP:"East Timor", 
TO:"Tonga", 
TN:"Tunisia", 
TM:"Turkmenistan" 

};
}


function StatesList()
{
this.states =
{
MO:"Missouri", 
MN:"Minnesota", 
VT:"Vermont", 
YT:"Yukon", 
DE:"Delaware", 
AB:"Alberta", 
DC:"Washington, DC", 
MI:"Michigan", 
SK:"Saskatchewan", 
GA:"Georgia", 
ME:"Maine", 
MD:"Maryland", 
PE:"Prince Edward Is.", 
MB:"Manitoba", 
MA:"Massachusetts", 
SD:"South Dakota", 
PA:"Pennsylvania", 
SC:"South Carolina", 
CT:"Connecticut", 
VA:"Virginia", 
CO:"Colorado", 
FL:"Florida", 
IN:"Indiana", 
OR:"Oregon", 
IL:"Illinois", 
UT:"Utah", 
ON:"Ontario", 
OK:"Oklahoma", 
CA:"California", 
ID:"Idaho", 
OH:"Ohio", 
RI:"Rhode Island", 
IA:"Iowa", 
LA:"Louisiana", 
KY:"Kentucky", 
NY:"New York", 
NV:"Nevada", 
KS:"Kansas", 
NU:"Nunavut", 
NT:"North West Terr.", 
TX:"Texas", 
NS:"Nova Scotia", 
WY:"Wyoming", 
WV:"West Virginia", 
HI:"Hawaii", 
NM:"New Mexico", 
NL:"Newfoundland", 
BC:"British Columbia", 
NJ:"New Jersey", 
TN:"Tennessee", 
NH:"New Hampshire", 
NE:"Nebraska", 
ND:"North Dakota", 
AZ:"Arizona", 
NC:"North Carolina", 
WI:"Wisconsin", 
NB:"New Brunswick", 
QC:"Quebec", 
AR:"Arkansas", 
WA:"Washington", 
AL:"Alabama", 
MT:"Montana", 
AK:"Alaska", 
MS:"Mississippi" 

};
}

function getFullNamedDate(date){
    //   from  "06/05/2006"  to   May 6, 2006
    var monthNames = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
    var dateArr = date.split("/");
    return monthNames[Number(dateArr[1])-1] +" "+dateArr[0]+", "+dateArr[2];
}


