// JavaScript Document
function FillAirline(SiteID,thisObj)
{
	var AirCode,AirName;
	var obj=document.getElementById(thisObj);
	if(SiteID==1)
		{
		AirCode="ALL/SU/AF/AI/KM/NZ/W3/0Z/BG/BD/BA/CX/CI/CO/DL/EK/ET/EY/BR/AY/GF/JL/9W/IT/KL/KU/LH/MH/W5/QF/QR/WY";
		AirName="Any Airline/Aeroflot/Air France/Air India/Air Malta/Air New Zealand/Arik Air International/Asiana Airlines/Biman Airlines/BMI Airline/British Airways/Cathay Pacific/China Airways/Continental Airlines/Delta Airways/Emirates Air/Ethiopian/Etihad Airways/EVA Airways/Finnair/Gulf Air/Japan Airways/Jet Airways/Kingfisher Airlines/KLM Royal Dutch/Kuwait Airways/Lufthansa Airline/Malaysian Airlines/Mahan Airlines/Qantas Airline/Qatar Airways/Oman Air";
		}
		else if(SiteID=="4")
		{
		AirCode="ALL/EK/EY/GF/KU/WY/QR/HY";
		AirName="Any Airline/Emirates/Etihad Airways/Gulf Air/Kuwait Airways/Oman Air/Qatar Airways/Uzbekistan Airways"
		}
		else if(SiteID=="5")
		{
		AirCode="ALL";
		AirName="Any Airline"
		}
		else if(SiteID=="6" || SiteID=="7" || SiteID=="8"  || SiteID=="88"  || SiteID=="888" || SiteID=="9" || SiteID=="10" || SiteID=="11" || SiteID=="12" || SiteID=="13" || SiteID=="14" || SiteID=="15" || SiteID=="16" || SiteID=="17" || SiteID=="18")
		{
		AirCode="ALL/SU/AF/AI/KM/NZ/W3/0Z/BG/BD/BA/CX/CI/CO/DL/EK/ET/EY/BR/AY/GF/JL/9W/IT/KL/KU/LH/MH/W5/QF/QR/WY/BI/RJ/SK/SQ/SA/UL/LX/TP/TG/US/VS";
		AirName="Any Airline/Aeroflot/Air France/Air India/Air Malta/Air New Zealand/Arik Air International/Asiana Airlines/Biman Airlines/BMI Airline/British Airways/Cathay Pacific/China Airways/Continental Airlines/Delta Airways/Emirates Air/Ethiopian/Etihad Airways/EVA Airways/Finnair/Gulf Air/Japan Airways /Jet Airways/Kingfisher Airlines/KLM Royal Dutch/Kuwait Airways/Lufthansa Airline/Malaysian Airlines/Mahan Airlines/Qantas Airline/Qatar Airways/Oman Air/Royal Brunei/Royal Jordan/Scandinavian Airlines/Singapore Airways/South African/Srilankan Airlines/Swiss Airline/Tap Portugal/Thai Airways/US Airways/Virgin Atlantic"
		}
		else
		{
		AirCode="ALL/SU/AC/AF/AI/KM/NZ/W3/BG/BD/BA/CX/CI/MU/CO/DL/EK/ET/EY/BR/AY/GF/JL/9W/IT/KL/KU/LH/MH/W5/QF/QR/WY/BI/RJ/SK/SQ/SA/UL/LX/TP/TG/UA/US/VS";
		AirName="Any Airline/Aeroflot/Air Canada/Air France/Air India/Air Malta/Air New Zealand/Arik Air International/Biman Airlines/BMI Airline/British Airways/Cathay Pacific/China Airways/China Eastern/Continental Airlines/Delta Airways/Emirates Air/Ethiopian/Etihad Airways/EVA Airways/Finnair/Gulf Air/Japan Airways /Jet Airways/Kingfisher Airlines/KLM Royal Dutch/Kuwait Airways/Lufthansa Airline/Malaysian Airlines/Mahan Airlines/Qantas Airline/Qatar Airways/Oman Air/Royal Brunei/Royal Jordan/Scandinavian Airlines/Singapore Airways/South African/Srilankan Airlines/Swiss Airline/Tap Portugal/Thai Airways/United Airlines/US Airways/Virgin Atlantic"
		}
	 ShowAirport(obj,AirCode,AirName);
}
function FillDestFrom(SiteID,thisObj)
{
	var obj=document.getElementById(thisObj);
	if(SiteID=="1")
	{
	 DestFromCode="LON/LCY/LGW/LHR/STN/LTN/ABZ/BHX/BRS/BFS/CWL/ORK/DUB/DND/MME/EDI/EMA/EXT/GLA/HUY/JER/LBA/LPL/MAN/NCL/NWI/SOU"
	 DestFromValues="London All/London City/London Gatwick/London Heathrow/London Stansted/London Luton/Aberdeen/Birmingham/Bristol/BelFast/Cardiff/Cork/Dublin/Dundee/Durham Tees Valley/Edinburgh/Eastmidlands/Exeter/Glasgow/Humberside/Jersey/Leeds(Bradford)/Liverpool/Manchester/New Castle/Norwich/Southampton"
	}
	else if(SiteID=="3")
	{
		
		 DestFromCode="LON/LGW/LHR/BFS/BHX/EMA/EDI/LBA/LPL/MAN/NCL"
		 DestFromValues="London All/London Gatwick/London Heathrow/BelFast/Birmingham/Eastmidlands/Edinburgh/Leeds/Liverpool/Manchester/New Castle"
	}
	else if(SiteID=="4")
	{
		 DestFromCode="LON/LHR/LGW/MAN/BHX/ABZ/GLA/LTN";
		 DestFromValues="London All/London Heathrow/London Gatwick/Manchester/Birmingham/Aberdeen/Glasgow/New Castle";
	}
	else if(SiteID=="5")
	{
		DestFromCode="LON/LGW/LTN/LHR/EMA/MAN/LPL/GIB";
		DestFromValues="London All/London Gatwick/London Luton/London Heathrow/East Midlands/Manchester/Liverpool/Gibraltar";
	}
	else if(SiteID=="6")
	{
		DestFromCode="LON/LGW/LHR/BFS/BHX/BRS/EMA/EDI/LBA/LPL/MAN";
		DestFromValues="London All/London Gatwick/London Heathrow/Belfast/Birmingham/Bristol/East Midland/Edinburgh/Leeds(Bradford)/Liverpool/Manchester";
	}
	else if(SiteID=="7")
	{
		DestFromCode="LON/LCY/LGW/LHR/LTN/ABZ/BHX/BRS/CWL/EDI/MAN/LBA/BFS/NCL/GLA";
		DestFromValues="London All/London City/London Gatwick/London Heathrow/London Luton/Aberdeen/Birmingham/Bristol/Cardiff/Edinburgh/Manchester/Leeds(Bradford)/Belfast Intl/Newcastle/Glasgow";
	}
	else if(SiteID=="8" || SiteID=="88" || SiteID=="888")
	{
		DestFromCode="LON/LCY/LGW/LHR/STN/LTN/ABZ/BHX/BRS/EMA/EDI/MAN/LBA/NCL/BFS/LPL";
		DestFromValues="London All/London City/London Gatwick/London Heathrow/London Stansted/London Luton/Aberdeen/Birmingham/Bristol/East Midlands/Edinburgh/Manchester/Leeds(Bradford)/New Castle/Belfast Intl/Liverpool";
	}
	else if(SiteID=="9")
	{
		DestFromCode="LON/LCY/LGW/LHR/STN/LTN/ABZ/BHD/BFS/BHX/BRS/CWL/DND/MME/EMA/EDI/EXT/GLA/HUY/MAN/JER/LBA/NCL/NWI/LPL/SOU";
		DestFromValues="London All/London City/London Gatwick/London Heathrow/London Stansted/London Luton/Aberdeen/Belfast City/Belfast Intl/Birmingham/Bristol/Cardiff/Dundee/Durham Tees Valley/East Midlands/Edinburgh/Exeter/Glasgow/Humberside/Manchester/Jersey/Leeds(Bradford)/New Castle/Norwich/Liverpool/Southampton";
	}
	else if(SiteID=="10")
	{
		DestFromCode="LON/LCY/LGW/LHR/STN/LTN/BHX/BRS/EMA/EDI/GLA/MAN/LBA/BFS/LPL";
		DestFromValues="London All/London City/London Gatwick/London Heathrow/London Stansted/London Luton/Birmingham/Bristol/East Midlands/Edinburgh/Glasgow/Manchester/Leeds(Bradford)/Belfast Intl/Liverpool";
	}
	else if(SiteID=="11")
	{
		DestFromCode="LON/LHR/LGW/LTN/STN/ABZ/BHX/BRS/EDI/GLA/HUY/LPL/MAN/NCL/NWI";
		DestFromValues="London All/London Heathrow/London Gatwick/London Luton/London Stansted/Aberdeen/Birmingham/Bristol/Edinburgh/Glasgow/Humberside/Liverpool/Manchester/Newcastle/Norwich";
	}
	else if(SiteID=="12")
	{
		DestFromCode="LON/LCY/LGW/LHR/STN/LTN/ABZ/BHX/BRS/EMA/GLA/MAN/NCL/LPL";
		DestFromValues="London All/London City/London Gatwick/London Heathrow/London Stansted/London Luton/Aberdeen/Birmingham/Bristol/East Midlands/Glasgow/Manchester/New Castle/Liverpool";
	}
	else if(SiteID=="13")
	{
		DestFromCode="LON/LCY/LGW/LHR/STN/LTN/BHX/BRS/EDI/GLA/LBA/MAN";
		DestFromValues="London All/London City/London Gatwick/London Heathrow/London Stansted/London Luton/Birmingham/Bristol/Edinburgh/Glasgow/Leeds(Bradford)/Manchester";
	}
	else if(SiteID=="14")
	{
		DestFromCode="LON/LCY/LGW/LHR/STN/LTN/ABZ/BFS/BHX/BRS/DSA/EDI/EMA/GLA/LBA/LPL/MAN/NCL";
		DestFromValues="London All/London City/London Gatwick/London Heathrow/London Stansted/London Luton/Aberdeen/BelFast/Birmingham/Bristol/Doncaster Sheffield/Edinburgh/East Midlands/Glasgow/Leeds(Bradford)/Liverpool/Manchester/Newcastle";
	}
	else if(SiteID=="15")
	{
		DestFromCode="LON/LCY/LGW/LHR/STN/LTN/ABZ/BHX/BRS/EMA/EDI/GLA/MAN/LBA/MME";
		DestFromValues="London All/London City/London Gatwick/London Heathrow/London Stansted/London Luton/Aberdeen/Birmingham/Bristol/East Midlands/Edinburgh/Glasgow/Manchester/Leeds(Bradford)/Tees-side";
	}
	else if(SiteID=="16")
	{
		DestFromCode="LON/LCY/LGW/LHR/STN/LTN/ABZ/BHX/BRS/EMA/EDI/GLA/MAN/LBA/NCL/BFS";
		DestFromValues="London All/London City/London Gatwick/London Heathrow/London Stansted/London Luton/Aberdeen/Birmingham/Bristol/East Midlands/Edinburgh/Glasgow/Manchester/Leeds(Bradford)/New Castle/Belfast Intl";
	}
	else if(SiteID=="17")
	{
		DestFromCode="LON/LCY/LGW/LHR/STN/LTN/BHX/BRS/EDI/GLA/LBA/MAN/LPL";
		DestFromValues="London All/London City/London Gatwick/London Heathrow/London Stansted/London Luton/Birmingham/Bristol/Edinburgh/Glasgow/Leeds(Bradford)/Manchester/Liverpool";
	}
	else if(SiteID=="18")
	{
		DestFromCode="LON/LCY/LGW/LHR/STN/ABZ/BHX/BRS/EDI/GLA/MAN/NCL";
		DestFromValues="London All/London City/London Gatwick/London Heathrow/London Stansted/Aberdeen/Birmingham/Bristol/Edinburgh/Glasgow/Manchester/New Castle";
	}
		ShowAirport(obj,DestFromCode,DestFromValues);
}

