


function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.Category, "ABZ", "Aberdeen", "");
addOption(document.drop_list.Category, "BFS", "Belfast", "");
addOption(document.drop_list.Category, "BHX", "Birmingham", "");
addOption(document.drop_list.Category, "BLK", "Blackpool", "");
addOption(document.drop_list.Category, "BOH", "Bournemouth", "");
addOption(document.drop_list.Category, "BRS", "Bristol", "");
addOption(document.drop_list.Category, "CWL", "Cardiff", "");
addOption(document.drop_list.Category, "ORK", "Cork", "");
addOption(document.drop_list.Category, "DSA", "Doncaster Sheffield", "");
addOption(document.drop_list.Category, "LDY", "Derry", "");
addOption(document.drop_list.Category, "DUB", "Dublin", "");
addOption(document.drop_list.Category, "MME", "Durham Tees Valley", "");
addOption(document.drop_list.Category, "EMA", "East Midlands Airport", "");
addOption(document.drop_list.Category, "EDI", "Edinburgh", "");
addOption(document.drop_list.Category, "EXT", "Exeter", "");
addOption(document.drop_list.Category, "GLA", "Glasgow", "");
addOption(document.drop_list.Category, "PIK", "Glasgow Prestwick", "");
addOption(document.drop_list.Category, "HUY", "Humberside", "");
addOption(document.drop_list.Category, "MSE", "Kent", "");
addOption(document.drop_list.Category, "NOC", "Knock", "");
addOption(document.drop_list.Category, "LBA", "Leeds Bradford", "");
addOption(document.drop_list.Category, "LPL", "Liverpool", "");
addOption(document.drop_list.Category, "LGW", "London Gatwick", "");
addOption(document.drop_list.Category, "LHR", "London Heathrow", "");
addOption(document.drop_list.Category, "LTN", "London Luton", "");
addOption(document.drop_list.Category, "STN", "London Stansted", "");
addOption(document.drop_list.Category, "MAN", "Manchester", "");
addOption(document.drop_list.Category, "NCL", "Newcastle", "");
addOption(document.drop_list.Category, "NQY", "Newquay", "");
addOption(document.drop_list.Category, "NWI", "Norwich", "");
addOption(document.drop_list.Category, "SNN", "Shannon", "");
addOption(document.drop_list.Category, "SOU", "Southampton", "");
}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.SubCat);
document.drop_list.Button1.disabled=false;

if(document.drop_list.Category.value == 'ABZ'){
 
addOption(document.drop_list.SubCat,"http://www.flyglobespan.com/index.asp?lan=en&OutDepAir=ABZ&OutArrAir=ALC", "flyglobespan");

}
if(document.drop_list.Category.value == 'BFS'){
 
addOption(document.drop_list.SubCat,"http://www.easyjet.com/en/book/index.asp", "easyJet");
addOption(document.drop_list.SubCat,"http://www.flythomascook.com", "flythomascook");
addOption(document.drop_list.SubCat,"http://flights.thomson.co.uk/skylights/cgi-bin/skylights.cgi?page=SEARCH&travel_type=on&sector1_d=ALC&sector1_o=BFS", "Thomson Airways");

}
if(document.drop_list.Category.value == 'BHX'){
 
addOption(document.drop_list.SubCat,"http://affiliates.phd.co.uk/z/14/CD4078/&dp=137", "bmibaby");
addOption(document.drop_list.SubCat,"http://www.flythomascook.com", "flythomascook");
addOption(document.drop_list.SubCat,"http://www.flymonarch.com", "Monarch");
addOption(document.drop_list.SubCat,"http://flights.thomson.co.uk/skylights/cgi-bin/skylights.cgi?page=SEARCH&travel_type=on&sector1_d=ALC&sector1_o=BHX", "Thomson Airways");

}
if(document.drop_list.Category.value == 'BLK'){
addOption(document.drop_list.SubCat,"http://www.jet2.com", "Jet2.com");

}

if(document.drop_list.Category.value == 'BOH'){
addOption(document.drop_list.SubCat,"http://www.ryanair.com", "Ryanair");
}


if(document.drop_list.Category.value == 'BRS'){
 
addOption(document.drop_list.SubCat,"http://www.easyjet.com/en/book/index.asp", "easyJet");
}

