/*CreateRouteArrays('choose an airport...,Aberdeen,Birmingham,Bristol,East Midlands,Edinburgh,Glasgow,Liverpool,London (Gatwick),London (Heathrow),Luton,Manchester,Southampton,Stansted, , , , , , , , , , ,','choose an airport...,Beauvais,Bergerac,Biarritz,Bordeaux,Brest,Carcassonne,Chambery,Dinard,La Rochelle,Limoges,Lyon,Marseille,Montpellier,Nantes,Nice,Nimes,Paris (CDG),Perpignan,Poitiers,St Etienne,Toulon,Toulouse,Tours')*/

function GoToSelected()
	{
	var i
	i=document.forms[0].elements["SelectCountry"].selectedIndex;
	//alert(document.forms[0].elements["SelectCountry"].options[i].value)
	window.location = document.forms[0].elements["SelectCountry"].options[i].value;
	}
var from = new Array
var fromValue = new Array

function CheckValue()
{
if (window.document.the_form.the_choices.options[window.document.the_form.the_choices.selectedIndex].value == " "){
  window.document.the_form.the_choices.selectedIndex = 0
} 
}

function ValidateForm()
{
if (window.document.the_form.the_choices.options[window.document.the_form.the_choices.selectedIndex].value == "choose an airport...")
   alert("You must select a valid from or to airport")
else{
   window.document.the_form.submit()
 } 
 }
function CreateRouteArrays(strFrom,strTo)
{

from = strFrom.split(",")
fromValue = strFrom.split(",")
to = strTo.split(",")
toValue = strTo.split(",")
}

function swapOptions(the_array_name,the_array_value)
{
    if (the_array_name=='to')
	 window.document.the_form.Mapclicked.value = 2
	else{
	window.document.the_form.Mapclicked.value = 1
	} 
	var numbers_select = window.document.the_form.the_choices;
	the_array = eval(the_array_name);
	the_value = eval(the_array_value);
	setOptionText(window.document.the_form.the_choices, the_array, the_value);
}

function setOptionText(the_select, the_array)
{
	for (loop=0; loop < the_select.options.length; loop++)
	{
		the_select.options[loop].text = the_array[loop];
		the_select.options[loop].value = the_value[loop];
	}
	document.the_form.the_choices.options[0].selected=true

}

function disabler1() {

}
function SetForm(strDest,strDirection)
{
window.document.the_form.the_choices.options[window.document.the_form.the_choices.selectedIndex].value = strDest
window.document.the_form.Mapclicked.value = 2
window.document.the_form.submit()
 } 
function cancelBooking(url)
{
	msg = "Are you sure you wish to cancel?";
	if (confirm(msg))
	document.location.href = url;
}

function SetForm(strDest,strDirection)
{
window.document.the_form.the_choices.options[window.document.the_form.the_choices.selectedIndex].value = strDest
window.document.the_form.Mapclicked.value = 2
window.document.the_form.submit()
 } 
 
function popurl(url,width,height)
{
	//width = 400; //default width
	sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width='+ width + ',height='+ height +'');
	self.name = "mainWin";
	sealWin.focus()
}