function FillDestTo(SiteID,test)
{
	var obj=document.getElementById(test);
	if(SiteID=="1")
	{
	 DestFromCode="AMS"
	 DestFromValues="Amsterdam"
	}
	else if(SiteID=="3")
	{
	 DestFromCode="MLA"
	 DestFromValues="Malta"
	}
	else if(SiteID=="4")
	{
		 DestFromCode="LHE/ISB/KHI/PEW";
		 DestFromValues="Lahore/Islamabad/Karachi/Peshawar";
	}
	else if(SiteID=="5")
	{
		DestFromCode="GIB";
		DestFromValues="Gibraltar";
	}
	else if(SiteID=="6")
	{
		DestFromCode="VCE";
		DestFromValues="Venice";
	}
	else if(SiteID=="7")
	{
		DestFromCode="ROM";
		DestFromValues="Rome";
	}
	else if(SiteID=="8"  || SiteID=="88"  || SiteID=="888")
	{
	    DestFromCode="PRG";
		DestFromValues="Prague";
	}
	
	else if(SiteID=="9")
	{
	    DestFromCode="PAR";
		DestFromValues="Paris";
	}
	else if(SiteID=="10")
	{
	    DestFromCode="IST";
		DestFromValues="Istanbul";
	}
	else if(SiteID=="11")
	{
	 DestFromCode="MIL";
		DestFromValues="Milan";
	}
	else if(SiteID=="12")
	{
	    DestFromCode="RIX";
		DestFromValues="Riga";
	}
	else if(SiteID=="13")
	{
	    DestFromCode="BUD";
		DestFromValues="Budapest";
	}
	else if(SiteID=="14")
	{
	    DestFromCode="BCN";
		DestFromValues="Barcelona";
	}
	else if(SiteID=="15")
	{
	    DestFromCode="ZRH";
		DestFromValues="Zurich";
	}
	else if(SiteID=="16")
	{
	    DestFromCode="NYC";
		DestFromValues="New York";
	}
	else if(SiteID=="17")
	{
	    DestFromCode="BER";
		DestFromValues="Berlin";
	}
	else if(SiteID=="18")
	{
	    DestFromCode="DXB";
		DestFromValues="Dubai";
	}
	 ShowAirport(obj,DestFromCode,DestFromValues);
}