if(document.drop_list.Category.value == 'CWL'){
 
addOption(document.drop_list.SubCat,"http://affiliates.phd.co.uk/z/14/CD4078/&dp=137", "bmibaby");
addOption(document.drop_list.SubCat,"http://flights.thomson.co.uk/skylights/cgi-bin/skylights.cgi?page=SEARCH&travel_type=on&sector1_d=ALC&sector1_o=CWL", "Thomson Airways");
}

if(document.drop_list.Category.value == 'ORK'){
addOption(document.drop_list.SubCat,"http://www.aerlingus.com", "Aer Lingus");



}

if(document.drop_list.Category.value == 'LDY'){

addOption(document.drop_list.SubCat,"http://www.ryanair.com", "Ryanair");
}
if(document.drop_list.Category.value == 'DSA'){
addOption(document.drop_list.SubCat,"http://www.ryanair.com", "Ryanair");
addOption(document.drop_list.SubCat,"http://flights.thomson.co.uk/skylights/cgi-bin/skylights.cgi?page=SEARCH&travel_type=on&sector1_d=ALC&sector1_o=DSA", "Thomson Airways");

}
if(document.drop_list.Category.value == 'DUB'){
addOption(document.drop_list.SubCat,"http://www.aerlingus.com", "Aer Lingus");
addOption(document.drop_list.SubCat,"http://www.ryanair.com", "Ryanair");


}
if(document.drop_list.Category.value == 'MME'){
 
addOption(document.drop_list.SubCat,"http://www.flyglobespan.com/index.asp?lan=en&OutDepAir=MME&OutArrAir=ALC", "flyglobespan");
addOption(document.drop_list.SubCat,"http://www.ryanair.com", "Ryanair");



}
if(document.drop_list.Category.value == 'NOC'){
 
addOption(document.drop_list.SubCat,"http://www.ryanair.com", "Ryanair");}
if(document.drop_list.Category.value == 'EMA'){
addOption(document.drop_list.SubCat,"http://affiliates.phd.co.uk/z/14/CD4078/&dp=137", "bmibaby");
addOption(document.drop_list.SubCat,"http://www.easyjet.com/en/book/index.asp", "easyJet");

addOption(document.drop_list.SubCat,"http://www.flythomascook.com", "flythomascook");
addOption(document.drop_list.SubCat,"http://www.ryanair.com", "Ryanair");
addOption(document.drop_list.SubCat,"http://flights.thomson.co.uk/skylights/cgi-bin/skylights.cgi?page=SEARCH&travel_type=on&sector1_d=ALC&sector1_o=EMA", "Thomson Airways");
}
if(document.drop_list.Category.value == 'EDI'){
 
addOption(document.drop_list.SubCat,"http://www.easyjet.com/en/book/index.asp", "easyJet");
addOption(document.drop_list.SubCat,"http://www.flyglobespan.com/index.asp?lan=en&OutDepAir=EDI&OutArrAir=ALC", "flyglobespan");
addOption(document.drop_list.SubCat,"http://www.ryanair.com", "Ryanair");
addOption(document.drop_list.SubCat,"http://flights.thomson.co.uk/skylights/cgi-bin/skylights.cgi?page=SEARCH&travel_type=on&sector1_d=ALC&sector1_o=EDI", "Thomson Airways");

}
if(document.drop_list.Category.value == 'EXT'){
addOption(document.drop_list.SubCat,"http://www.flybe.com", "flybe");

}
if(document.drop_list.Category.value == 'GLA'){
 
addOption(document.drop_list.SubCat,"http://www.easyjet.com/en/book/index.asp", "easyJet");
addOption(document.drop_list.SubCat,"http://www.flyglobespan.com/index.asp?lan=en&OutDepAir=GLA&OutArrAir=ALC", "flyglobespan");
addOption(document.drop_list.SubCat,"http://www.flythomascook.com", "flythomascook");
addOption(document.drop_list.SubCat,"http://flights.thomson.co.uk/skylights/cgi-bin/skylights.cgi?page=SEARCH&travel_type=on&sector1_d=ALC&sector1_o=EDI", "Thomson Airways");
}
if(document.drop_list.Category.value == 'PIK'){
addOption(document.drop_list.SubCat,"http://www.ryanair.com", "Ryanair (Murcia)");

}
if(document.drop_list.Category.value == 'HUY'){
 
addOption(document.drop_list.SubCat,"http://flights.thomson.co.uk/skylights/cgi-bin/skylights.cgi?page=SEARCH&travel_type=on&sector1_d=ALC&sector1_o=HUY", "Thomson Airways");

}
if(document.drop_list.Category.value == 'MSE'){

}
if(document.drop_list.Category.value == 'LBA'){
 
addOption(document.drop_list.SubCat,"http://www.jet2.com", "Jet2.com");
addOption(document.drop_list.SubCat,"http://www.ryanair.com", "Ryanair");

}
if(document.drop_list.Category.value == 'LPL'){
 
addOption(document.drop_list.SubCat,"http://www.easyjet.com/en/book/index.asp", "easyJet");
addOption(document.drop_list.SubCat,"http://www.ryanair.com", "Ryanair");

}
if(document.drop_list.Category.value == 'LGW'){
addOption(document.drop_list.SubCat,"http://clkuk.tradedoubler.com/click?p(60261)a(987456)g(17066602)", "British Airways"); 
addOption(document.drop_list.SubCat,"http://www.easyjet.com/en/book/index.asp", "easyJet");
addOption(document.drop_list.SubCat,"http://www.flythomascook.com", "flythomascook");
addOption(document.drop_list.SubCat,"http://www.flymonarch.com", "Monarch");
addOption(document.drop_list.SubCat,"http://flights.thomson.co.uk/skylights/cgi-bin/skylights.cgi?page=SEARCH&travel_type=on&sector1_d=ALC&sector1_o=LGW", "Thomson Airways");
}
if(document.drop_list.Category.value == 'LHR'){
addOption(document.drop_list.SubCat,"", "No flights");
document.drop_list.Button1.disabled=true;
}

