// JavaScript Document


function ShowCitys(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];
		}
}

function FillDestFrom(obj)
{
	var AirlineValue=document.getElementById(obj.id).value
	if(AirlineValue=='ALL')
    {
	             
	  var DestFromCode="LON/LHR/LGW/MAN/BHX/ABZ/GLA/NCL"
	  var DestFromValues="London All/London Heathrow/London Gatwick/Manchester/Birmingham/Aberdeen/Glasgow/New Castle";					
		 	 ShowCitys(document.FlightSearch.FDestFrom,DestFromCode,DestFromValues);
    }

	if(AirlineValue=='BA')
	{
	 var DestFromCode="LHR/MAN/ABZ/GLA/NCL";
	 var DestFromValues="London Heathrow/Manchester/Aberdeen/Glasgow/New Castle";
 	 ShowCitys(document.FlightSearch.FDestFrom,DestFromCode,DestFromValues);
	}

	if(AirlineValue=='EK')
	{
	 var DestFromCode="LHR/MAN/BHX/GLA/NCL";
	 var DestFromValues="London Heathrow/Manchester/Birmingham/Glasgow/New Castle";
 	 ShowCitys(document.FlightSearch.FDestFrom,DestFromCode,DestFromValues);
	}
	if(AirlineValue=='EY')
	{
	 var DestFromCode="LHR/MAN";
	 var DestFromValues="London Heathrow/Manchester"
 	 ShowCitys(document.FlightSearch.FDestFrom,DestFromCode,DestFromValues);
	}
	if(AirlineValue=='GF')
	{
	 var DestFromCode="LHR/MAN/ABZ/GLA";
	 var DestFromValues="London Heathrow/Manchester/Aberdeen/Glasgow"
 	 ShowCitys(document.FlightSearch.FDestFrom,DestFromCode,DestFromValues);
	}
	if(AirlineValue=='QR')
	{
	 var DestFromCode="LHR/LGW/MAN";
	 var DestFromValues="London Heathrow/London Gatwick/Manchester"
 	 ShowCitys(document.FlightSearch.FDestFrom,DestFromCode,DestFromValues);
	}	
	
}



function showdestto()
{
//        if(document.getElementById("FDestFrom").value=='ATQ')
//		{
//			var DestToCode="LON/BHX";
//            var DestToValues="London All/Birmingham";
//            ShowCitys(document.FlightSearch.FDestTo,DestToCode,DestToValues);
//		}
//		if(document.getElementById("FDestFrom").value=='LON')
//		{
//			var DestToCode="ATQ";
//            var DestToValues="Amritsar";
//            ShowCitys(document.FlightSearch.FDestTo,DestToCode,DestToValues);
//		}
//		if(document.getElementById("FDestFrom").value=='LHR')
//		{
//			var DestToCode="ATQ";
//            var DestToValues="Amritsar";
//            ShowCitys(document.FlightSearch.FDestTo,DestToCode,DestToValues);
//		}
//		if(document.getElementById("FDestFrom").value=='BHX')
//		{
			var DestToCode="ATQ";
            var DestToValues="Amritsar";
            ShowCitys(document.FlightSearch.FDestTo,DestToCode,DestToValues);
//		}
}



function fillDestToFiled()
{	
	//var AirlineValue=document.getElementById(obj.id).value
	var AirlineValue=document.getElementById("FAirLine").value	
if(AirlineValue=='ALL')  
{	
	//if((document.getElementById("FDestFrom").value=='LON') ||(document.getElementById("FDestFrom").value=='LHR')||(document.getElementById("FDestFrom").value=='LGW')||(document.getElementById("FDestFrom").value=='MAN')||(document.getElementById("FDestFrom").value=='BHX')||(document.getElementById("FDestFrom").value=='ABZ')||(document.getElementById("FDestFrom").value=='GLA')||(document.getElementById("FDestFrom").value=='NCL'))	
    //  {		
   			var DestToCode="LHE/ISB/KHI/PEW";
            var DestToValues="Lahore/Islamabad/Karachi/Peshawar";
		 	ShowCitys(document.FlightSearch.FDestTo,DestToCode,DestToValues);			 
			document.FlightSearch.FDestTo.selectedIndex=0;
    // }     
}
if(AirlineValue=='BA')
	{
		
		//if((document.getElementById("FDestFrom").value=='LHR')||(document.getElementById("FDestFrom").value=='MAN')||(document.getElementById("FDestFrom").value=='ABZ')||(document.getElementById("FDestFrom").value=='GLA')||(document.getElementById("FDestFrom").value=='NCL'))	
		//{
			var DestToCode=	"ISB"
			var DestToValues="Islamabad"
		 	 ShowCitys(document.FlightSearch.FDestTo,DestToCode,DestToValues);
		//}		
	}
	
	
	if(AirlineValue=='EK')
	{
		
		//if((document.getElementById("FDestFrom").value=='LHR')||(document.getElementById("FDestFrom").value=='MAN')||(document.getElementById("FDestFrom").value=='BHX')||(document.getElementById("FDestFrom").value=='GLA')||(document.getElementById("FDestFrom").value=='NCL'))	
		//{
			var DestToCode="LHE/ISB/KHI/PEW";
            var DestToValues="Lahore/Islamabad/Karachi/Peshawar";
            ShowCitys(document.FlightSearch.FDestTo,DestToCode,DestToValues);
		//}
				
	}
	if(AirlineValue=='EY')
	{
		
		//if((document.getElementById("FDestFrom").value=='LHR')||(document.getElementById("FDestFrom").value=='MAN'))	
		//{
			var DestToCode="LHE/ISB/KHI/PEW";
            var DestToValues="Lahore/Islamabad/Karachi/Peshawar";
            ShowCitys(document.FlightSearch.FDestTo,DestToCode,DestToValues);
		//}
				
	}
	if(AirlineValue=='GF')
	{
		
		//if((document.getElementById("FDestFrom").value=='LHR')||(document.getElementById("FDestFrom").value=='LGW')||(document.getElementById("FDestFrom").value=='MAN')||(document.getElementById("FDestFrom").value=='ABZ')||(document.getElementById("FDestFrom").value=='BHX')||(document.getElementById("FDestFrom").value=='GLA')||(document.getElementById("FDestFrom").value=='NCL'))	
		//{
			var DestToCode="LHE/ISB/KHI/PEW";
            var DestToValues="Lahore/Islamabad/Karachi/Peshawar";
            ShowCitys(document.FlightSearch.FDestTo,DestToCode,DestToValues);
		//}
				
	}
	if(AirlineValue=='GF')
	{
		
		//if((document.getElementById("FDestFrom").value=='LHR')||(document.getElementById("FDestFrom").value=='LGW')||(document.getElementById("FDestFrom").value=='MAN')||(document.getElementById("FDestFrom").value=='ABZ')||(document.getElementById("FDestFrom").value=='BHX')||(document.getElementById("FDestFrom").value=='GLA')||(document.getElementById("FDestFrom").value=='NCL'))	
		//{
			var DestToCode="LHE/ISB/KHI/PEW";
            var DestToValues="Lahore/Islamabad/Karachi/Peshawar";
            ShowCitys(document.FlightSearch.FDestTo,DestToCode,DestToValues);
		//}
				
	}
	
}