function getCityAeraCode(val)
{
	var DestCode,DestValues;
	
	if(parseInt(val.search(/\(MLA/i),10)>-1 || parseInt(val.search(/MALTA/i),10)>-1 || val.toUpperCase()=="MLA")
	{
DestCode="ALL/MLA1,Attard/MLA2,Bugibba/MLA3,Golden Bay/MLA4,Gozo/MLA5,Mellieha/MLA6,Qawra/MLA7,St. Julians/MLA8,Sliema/MLA9,St. Pauls Bay/MLA10,Valletta/ALL";
	DestValues="Select location/Attard/Bugibba/Golden Bay/Gozo/Mellieha/Qawra/St. Julians/Sliema/St. Pauls Bay/Valletta/All location";
	}
	else if(parseInt(val.search(/\(NYC/i),10)>-1 || parseInt(val.search(/New York/i),10)>-1 || val.toUpperCase()=="NYC")
	{
	DestCode="ALL/NYC1,Brooklyn/NYC2,Manhattan/NYC3,Midtown East Side/NYC4,Times Square - Broadway/NYC5,Upper East Side/NYC6,Upper West Side/NYC7,Wall Street - Financial District/ALL"
	DestValues="Select location/Brooklyn/Manhattan/Midtown East Side/Times Square - Broadway/Upper East Side/Upper West Side/Wall Street - Financial District/All location"
	}
	else
	{
	DestCode="ALL"
	DestValues="All location"
	}
	 ShowAirport(document.getElementById("CityAera"),DestCode,DestValues);
}
function FillCityAera(SiteID,Obj)
{
	var objId=document.getElementById(Obj);
	if(parseInt(SiteID,10)==3)
	{
	DestCode="ALL/MLA1,Attard/MLA2,Bugibba/MLA3,Golden Bay/MLA4,Gozo/MLA5,Mellieha/MLA6,Qawra/MLA7,St. Julians/MLA8,Sliema/MLA9,St. Pauls Bay/MLA10,Valletta/ALL";
	DestValues="Select location/Attard/Bugibba/Golden Bay/Gozo/Mellieha/Qawra/St. Julians/Sliema/St. Pauls Bay/Valletta/All location";
	}
	else if(parseInt(SiteID,10)==16)
	{
	DestCode="ALL/NYC1,Brooklyn/NYC2,Manhattan/NYC3,Midtown East Side/NYC4,Times Square - Broadway/NYC5,Upper East Side/NYC6,Upper West Side/NYC7,Wall Street - Financial District/ALL"
	DestValues="Select location/Brooklyn/Manhattan/Midtown East Side/Times Square - Broadway/Upper East Side/Upper West Side/Wall Street - Financial District/All location"
	}
	else
	{
	DestCode="ALL"
	DestValues="All location"
	}
	 ShowAirport(objId,DestCode,DestValues);
}
function ShowAirport(SortField,DestFromCode,DestFromValues)
{
var SplitNameCode,SplitNameText
SplitNameCode = DestFromCode.split("/")
SplitNameText = DestFromValues.split("/")

var newIndex, d, sorttext;
index = 0;
while(SortField.options.length)
{
	d = SortField.options.length - 1;
	SortField.remove(d);
}

	 for (var i=0;i<SplitNameCode.length;i++)
		{
			SortField.options[i] =  new Option();
			SortField.options[i].text = SplitNameText[i];
			SortField.options[i].value = SplitNameCode[i];
		}

}
  