if(document.drop_list.Category.value == 'LTN'){
addOption(document.drop_list.SubCat,"http://www.easyjet.com/en/book/index.asp", "easyJet");
addOption(document.drop_list.SubCat,"http://www.flymonarch.com", "Monarch");
addOption(document.drop_list.SubCat,"http://flights.thomson.co.uk/skylights/cgi-bin/skylights.cgi?page=SEARCH&travel_type=on&sector1_d=ALC&sector1_o=LTN", "Thomson Airways");


}
if(document.drop_list.Category.value == 'STN'){
addOption(document.drop_list.SubCat,"http://www.easyjet.com/en/book/index.asp", "easyJet");
addOption(document.drop_list.SubCat,"http://www.ryanair.com", "Ryanair");

}
if(document.drop_list.Category.value == 'MAN'){
 
addOption(document.drop_list.SubCat,"http://affiliates.phd.co.uk/z/14/CD4078/&dp=137", "bmibaby");
addOption(document.drop_list.SubCat,"http://www.easyjet.com/en/book/index.asp", "easyJet");
addOption(document.drop_list.SubCat,"http://www.flythomascook.com", "flythomascook");
addOption(document.drop_list.SubCat,"http://www.flymonarch.com", "Monarch");
addOption(document.drop_list.SubCat,"http://www.jet2.com", "Jet2.com");
addOption(document.drop_list.SubCat,"http://flights.thomson.co.uk/skylights/cgi-bin/skylights.cgi?page=SEARCH&travel_type=on&sector1_d=ALC&sector1_o=MAN", "Thomson Airways");
}
if(document.drop_list.Category.value == 'NCL'){
 
addOption(document.drop_list.SubCat,"http://www.easyjet.com/en/book/index.asp", "easyJet");
addOption(document.drop_list.SubCat,"http://www.flythomascook.com", "flythomascook");
addOption(document.drop_list.SubCat,"http://flights.thomson.co.uk/skylights/cgi-bin/skylights.cgi?page=SEARCH&travel_type=on&sector1_d=ALC&sector1_o=NCL", "Thomson Airways");

}
if(document.drop_list.Category.value == 'NQY'){
addOption(document.drop_list.SubCat,"http://www.ryanair.com", "Ryanair");

}
if(document.drop_list.Category.value == 'NWI'){
addOption(document.drop_list.SubCat,"", "No flights");
document.drop_list.Button1.disabled=true;
}

if(document.drop_list.Category.value == 'SNN'){
addOption(document.drop_list.SubCat,"http://www.ryanair.com", "Ryanair");

}
if(document.drop_list.Category.value == 'SOU'){
addOption(document.drop_list.SubCat,"http://www.flybe.com", "flybe");

}
}
////////////////// 

function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}


function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;

	selectbox.options.add(optn);
}
