<!--

// Declare variables here so they can be shared across functions
var currentSeason = '';
var brochureCode = '';

function analyseSeason() {

// Set season for comparison
var storedSeason = currentSeason

// Call input date
var inputMonthStr = document.getElementById('LeavingMonth').value;

// Check length of string and get month
var inputMonthStrLength = parseInt(Len(inputMonthStr))

if (inputMonthStrLength == 6) {
		inputMonth = (parseInt(Left(inputMonthStr,1))-1); // Before October
	}
	else {
		inputMonth = (parseInt(Left(inputMonthStr,2))-1); // After October
}

var inputYear = parseInt(Right(inputMonthStr,4));


var inputDate = new Date()
inputDate.setFullYear(inputYear,inputMonth,02) // Check selected month & year - day is not relevant so is set to 02

// Set season dates
var W09Date = new Date()
W09Date.setFullYear(2009,10,01)
var S10Date = new Date()
S10Date.setFullYear(2010,4,01)
var W10Date = new Date()
W10Date.setFullYear(2010,10,01)
var S11Date = new Date()
S11Date.setFullYear(2011,4,01)
var W11Date = new Date()
W11Date.setFullYear(2011,10,01)

// Compare dates
if (inputDate < S10Date) {
	currentSeason = 'W09'
	brochureCode = 'AS'
}
else if ((inputDate > S10Date) && (inputDate < W10Date)) {
	currentSeason = 'S10'
	brochureCode = 'AS'
}
else if ((inputDate > W10Date) && (inputDate < S11Date)) {
	currentSeason = 'W10'
	brochureCode = 'AS'
}
else if ((inputDate > S11Date) && (inputDate < W11Date)) {
	currentSeason = 'S11'
	brochureCode = 'AS'
}
else if (inputDate > W11Date) {
	currentSeason = 'W11'
	brochureCode = 'AS'
}

// If season changes then reset drop menus
if (storedSeason != '') {
	if (storedSeason != currentSeason) {
		airportList();
		holidayType();
	}
}
else {
	airportList();
	holidayType();
}
}

