<!--
//Unviversal functions
var XXX = 'select where from';var FromXXX = new Array();FromXXX[0]='YYY';var YYY = 'select where to';var FromYYY = new Array();FromYYY[0]='XXX';var CFR = 'to Caen (CFR)';var FromCFR = new Array();FromCFR[0]='ESH';var DOL = 'to Deauville (DOL)';var FromDOL = new Array();FromDOL[0]='ESH';var LTQ = 'to Le Touquet (LTQ)';var FromLTQ = new Array();FromLTQ[0]='ESH';var ESH = 'to Shoreham (ESH)';var FromESH = new Array();FromESH[0]='CFR';FromESH[1]='DOL';FromESH[2]='LTQ';

if (navigator.appName.indexOf('Netscape') != -1) {
	var versionType = 'n';
	var versionNum = navigator.appVersion.substring(0,1);
	var version = versionType + versionNum;
}
else if (navigator.appVersion.indexOf('MSIE') != -1) {
	var versionType = 'e';
	var MS = navigator.appVersion.indexOf('MSIE');
	var versionNum = navigator.appVersion.substring(MS+5, MS+6);
	var version = versionType + versionNum;
}
else {
	var versionType = 'u';
	var versionNum = 0;
	var version = versionType + versionNum;
}

function ChangeDestinations(SelectThis)
{
	if ((versionType != 'u') || (versionType == 'e' && versionNum > 3) || (versionType == 'n' && versionNum > 4))
	{
		if (document.bookonline.origin.selectedIndex == -1)
		{var origin = "NIL";}
			else
		{var origin = document.bookonline.origin.options[document.bookonline.origin.selectedIndex].value.substring(0,3);}
		
		if (origin != 'NIL')
		{
			var FromArray = eval('From' + origin);
			var DestinationList = document.bookonline.destination.options;
			
			DestinationList.length = 1;
			
			for (loop=0; loop < FromArray.length; loop++)
			{
				DestinationList[loop] = new Option(eval(FromArray[loop]));
				DestinationList[loop].value = FromArray[loop];
			}
			
			DestinationList.selectedIndex = 0;
			if (SelectThis!='')
			{
				//reselect
				for (loop=0; loop < DestinationList.length; loop++)
				{
					if (DestinationList[loop].value.substring(0,3)==SelectThis)
					{
						DestinationList.selectedIndex = loop;
					}
				}
			}
		}
	}
}

function showreturn()
{
	if (document.bookonline.returntrip.checked){
		document.bookonline.returntrip2.checked = false;
		document.bookonline.returnday.disabled =false;
		document.bookonline.returnmonthyear.disabled =false;
		//document.bookonline.returntime.disabled =false;

		ChangeDepartureDate();
	} else {
		document.bookonline.returnday.disabled =true;
		document.bookonline.returnmonthyear.disabled =true;
		//document.bookonline.returntime.disabled =true;
	}
}
function showreturn2()
{
	if (document.bookonline.returntrip2.checked){
		document.bookonline.returntrip.checked =false;
		document.bookonline.returnday.disabled =true;
		document.bookonline.returnmonthyear.disabled =true;
		//document.bookonline.returntime.disabled =false;

		ChangeDepartureDate();
	} else {
		//document.bookonline.returnday.disabled =false;
		//document.bookonline.returnmonthyear.disabled =false;
		//document.bookonline.returntime.disabled =false;
	}
}


var day=1;
var monthyear=0;
var source=0;
var requirements=1;

function makeArray0() {
    for (i = 0; i<makeArray0.arguments.length; i++)
        this[i] = makeArray0.arguments[i];
}

function y2k(number)    { return (number < 1000) ? number + 1900 : number; }