function airportList() {

var airportList = document.FlightSearch.Departing;

// Create seasonal array
var airports = new Array();
if (currentSeason == 'W09') {
airports[0]=['Leaving From...|ANY','-------------------------------------------|ANY','Sorry, No Airports Available|ANY']
}
else if (currentSeason == 'S10') {
airports[0]=['Leaving From...|ANY','-------------------------------------------|ANY','Aberdeen|ABZ','Belfast|BFS','Birmingham|BHX','Bournemouth|BOH','Bristol|BRS','Doncaster Sheffield|DSA','Durham Tees Valley|MME','Edinburgh|EDI','Gatwick|LGW','Glasgow|GLA','Humberside|HUY','Leeds Bradford|LBA','Manchester|MAN','Newcastle|NCL','Nottingham East Midlands|EMA','Prestwick|PIK','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
}
else if (currentSeason == 'W10') {
airports[0]=['Leaving From...|ANY','-------------------------------------------|ANY','Gatwick|LGW','Manchester|MAN','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
}
else if (currentSeason == 'S11') {
airports[0]=['Leaving From...|ANY','-------------------------------------------|ANY','Belfast|BFS','Birmingham|BHX','Bournemouth|BOH','Bristol|BRS','Cardiff|CWL','Doncaster Sheffield|DSA','Durham Tees Valley|MME','Edinburgh|EDI','Exeter|EXT','Gatwick|LGW','Glasgow|GLA','Humberside|HUY','Manchester|MAN','Newcastle|NCL','Norwich|NWI','Nottingham East Midlands|EMA','Prestwick|PIK','-------------------------------------------|ANY','Antalya|AYT','Bodrum|BJV','Dalaman|DLM']
}
else if (currentSeason == 'W11') {
airports[0]=['Leaving From...|ANY','-------------------------------------------|ANY','Sorry, No Airports Available|ANY']
}

airportList.options.length=0
for (i=0; i<airports[0].length; i++)
airportList.options[airportList.options.length]=new Option(airports[0][i].split('|')[0], airports[0][i].split('|')[1])

}

function holidayType() {

var airportList = document.FlightSearch.Departing;
var resortList = document.FlightSearch.Going;

// Flight only
var type = 'Flight';
airportList.disabled=false;
airportList.options.selectedIndex = 0;
resortList.options.length = 0
resortList.options[0] = new Option('Going To...', ''); 
document.FlightSearch.ProductCode.value = brochureCode;

}

function updateResorts(selectedAirport){

var resortList = document.FlightSearch.Going;

// Analyse which season we are in
analyseSeason();

var type='Flight';

// Create array
var resorts = new Array()
resorts[0]=['Going To...|Any']
resorts[1]=['Going To...|Any']
if (currentSeason == 'W09') {
resorts[2]=['Going To...|Any']}
else if (currentSeason == 'S10') {
resorts[2]=['Going To...|ANY','-------------------------------------------|ANY','Dalaman|DLM']
resorts[3]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[4]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[5]=['Going To...|ANY','-------------------------------------------|ANY','Dalaman|DLM']
resorts[6]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[7]=['Going To...|ANY','-------------------------------------------|ANY','Dalaman|DLM']
resorts[8]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[9]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[10]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[11]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[12]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[13]=['Going To...|ANY','-------------------------------------------|ANY','Dalaman|DLM']
resorts[14]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[15]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[16]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[17]=['Going To...|ANY','-------------------------------------------|ANY','Dalaman|DLM']
resorts[18]=['Going To...|ANY']
resorts[19]=['Going To...|ANY','-------------------------------------------|ANY','Belfast|BFS','Birmingham|BHX','Bristol|BRS','Durham Tees Valley|MME','Edinburgh|EDI','Gatwick|LGW','Glasgow|GLA','Humberside|HUY','Manchester|MAN','Newcastle|NCL','Nottingham East Midlands|EMA']
resorts[20]=['Going To...|ANY','-------------------------------------------|ANY','Aberdeen|ABZ','Belfast|BFS','Birmingham|BHX','Bournemouth|BOH','Bristol|BRS','Doncaster Sheffield|DSA','Durham Tees Valley|MME','Edinburgh|EDI','Gatwick|LGW','Glasgow|GLA','Humberside|HUY','Leeds Bradford|LBA','Manchester|MAN','Newcastle|NCL','Nottingham East Midlands|EMA','Prestwick|PIK']
}
else if (currentSeason == 'W10') {
resorts[2]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[3]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[4]=['Going To...|ANY']
resorts[5]=['Going To...|ANY','-------------------------------------------|ANY','Gatwick|LGW','Manchester|MAN']
resorts[6]=['Going To...|ANY','-------------------------------------------|ANY','Gatwick|LGW','Manchester|MAN']
}
else if (currentSeason == 'S11') {
resorts[2]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[3]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[4]=['Going To...|ANY','-------------------------------------------|ANY','Dalaman|DLM']
resorts[5]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[6]=['Going To...|ANY','-------------------------------------------|ANY','Dalaman|DLM']
resorts[7]=['Going To...|ANY','-------------------------------------------|ANY','Dalaman|DLM']
resorts[8]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[9]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[10]=['Going To...|ANY','-------------------------------------------|ANY','Dalaman|DLM']
resorts[11]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[12]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[13]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[14]=['Going To...|ANY','-------------------------------------------|ANY','Antalya|AYT','Bodrum|BJV','Dalaman|DLM']
resorts[15]=['Going To...|ANY','-------------------------------------------|ANY','Antalya|AYT','Bodrum|BJV','Dalaman|DLM']
resorts[16]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[17]=['Going To...|ANY','-------------------------------------------|ANY','Bodrum|BJV','Dalaman|DLM']
resorts[18]=['Going To...|ANY','-------------------------------------------|ANY','Dalaman|DLM']
resorts[19]=['Going To...|ANY']
resorts[20]=['Going To...|ANY','-------------------------------------------|ANY','Manchester|MAN','Newcastle|NCL']
resorts[21]=['Going To...|ANY','-------------------------------------------|ANY','Belfast|BFS','Birmingham|BHX','Bristol|BRS','Durham Tees Valley|MME','Edinburgh|EDI','Gatwick|LGW','Glasgow|GLA','Humberside|HUY','Manchester|MAN','Newcastle|NCL','Norwich|NWI','Nottingham East Midlands|EMA']
resorts[22]=['Going To...|ANY','-------------------------------------------|ANY','Belfast|BFS','Birmingham|BHX','Bournemouth|BOH','Bristol|BRS','Cardiff|CWL','Doncaster Sheffield|DSA','Durham Tees Valley|MME','Edinburgh|EDI','Exeter|EXT','Gatwick|LGW','Glasgow|GLA','Humberside|HUY','Manchester|MAN','Newcastle|NCL','Norwich|NWI','Nottingham East Midlands|EMA','Prestwick|PIK']
}
else if (currentSeason == 'W11') {
resorts[2]=['Going To...|Any']}

// Update menu
resortList.options.length=0
if (selectedAirport>0){
for (i=0; i<resorts[selectedAirport].length; i++)
resortList.options[resortList.options.length]=new Option(resorts[selectedAirport][i].split('|')[0], resorts[selectedAirport][i].split('|')[1])
} else {
for (i=0; i<resorts[selectedAirport].length; i++)
resortList.options[resortList.options.length]=new Option(resorts[selectedAirport][i].split('|')[0], resorts[selectedAirport][i].split('|')[1])
}

}

// Today's date: 31/07/2010

// -->