function ChangeDepartureDate()
{

	var days = new makeArray0(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
    
    var firstDay;
    firstDay = new Date('1 ' + document.bookonline.departuremonthyear.options[document.bookonline.departuremonthyear.selectedIndex].value);
	var Month;
	var Year;
	Month=firstDay.getMonth();
	Year=y2k(firstDay.getYear());

	var todayd;
    var beginday;
    var beginmonth;
    var beginyear;
    todayd=new Date();
    beginday=todayd.getDate();
    beginmonth=todayd.getMonth();
    beginyear=todayd.getYear();
    
    if (beginday>days[beginmonth])
		{
		beginday=beginday-days[beginmonth];
		beginmonth=todayd.getMonth()+1;
    
		if (beginmonth<todayd.getMonth())
		{beginyear=todayd.getYear()+1}
		}

        if ((document.bookonline.departureday.value<beginday && beginmonth==Month && Year==beginyear) || (Month<beginmonth && (Year<beginyear || Year==beginyear)))
		{
			alert("Your departure date is too early please pick a later date");
		}
		else
		{
if (document.bookonline.departuremonthyear.selectedIndex > document.bookonline.returnmonthyear.selectedIndex)
	{
	if (document.bookonline.returntrip.checked){document.bookonline.returnmonthyear.selectedIndex=document.bookonline.departuremonthyear.selectedIndex;}}

if (document.bookonline.departuremonthyear.selectedIndex == document.bookonline.returnmonthyear.selectedIndex)
{
if (document.bookonline.departureday.selectedIndex > document.bookonline.returnday.selectedIndex)
	{
	if (document.bookonline.returntrip.checked){document.bookonline.returnday.selectedIndex=document.bookonline.departureday.selectedIndex;}}
}
}
}

function ChangeReturnDate()
{
	if (document.bookonline.departuremonthyear.selectedIndex > document.bookonline.returnmonthyear.selectedIndex)
	{
		//document.bookonline.departuremonthyear.selectedIndex=document.bookonline.returnmonthyear.selectedIndex;
	}

	if (document.bookonline.departuremonthyear.selectedIndex == document.bookonline.returnmonthyear.selectedIndex)
	{
		if (document.bookonline.departureday.selectedIndex > document.bookonline.returnday.selectedIndex)
		{
			//document.bookonline.departureday.selectedIndex=document.bookonline.returnday.selectedIndex;
		}
	}
}

function setselection(settype)
{

	if (document.bookonline.origin.value!="XXX")
	{
		var sURL;
	
		sURL="http://booking.skysouth.co.uk/checkrequirements.asp";
		sURL=sURL + "?origin=" + document.bookonline.origin.value;
		sURL=sURL + "&destination=" + document.bookonline.destination.value;
		sURL=sURL + "&departureday=" + document.bookonline.departureday.value;
		sURL=sURL + "&departuremonthyear=" + document.bookonline.departuremonthyear.value;
		sURL=sURL + "&returnday=" + document.bookonline.returnday.value;
		sURL=sURL + "&returnmonthyear=" + document.bookonline.returnmonthyear.value;
		sURL=sURL + "&numberofadults=" + document.bookonline.numberofadults.value;
		sURL=sURL + "&numberofchildren=" + document.bookonline.numberofchildren.value;
		sURL=sURL + "&numberofinfantswithoutseats=" + document.bookonline.numberofinfantswithoutseats.value;
		sURL=sURL + "&mode=''";
		sURL=sURL + "&faretype=" + settype;
		sURL=sURL + "&sourcepage=requirements.asp";
		if (document.bookonline.returntrip.checked==true)
		{
			sURL=sURL + "&returntrip=on";
		}
		else
		{
			sURL=sURL + "&returntrip=off";
		}
		launch(sURL,580,800);

		//document.bookonline.faretype.value=settype;
		//document.bookonline.submit();
	}
	else
	{
		window.alert("Please choose a from and to first.");
	}
}

function isNS2()
{return ((self.navigator.appName=='Netscape') && (parseInt(self.navigator.appVersion,10)<3));}

function launch(u, h, w) {
if (isNS2()) return;

var PopUpWindow;

if (PopUpWindow != null)
	if(PopUpWindow.closed != true)
		PopUpWindow.close();

PopUpWindow = window.open(u, "_parent" ,"toolbar=no,directories=no,status=yes,scrollbars=yes,resizable=yes,resize=yes,menubar=no,left=" + ((screen.width/2)-(w/2)) + ",top=" + ((screen.Height/2)-(h/2)) + ",height=" + h + ",width="+w);
}
//--->