//== Validation messages:
var msgEnterValidOutboundDate	= "Please enter a valid date for the outgoing journey";
var msgEnterValidReturnDate		= "Please enter a valid date for the return journey";
var msgSelectCities		= "Please select an origin and destination city.";
	var msgOutboundBeforeReturn		= "Your return journey cannot be before your outward journey";
var msgEnterDifferentDest		= "Please enter a different destination to the airport you wish to depart from";
var msgIncludeLiverpool 		= "Your journey must start from, or fly to Liverpool";
var msgTooManyPeople			= "You can only make a booking for up to 9 seats online. Please phone (506) 299-6000 if you wish to make a booking for 10 or more passengers.";
var msgTooManyInfants			= "There can only be up to one infant per adult for the booking. Please check and try again";
var msgInvalidTitle				= "Please enter a valid title";
var msgInvalidAge				= "Please enter an age for the infant";
var msgAcceptTerms				= "Please tick the box to indicate that you have accepted the terms and conditions for the booking";
var msgInvalidExpiryDate		= "Please enter a valid expiry date";

var msgGenericInvalidStart		= "Please enter a valid ";
var	msgGenericInvalidEnd		= "";

var msgGenericLongStart			= "Please enter a shorter ";
var	msgGenericLongEnd			= "";

//== for browser differences
var isNS4 = (document.layers) ? true : false;
var isIE4 = (document.all && !document.getElementById) ? true : false;
var isIE5 = (document.all && document.getElementById) ? true : false;
var isNS6 = (!document.all && document.getElementById) ? true : false;

var regExMac = /Macintosh/;
var strVersion = navigator.appVersion;
if (strVersion.search(regExMac) == -1)
{
	var isMac = false;
}
else 
{
	var isMac = true;
}

//== Field name variables (do not translate name variables):

//==	Search form & Booking Page 1
var glbOriginAirportName		= "from";
var glbDestinationAirportName		= "to";

var glbOutboundDayName			= "outbound_day";
var glbOutboundMonthYearName		= "outbound_month_and_year";
var glbReturnDayName			= "return_day";
var glbReturnMonthYearName		= "return_month_and_year";

var glbAdultsName			= "idNumAdults";
var glbChildrenName			= "idNumKids";
var glbInfantsName			= "idNumInfants";

//==	Booking Page 2
var glbOutboundJourneyName		= "outbound_journey";
var glbReturnJourneyName		= "return_journey";

//==	Booking Page 4
var glbTitlePrefixName			= "title_p";
var glbForenamePrefixName		= "forename_p";
var glbSurnamePrefixName		= "surname_p";

var glbContactPhoneHome			= "contact_phone_home";
var glbContactPhoneAway			= "contact_phone_away";
var glbContactEmail			= "contact_email";

//==	Booking Page 5
var glbTotalPaymentName			= "total_payment";
var glbTotalPaymentDisplayName		= "total_payment_display";
var glbCardTypeName			= "card_type";

var glbCardNameName			= "card_name";
var glbCardNumberName			= "card_number";
var glbCardExpiryMonthName		= "card_expiry_month";
var glbCardExpiryYearName		= "card_expiry_year";
var glbCardIssueNumberName		= "card_issue_number";
var glbCardCVVNumberName		= "card_security_number";

var glbBillHouseName			= "bill_house";
var glbBillStreetName			= "bill_street";
var glbBillTownName				= "bill_town";
var glbBillPostcodeName			= "bill_postcode";
var glbBillCountryName			= "bill_country";
var glbBillEmailName			= "bill_email";
var glbBillTermsName			= "bill_terms";

//== Currency settings:

var glbCCChargeOnServer			= true;				//==	Set this to true if the server will create the credit card drop down 
													//==	with the credit card charges

var glbCurrency				= "GBP";
var glbCurrencySymbol			= "£";
var glbCreditCardCharge			= 3;

var constEUROCurrency			= "EUR";
var constEUROSymbol			= "€";
var constEUROCCCharge			= 5;

var constGBPCurrency			= "GBP";
var constGBPSymbol			= "£";
var constGBPCCCharge			= 3;

var constMaxFieldLength			= 100;				//==	Default maximum field length for all fields

var constMaxNumberPassengers		= 9;				//==	Maximum number of total Adults and children for the booking
var constMaxNumberParty			= 18;				//==	Theoretical maximum number in party (max Adults + max Infants)

var constLiverpool	= "LPL";
var constIsleOfMan				= "IOM";
var constCreditCardChargeIdentifier = "charge";		//==	String to search for in the option value that
													//==	specifies the card adds a charge


window.onload = loader;			//== Set the onload event handler


//==	Event handler - window.onload: loader()
//
//==		fires when the page loads. assigns event handlers.
//==		also sets the global currency type, and populates credit
//==		card charge details

function loader() {
	var objReturnDay			= glbGetElementById(glbReturnDayName);
	var objReturnMonthYear		= glbGetElementById(glbReturnMonthYearName);
	var objTotalPayment			= glbGetElementById(glbTotalPaymentName);
	var objTotalPaymentDisplay	= glbGetElementById(glbTotalPaymentDisplayName);
	var objCreditCardType		= glbGetElementById(glbCardTypeName);
	
	var strTotalPaymentValue	= getFieldValue(objTotalPayment);
	
	if (objReturnDay) {
		objReturnDay.onchange = dateReturnChange;
	}
	
	if (objReturnMonthYear) {
		objReturnMonthYear.onchange = dateReturnChange;
	}
	
	if (objTotalPayment && objTotalPaymentDisplay) {						//== The payment fields are on the page
		if (strTotalPaymentValue.substr(0,1) == constEUROSymbol) {				//==	Look at the figure to determine currency type
			glbCurrency = constEUROCurrency;						//==	and set global values
			glbCurrencySymbol = constEUROSymbol;
			glbCreditCardCharge = constEUROCCCharge;
		} else {
			glbCurrency = constGBPCurrency;
			glbCurrencySymbol = constGBPSymbol;
			glbCreditCardCharge = constGBPCCCharge;			
		}
		objTotalPaymentDisplay.value = strTotalPaymentValue;
	}
	
// commented out because of conflict with onChange event handler defined elsewhere
//
//	if (objCreditCardType) {									//== The credit card type field is on the page:
//		objCreditCardType.onchange = creditCardTypeChange;					//==	Assign the onchange handler
//		if (!glbCCChargeOnServer) {
//			for (var intItem = 0; intItem < objCreditCardType.options.length; intItem++) {		//==	For each item that contains the Credit Card charge identifier
//				var strOptionText = objCreditCardType.options[intItem].text;			//==	add details of the charge based on the currency settings
//				if (strOptionText.indexOf(constCreditCardChargeIdentifier) > -1) {
//					objCreditCardType.options[intItem].text += " " + glbCurrencySymbol + glbCreditCardCharge;
//				}
//			}
//		}
//}
}



//==	Event handler - select.onchange: creditCardTypeChange()
//
//==		fires when the credit card type field changes. adds credit card
//==		charges if the card requires it. 

function creditCardTypeChange() {
	var objTotalPayment			= glbGetElementById(glbTotalPaymentName);
	var objTotalPaymentDisplay	= glbGetElementById(glbTotalPaymentDisplayName);
	var objCreditCardType		= glbGetElementById(glbCardTypeName);
	
	var strTotalPaymentValue			= getFieldValue(objTotalPayment);

	var strTotalCreditCardTypeText		= "";
	var decCreditCardCharge				= glbCreditCardCharge; 
	
	if (objCreditCardType.selectedIndex > -1) {
		strTotalCreditCardTypeText = objCreditCardType.options[objCreditCardType.options.selectedIndex].text;
	}
	
	if (strTotalPaymentValue.substr(0,1) == glbCurrencySymbol) {
		if (glbCCChargeOnServer) { //== Override the credit card charges with those generated on the server
			var intCurSymbolPosn = strTotalCreditCardTypeText.indexOf(glbCurrencySymbol)
			if (intCurSymbolPosn > 0) {
				decCreditCardCharge = parseFloat(strTotalCreditCardTypeText.substr(intCurSymbolPosn + glbCurrencySymbol.length, strTotalCreditCardTypeText.length - (intCurSymbolPosn + glbCurrencySymbol.length)));	//== Get the value of the total payment
			}				
		}	
		var decTotalPayment = parseFloat(strTotalPaymentValue.substr(1, strTotalPaymentValue.length - 1));	//== Get the value of the total payment
	} else {
		return;  //==  Total price doesn't have the correct currecy symbol on the front
	}
	
	if (strTotalCreditCardTypeText.indexOf(constCreditCardChargeIdentifier) > -1) {							//== Card adds a charge
		decTotalPayment = decTotalPayment + decCreditCardCharge;											//== Add charge to the total
	}
	
	objTotalPaymentDisplay.value = glbCurrencySymbol + formatCurrency(decTotalPayment);
}



//==	Event handler - select.onchange: dateReturnChange()
//
//==		fires when the return date fields change to reset the fields
//==		to the value "no just one way" if either of the fields are set to 
//==		their part of the value

function dateReturnChange() {
	var objReturnDay			= glbGetElementById(glbReturnDayName);
	var objReturnMonthYear		= glbGetElementById(glbReturnMonthYearName);
	var strReturnDayValue		= "";
	var strReturnMonthYearValue = "";
	
	strReturnDayValue = getFieldValue(objReturnDay);
	strReturnMonthYearValue = getFieldValue(objReturnMonthYear);

	if (this == objReturnDay) {						//==	Day object change event fired
		if (strReturnDayValue == -1) {				//==	Day is set to "no"
			objReturnMonthYear.selectedIndex = 0;	//==	Set month to "just one way"
		} else { 
			if (strReturnMonthYearValue == -1) {
				objReturnMonthYear.selectedIndex = 1;
			}
		}
	} else {										//==	Month object change event fired
		if (strReturnMonthYearValue == -1) {		//==	Month is set to "just one way"
			objReturnDay.selectedIndex = 0;			//==	Set day to "no"
		} else { 
			if (strReturnDayValue == -1) {
				objReturnDay.selectedIndex = 1;
			}
		}
	}
}



//==	object glbGetElementById (string strName)
//
//==		returns the element object contained in the document where the name is equal 
//==		to string strName. designed to be cross-browser compatible.

function glbGetElementById (strName) {
	var objRetVal;
	var blnUseForm = false;
	if (document.getElementById) {					//==	Check for getElementById method
		objRetVal = document.getElementById(strName);
	} else {
		if (document.all) {							//==	Check for the document.all collection
			objRetVal = document.all[strName];
		} else {									//==	Search document forms for element
			blnUseForm = true;
		}
	}
	
	if (objRetVal) {
		if (objRetVal.type) {								//==	If object is a radio button we need to access it using
			if (objRetVal.type.toLowerCase() == "radio") {	//==	the document.formname.elementname notation to retrive the radioset array
				eval ("objRetVal = document." + objRetVal.form.name + "." + strName);
			}
		}
	}

	if (blnUseForm) {
		for (var lngFormCounter=0; !objRetVal && lngFormCounter < document.forms.length; lngFormCounter++) {
			for (var lngElementCounter=0; !objRetVal && lngElementCounter < document.forms[lngFormCounter].elements.length; lngElementCounter++) {
				var objElement = document.forms[lngFormCounter].elements[lngElementCounter];
				if (objElement.name == strName) {			//==	Found element 
					objRetVal = document.forms[lngFormCounter].elements[strName];
				}
			}
		}			
	}
	return objRetVal;
}



//==	string getFieldValue (object objField) 
//
//==		returns the value of the select element object passed in to
//==		the function. returns an empty string if the object is null, 
//==		not a select or	does not have a value selected.

function getFieldValue(objField) {
	if (objField) {
		if (objField.type) {
			if (objField.type.toLowerCase() == "select-one") {			//==	Field is a select drop-down. Get the selected option value
				if (objField.selectedIndex > -1) {
					return objField.options[objField.options.selectedIndex].value;
				}
			}
			if (objField.type.toLowerCase() == "radio") {				//==	Field is a radio box, but not checked so don't return a value
				if (!objField.checked) {
					return "";
				}
			}
		}
		if (objField.length && objField[0]) {							//==	Field is an radioset array. Find radio button that is checked
			for (var intOption = 0; intOption < objField.length; intOption++) {	
				if (objField[intOption].checked) {
					return objField[intOption].value;
				}
			}
		}
		if (objField.value) {											//==	Standard field. Use the value property
			return objField.value;
		}
	}
	return "";
}



//==	string formatCurrency (decimal decCurrency) 
//
//==		returns a string formating the decimal decCurrency to two decimal
//==		places.

function formatCurrency(decCurrency) {
	var strCurrency = decCurrency.toString();
	var intDecPosn = strCurrency.indexOf(".");
	if (intDecPosn == -1) {								//==	No decimal point in number. Add the two decimal places.
		strCurrency = strCurrency + ".00";	
	} else {
		if ((strCurrency.length - intDecPosn) < 3) {	//==	Decimal point exists, but not to two decimal places. Pad to correct length
			strCurrency = rightPad(strCurrency, intDecPosn + 3, "0");
		}
	}
	return strCurrency;
}



//==	string leftPad (string str, integer len, string chr)
//
//==		returns the string str left-padded to length len with 
//==		the character chr.

function leftPad(str, len, chr) {
	while (str.length < len) str = chr + str;
	return str;
}



//==	string rightPad (string str, integer len, string chr)
//
//==		returns the string str right-padded to length len with 
//==		the character chr.

function rightPad(str, len, chr) {
	while (str.length < len) str = str + chr;
	return str;
}



//==	string getDateValue(object objDay, object objMonthYear)
// 
//==		if either of objDay, or objMonthYear are set to the "no, just one way" value, 
//== 		it returns a blank string and sets both fields to the "no, just one way" value.
//==		otherwise, it returns the date value provided by the fields in the following 
//==		format: 
//==			dd mmm yyyy
//==		use isValidDate to validate the date value.
function getDateValue(objDay, objMonthYear) {
	var strDayValue = "";
	var strMonthYearValue = "";
	
	strDayValue = getFieldValue(objDay);
	strMonthYearValue = getFieldValue(objMonthYear);

	if (strDayValue == -1 || strMonthYearValue == -1) {	//==	Day field set to "no" or
														//==	Month Year field set to "just one way"

		objDay.selectedIndex		= 0;				//==	Set to "no"
		objMonthYear.selectedIndex	= 0;				//==	Set to "just one way"
		return "";
	}
	return leftPad(strDayValue, 2, "0") + " " + strMonthYearValue.substr(0,3) + " " + strMonthYearValue.substr(3,4);
}



//==	bool isValidDate (string strDate)
// 
//==		strDate should be the following format: dd mmm yyyy
//==		if strDate is empty, or contains a valid date value, returns true.
//== 		otherwise returns false.

function isValidDate(strDate) {
	if (strDate == "") return true;
	var strDay = strDate.substr(0,2);					//==	Take the first two characters from the date
	if (strDay.substr(0,1) == "0")						//==	Remove padded zero	
		strDay = strDay.substr(1,1);
	var intDay = parseInt(strDay);
	var dteDate = new Date(strDate);
	
	if (dteDate.getDate() != intDay) {					//==	The day value of the date has changed,
														//==	the date must be invalid
		return false;
	}
	
	return true;
}



//==	bool isValidNumber (string strNumber)
// 
//==		returns true if is string strNumber is a valid number 
//== 		(contains 0-9 . + - ( or )). otherwise returns false.

function isValidNumber(strNumber) {
	var numInput = "+-0123456789(). ";					//==	String containing valid characters
	
	if (strNumber == "") return false;
	
	for(var k = 0; k < strNumber.length; k++) {
		if(numInput.indexOf(strNumber.charAt(k)) == -1)	{
			return false;
		}
	}
	return true;
}



//==	bool isValidPostcode (string strPostcode)
// 
//==		returns true if is string strPostcode is a valid postcode.
//== 		otherwise returns false.

function isValidPostcode(strPostcode) {
	var regExPC = /^[a-zA-Z]{1,2}[0-9]{1,2}[a-zA-Z]? ?[0-9][a-zA-Z]{2}$/
	return regExPC.test(strPostcode);
}



//==	bool isValidEmail (string strEmail)
// 
//==		returns true if is string strEmail is a valid email address.
//== 		otherwise returns false.

function isValidEmail(strEmail) {
	if (isMac)
	{
		if (strEmail == null || strEmail == "" || strEmail.length < 5 || strEmail.search("@") == -1)
		{
			return false;
		}
		else
		{
			return true;
		}
	}
	else
	{
		var regExEmail = /^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/
		return regExEmail.test(strEmail);
	//== above code doesn't work on Macs
	}
}



//==	string monthName (integer intMonth)
// 
//==		returns the abbreviated name of the month corresponding to the integer intMonth supplied.


function monthName (intMonth) {
	var aryMonths = new Array ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
	
	if ((intMonth > 0) && (intMonth < 13)) {
		return aryMonths[intMonth - 1];
	}
	
	return "";
}



//==	integer daysInMonth (integer intMonth, integer intYear)
// 
//==		returns the numbers of days in the month for the month and year supplied

function daysInMonth (intMonth, intYear) {
	if (intMonth < 1 || intMonth > 12) {
		return 0;
	}
	if (intMonth == 12) return 31;
	
	var dteDate = new Date ("1 " + monthName (intMonth + 1) + " " + intYear)
	
	if (dteDate) {
		dteDate.setDate(0);
		return dteDate.getDate();
	}
	
	return 0;
}


//==	bool checkRequiredField (object objField, string strTitle, bool blnRequired, optional string strType)
//
//==		returns true if the field value passes the validation tests based on whether it is required, 
//==		the type of the field. if it fails validation, a generic message is displayed using the 
//==		the supplied title. focus is given to the object, and false is returned.

function checkRequiredField (objField, strTitle, blnRequired, strType) {
	var strValue = getFieldValue(objField);

	if (objField) {
		if (objField.length && objField[0]) {		//==	Field is an array - likely radioset
			objField = objField[0];			//==	Set field to first item so we can apply focus
		}
	}
	
	if (blnRequired || strValue != "") {			//==	Field is required, or value has been entered so check format
		if (strType == "postcode" && blnRequired) {	//==	Apply postcode validation only if required
			if (!isValidPostcode(strValue)) {
				alert (msgGenericInvalidStart + strTitle + msgGenericInvalidEnd);
				objField.focus();
				return false;
			}
		}
		if (strType == "number") {
			if (!isValidNumber(strValue)) {			//==	Apply number validation
				alert (msgGenericInvalidStart + strTitle + msgGenericInvalidEnd);
				objField.focus();
				return false;
			}
		}
		if (strType == "email") {
			if (!isValidEmail(strValue)) {			//==	Apply email validation 
				alert (msgGenericInvalidStart + strTitle + msgGenericInvalidEnd);
				objField.focus();
				return false;
			}
		}

        // to make sure it contains more than spaces
        var regexp = / /g;
        strCheck = strValue.replace(regexp, "");

		//if (strValue == "" || strValue == -1) {		//==	Value is required but no value present
        if (strCheck == "" || strValue == -1) {     //==    Value is required but no value present
			alert (msgGenericInvalidStart + strTitle + msgGenericInvalidEnd);
			//objField.focus();
			return false;
		}
	}
	
	if (strValue.length > constMaxFieldLength) {	//==	Length of field is greater than max length
		alert (msgGenericLongStart + strTitle + msgGenericLongEnd);
		objField.focus();
		return false;
	}
	
	return true;									//==	Check successful
}



//==	bool checkFormPage1() 
//
//==		returns true if the following tests are passed:
//==			Origin Airport and Distination Airport are not the same
//==			Leeds Bradford is the start or destination Airport
//==			Outgoing date is valid
//==			Return date is valid (or no date set)
//==			Return date is same or after Outgoing date
//==			The number in the party is 9 or less
//==			The number of infants is equal to less to the number of adults
//==		if any check fails, the relevant field is focused and the function
//==		returns false.

function checkFormPage1() {
	var objOriginAirport			= glbGetElementById(glbOriginAirportName);
	var objDestinationAirport		= glbGetElementById(glbDestinationAirportName);
	var objOutboundDay				= glbGetElementById(glbOutboundDayName);
	var objOutboundMonthYear		= glbGetElementById(glbOutboundMonthYearName);
	var objReturnDay				= glbGetElementById(glbReturnDayName);
	var objReturnMonthYear			= glbGetElementById(glbReturnMonthYearName);
	var objAdults					= glbGetElementById(glbAdultsName);
	var objChildren					= glbGetElementById(glbChildrenName);
	var objInfants					= glbGetElementById(glbInfantsName);
	
	var strOriginAirportValue		= getFieldValue(objOriginAirport);
	var strDestinationAirportValue	= getFieldValue(objDestinationAirport);
	var strOutboundDateValue		= getDateValue(objOutboundDay, objOutboundMonthYear);
	var strReturnDateValue			= getDateValue(objReturnDay, objReturnMonthYear);
	var strAdultsValue				= getFieldValue(objAdults);
	var strChildrenValue			= getFieldValue(objChildren);
	var strInfantsValue				= getFieldValue(objInfants);

	if (strOriginAirportValue == strDestinationAirportValue) {						//==	Origin and Destination the same
		alert(msgEnterDifferentDest);
		objDestinationAirport.focus();
		return false;
	}
	
//	if (((strOriginAirportValue != constLiverpool) && (strDestinationAirportValue != constLiverpool)) && ((strOriginAirportValue != constPrague) && (strDestinationAirportValue != constIsleOfMan)) && ((strOriginAirportValue != constBelfast) && (strDestinationAirportValue != constPrague))) {				//==	Leeds Bradford not Origin or Destination
//		alert(msgIncludeLiverpool);
//		objOriginAirport.focus();
//		return false;
//	}
	
	if (!isValidDate(strOutboundDateValue)) {										//==	Outbound date not a valid date
		alert (msgEnterValidOutboundDate);
		objOutboundDay.focus();
		return false;
	}
	
	if (!isValidDate(strReturnDateValue)) {											//==	Return date not a valid date
		alert (msgEnterValidReturnDate);
		objReturnDay.focus();
		return false;
	}
	
	if (strReturnDateValue != "") {													//==	Return date set
		var dteOutbound = new Date (strOutboundDateValue);
		var dteReturn	= new Date (strReturnDateValue);
		if (dteOutbound > dteReturn) {												//==	Outbound date not before Return date
			alert (msgOutboundBeforeReturn);
			objOutboundDay.focus();
			return false;
		}
	}
	
	var intTotalParty = parseInt(strAdultsValue) 
					  + parseInt(strChildrenValue);
					  //-- + parseInt(strInfantsValue);								//==	Add up total party 

	if (intTotalParty > constMaxNumberPassengers) {									//==	Number in party more than Max number set
		alert(msgTooManyPeople);
		objAdults.focus();
		return false;
	}
	
	if (parseInt(strAdultsValue) < parseInt(strInfantsValue)) {						//==	More infants than adults
		alert(msgTooManyInfants);
		objInfants.focus();
		return false;
	}
	
	return true;	// Checks passed sucessfully
} 



//==	bool checkFormPage2() 
//
//==		returns true if the following tests are passed:
//==			Outbound journey selected
//==			Return journey selected
//==		if any check fails, the relevant field is focused and the function
//==		returns false.

//function checkFormPage2() {
//	var objOutboundJourney			= glbGetElementById(glbOutboundJourneyName);
//	var objReturnJourney			= glbGetElementById(glbReturnJourneyName);
//
//	if (!checkRequiredField(objOutboundJourney, "Outbound journey", true, "")) return false;
//	if (objReturnJourney) { //== Only check for return journey if the return_journey radio set exists
//		if (!checkRequiredField(objReturnJourney, "Return journey", true, "")) return false;
//	}
//	
//	return true;
//} 

function getElById(id)
{
	if (isIE4)
	{
		return document.all(id);
	}
	else
	{
		return document.getElementById(id);
	}
}
function checkFormPage2IE4()
{
	var col = document.all.tags("INPUT");
	var i;
	var bSelect1 = false;
	var bSelect2 = false;

	for (i = 0;i < col.length;i++)
	{
	  if (col[i].name == "SELECT_LINE")
	  {
		if (col[i].checked)
		{
			bSelect1 = true;
		}
	  }
	  if (col[i].name == "SELECT_LINE2")
	  {
		if (col[i].checked)
		{
			bSelect2 = true;
		}
	  }
	}

	if (!(bSelect1 && bSelect2))
	{
		alert("Please select your flight(s)");
		return false;
	}

	return true;
}
function checkFormPage2()
{
	if (isIE4)
	{
		return checkFormPage2IE4();
	}
	
	var col = document.getElementsByName("SELECT_LINE");
	var col2 = document.getElementsByName("SELECT_LINE2");
	var i = 0;
	var bGroup1,bGroup2;
	
	bGroup1 = bGroup2 = false;
	
	for (i = 0;i < col.length;i++)
	{
		if (col[i].checked)
		{
			bGroup1 = true;
			break;
		}
	}
	
	for (i = 0;i < col2.length;i++)
	{
		if (col2[i].checked)
		{
			bGroup2 = true;
			break;
		}
	}
	
	// if there is no group 2
	if (col2.length == 0) 
	{ 
		bGroup2 = true; 
	}
	
	if (!(bGroup1 && bGroup2)) 
	{ 
		alert("Please select your flight(s)"); 
		return false 
	}
	
	return true;
}	



//==	bool checkFormPage3() 
//
//==		returns true. no checks required.

function checkFormPage3() {

//==	names and contact info
 
	var sel = getElsByTagName("select");
	var col = getElsByTagName("input");
	var i;
	var bFirstNameErr,bLastNameErr,bIDErr,bEmailErr,bCarErr,bLegalErr;
	
	bFirstNameErr = bLastNameErr = bIDErr = bEmailErr = bCarErr = bLegalErr = 0;

	for (i = 0;i < col.length;i++)
	{
		var strName = col[i].name;
		strName = strName.substring(0,3);

	        // to make sure it contains more than spaces
	        strCheck = col[i].value;
	        var regexp = / /g;
	        strCheck = strCheck.replace(regexp, "");
			
		// check the First name fields
		if (strName == "IME")
		{
	            	if (strCheck == null || strCheck == "" || strCheck.length < 2)	
			{
				alert('Please fill out the names of all passengers flying.\n(must be at least 2 characters long)');
				return false;
			}
		}
		
		// check the Last name fields
		if (strName == "PRE")
		{
			//if (col[i].value == null || col[i].value == "" || col[i].value.length < 2)
       	     	if (strCheck == null || strCheck == "" || strCheck.length < 2)
			{
				alert('Please fill out the last names of all passengers flying.\n(must be at least 2 characters long)');
				return false;
			}
		}

        	 // check the PHONE fields 
        	 if (strName == "PHO")
        	 {
	
			//if (col[i].value == null || col[i].value == "")
	            	if (strCheck == null || strCheck == "" || strCheck.length < 2)
			{
				alert('Please enter a valid phone number.');
				return false;
			}
	         }
	         
		// check the Email field
		if (strName  == "EMA")
		{
			if (col[i].value == null || col[i].value == "" || col[i].value.length < 5 || col[i].value.search("@") == -1)
			{
				alert('Please fill in a valid Contact Email address.');
				return false;
			}
		}
		// check the DOB field
		if (strName  == "DOB")
		{
			if (col[i].value == null || col[i].value == "")
			{
				alert('Please fill in a valid Date of Birth.');
                                return false;
			}
			if (!(isValidDateDOB(col[i].value))) return false;
//			elsif (!isValidDateDOB(col[i].value))
//			{
//				alert();
//				return false;
//			}
		}
		
	}

	for (i = 0;i < sel.length;i++)
	{
		var selName = sel[i].name;
		selName = selName.substring(0,3);
		if (selName == "PTC")
		{
			var infantAge = sel[i].selectedIndex
			if (infantAge < '1')
			{
				alert('Please enter an age for the infant');
				return false;
			}
		}
	}


//==    payment info

	var objCardName			= glbGetElementById(glbCardNameName);
	var objCardType			= glbGetElementById(glbCardTypeName);	
	var objCardNumber		= glbGetElementById(glbCardNumberName);
	var objCardExpiryMonth		= glbGetElementById(glbCardExpiryMonthName);
	var objCardExpiryYear		= glbGetElementById(glbCardExpiryYearName);
	var objCardCVVNumber		= glbGetElementById(glbCardCVVNumberName);
	var objBillTermsAccept		= glbGetElementById(glbBillTermsName);
//	var objBillHouse		= glbGetElementById(glbBillHouseName);
	var objBillStreet		= glbGetElementById(glbBillStreetName);
	var objBillTown			= glbGetElementById(glbBillTownName);
	var objBillPostcode		= glbGetElementById(glbBillPostcodeName);
	var objBillCountry		= glbGetElementById(glbBillCountryName);
	var objBillEmail		= glbGetElementById(glbBillEmailName);

	if (!checkRequiredField(objCardType, "Card type", true, "")) return false;
	if (!checkRequiredField(objCardName, "Name for the Card", true, "")) return false;
	if (!checkRequiredField(objCardNumber, "Card number", true, "number")) return false;
	if (!checkRequiredField(objCardExpiryMonth, "Card expiry month", true, "")) return false;
	if (!checkRequiredField(objCardExpiryYear, "Card expiry year", true, "")) return false;
	if (!checkRequiredField(objCardCVVNumber, "Card verification number", true, "number")) return false;

	var strMonth = getFieldValue(objCardExpiryMonth);

	if (strMonth.substr(0,1) == "0")						//==	Remove padded zero	
		strMonth = strMonth.substr(1,1);
	var intMonth = parseInt(strMonth);
	
	var strYear = getFieldValue(objCardExpiryYear);
	if (strYear.length == 2) strYear = "20" + strYear;
	var intYear = parseInt(strYear);
	
	var intDaysMonth = daysInMonth(intMonth, intYear);
	
	var dteExpiryDate = new Date (intDaysMonth + " " + monthName(intMonth) + " " + intYear);
	var dteNow = new Date();
	
	if (dteNow > dteExpiryDate) {
		alert (msgInvalidExpiryDate);
		objCardExpiryMonth.focus();
		return false;
	}

	if (objBillStreet) {
		if (!checkRequiredField(objBillStreet, "Street", true, "")) return false;
		if (!checkRequiredField(objBillTown, "Town", true, "")) return false;
		if (!checkRequiredField(objBillPostcode, "Postcode", true, "")) return false;
		if (!checkRequiredField(objBillCountry, "Country", true, "")) return false;
	}
	if (objBillEmail) {
		if (!checkRequiredField(objBillEmail, "Cardholder email address", true, "email")) return false;
		if ( glbGetElementById('chkEmail'))
		{
			if (getFieldValue(glbGetElementById('chkEmail')) != getFieldValue(objBillEmail)) {
				alert("The email addresses for the Cardholder do not match.");
				return false;
			}
		}
	}
	if (!objBillTermsAccept.checked) {	//==	The user has not ticked the Terms box
		alert (msgAcceptTerms);
		objBillTermsAccept.focus();
		return false;
	}

	// if no error, disable submit button and return true
	var objSubmitButton =	 glbGetElementById("submitButton");	
	objSubmitButton.disabled = 'true';
	
	
	return true;	
} 

//==	 Checks for the following valid date formats:
//==	 MM/DD/YY   MM/DD/YYYY   MM-DD-YY   MM-DD-YYYY
//==	 Also separates date into month, day, and year variables
//
//==	corrected on 04/05/11 to check DD MM YY

function isValidDateDOB(dateStr) {
	var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{2}|\d{4})$/;

	// To require a 4 digit year entry, use this line instead:
	// var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{4})$/;

	var matchArray = dateStr.match(datePat); // is the format ok?
	if (matchArray == null) {
		alert("Date is not in a valid format.");
		return false;
	}
	month = matchArray[3]; // parse date into variables
	day = matchArray[1];
	year = matchArray[4];
	if (month < 1 || month > 12) { // check month range
		alert("Month must be between 1 and 12.");
		return false;
	}
	if (day < 1 || day > 31) {
		alert("Day must be between 1 and 31.");
		return false;
	}
	if ((month==4 || month==6 || month==9 || month==11) && day==31) {
		alert("Month "+month+" doesn't have 31 days!")
		return false
	}
	if (month == 2) { // check for february 29th
		var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
		if (day>29 || (day==29 && !isleap)) {
			alert("February " + year + " doesn't have " + day + " days!");
			return false;
		}
	}
	return true;  // date is valid
}


//==	bool checkFormPage4() 
//
//==		returns true if the following tests are passed:
//==			Each passenger has:
//==				a valid title (or age for infants)
//==				a valid forename
//==				a valid surname
//==			Home phone number entered
//==			Email address valid if entered
//==			No field longer than 100 characters
//==		if any check fails, the relevant field is focused and the function
//==		returns false.

//function checkFormPage4() {
//	var strPersonType = ""; 
//	var intPersonTypeCount = 0;
//
//	for (var intPerson = 1; intPerson <= constMaxNumberParty; intPerson++) {		//== Each person on the form
//		var objTitle		= glbGetElementById(glbTitlePrefixName + intPerson);
//		var objForename		= glbGetElementById(glbForenamePrefixName + intPerson);
//		var objSurname		= glbGetElementById(glbSurnamePrefixName + intPerson);
//		var strTitle		= getFieldValue(objTitle);
//		var strForename		= getFieldValue(objForename);
//		var strSurname		= getFieldValue(objSurname);
//		
//		if (objTitle && strTitle == "") {						//== Check title has been set
//			alert (msgInvalidTitle);
//			objTitle.focus();
//			return false;
//		}
//			
//		if (objTitle && strTitle == -1) {						//== -1 can only exist for infants
//			alert (msgInvalidAge);								//== If -1 no age has been set
//			objTitle.focus();
//			return false;
//		}
//
//		var strNewPersonType = "";
//	
//		if (objForename) {										//== Update the person type for this person
//			if (objTitle.options[0].value == "Mr.") strNewPersonType = "Adult";
//			if (objTitle.options[0].value == "Mstr.") strNewPersonType = "Child";
//			if (objTitle.options[0].value == -1) strNewPersonType = "Infant";
//
//			if (strNewPersonType == strPersonType) {			//== Add to the person type count
//				intPersonTypeCount++;
//			} else {
//				strPersonType = strNewPersonType;				//== New person type - reset the count
//				intPersonTypeCount = 1;
//			}
//			
//			if (!checkRequiredField(objForename, "First name for " + strPersonType + " " + intPersonTypeCount, true, "")) return false;
//			if (!checkRequiredField(objSurname, "Surname for " + strPersonType + " " + intPersonTypeCount, true, "")) return false; 
//			
//			if (strSurname.length < 2) { 
//				alert (msgGenericInvalidStart + "Surname for " + strPersonType + " " + intPersonTypeCount + msgGenericInvalidEnd);
//				objSurname.focus();
//				return false;
//			}
//						
//		} 
//	}
//
//	var objContactPhoneHome		= glbGetElementById(glbContactPhoneHome);
//	var objContactPhoneAway		= glbGetElementById(glbContactPhoneAway);
//	var objContactEmail			= glbGetElementById(glbContactEmail);
//
//	if (!checkRequiredField(objContactPhoneHome, "phone number", true, "number")) return false;		
////==	if (!checkRequiredField(objContactPhoneAway, "phone number", true, "number")) return false;
//	if (!checkRequiredField(objContactEmail, "Email address", false, "email")) return false;
//	
//	return true; 
//} 

function refreshThings() {    parent.location.href=parent.location.href;
}
function add_names() {    parent.location.href='171032?020830115252.10.1.0.1';
}


function getElByName(name,occurrence)
{
	if (isIE4)
	{
		var col;

		// assume that we want an INPUT element
		col = document.all.tags("INPUT");

		var i,nCount;

		nCount = 0;

		for (i = 0;i < col.length;i++)
		{
			if (col[i].name == name)
			{
				nCount ++;
				if (nCount == occurrence || occurrence == null)
				{
					return col[i];
				}
			}
		}
		
		// didn't find the requested element
		return null;
	}
	else
	{
		return document.getElementsByName(name);
	}
}
function getElsByTagName(tagName)
{
	if (isIE4)
	{
		return document.all.tags(tagName);
	}
	else
	{
		return document.getElementsByTagName(tagName);
	}

}

function checkFormPage42()
{

}
function checkFormPage4()
{
//	var col = document.getElementsByTagName("input");
	var sel = getElsByTagName("select");
	var col = getElsByTagName("input");
	var i;
	var bFirstNameErr,bLastNameErr,bIDErr,bEmailErr,bCarErr,bLegalErr;
	
	bFirstNameErr = bLastNameErr = bIDErr = bEmailErr = bCarErr = bLegalErr = 0;

	for (i = 0;i < col.length;i++)
	{
		var strName = col[i].name;
		strName = strName.substring(0,3);

        // to make sure it contains more than spaces
        strCheck = col[i].value;
        var regexp = / /g;
        strCheck = strCheck.replace(regexp, "");
		
		// check the First name fields
		if (strName == "IME")
		{
			//if (col[i].value == null || col[i].value == "" || col[i].value.length < 2)
            if (strCheck == null || strCheck == "" || strCheck.length < 2)
			{
				alert('Please fill out the names of all passengers flying.\n(must be at least 2 characters long)');
				return false;
			}
		}
		
		// check the Last name fields
		if (strName == "PRE")
		{
			//if (col[i].value == null || col[i].value == "" || col[i].value.length < 2)
            if (strCheck == null || strCheck == "" || strCheck.length < 2)
			{
				alert('Please fill out the last names of all passengers flying.\n(must be at least 2 characters long)');
				return false;
			}
		}
	
		// check the ID/Passport fields	
//		if (strName == "PAS")
//		{
//			if (col[i].value == null || col[i].value == "")
//			{
//				alert('Please fill out the ID/Passport numbers of all passengers flying.');
//				return false;
//			}
//		}
		
         // check the PHONE fields 
         if (strName == "PHO")
         {

			//if (col[i].value == null || col[i].value == "")
            if (strCheck == null || strCheck == "" || strCheck.length < 2)
			{
				alert('Please enter a valid phone number.');
				return false;
			}
         }
         
		// check the Email field
		if (strName  == "EMA")
		{
			if (col[i].value == null || col[i].value == "" || col[i].value.length < 5 || col[i].value.search("@") == -1)
			{
				alert('Please fill in a valid Email address.');
				return false;
			}
		}	
	}

	for (i = 0;i < sel.length;i++)
	{
		var selName = sel[i].name;
		selName = selName.substring(0,3);
		if (selName == "PTC")
		{
			var infantAge = sel[i].selectedIndex
			if (infantAge < '1')
			{
				alert('Please enter an age for the infant');
				return false;
			}
		}
	}
	var objSubmitButton =	 glbGetElementById("submitButton");	
	objSubmitButton.disabled = true;
	
	return true;
}


//==	bool checkFormPage5() 
//
//==		returns true if the following tests are passed:
//==			has a valid card name
//==			has a valid card type
//==			has a valid card number
//==			has a valid card expiry month
//==			has a valid card expiry year
//==			has a valid card
//==			Home name / number entered
//==			Home street entered
//==			Home town entered
//==			Home postcode entered (if country UK)
//==			Country selected
//==			Email address entered and valid
//==			Booking terms have been accepted
//==			No field longer than 100 characters
//==		if any check fails, the relevant field is focused and the function
//==		returns false.

function checkFormPage5() {
	var objCardName				= glbGetElementById(glbCardNameName);

	var objCardType                         = glbGetElementById(glbCardTypeName);

	var objCardNumber			= glbGetElementById(glbCardNumberName);

	var objCardExpiryMonth		= glbGetElementById(glbCardExpiryMonthName);
	var objCardExpiryYear		= glbGetElementById(glbCardExpiryYearName);
//	var objCardIssueNumber		= glbGetElementById(glbCardIssueNumberName);
//	var objBillHouse			= glbGetElementById(glbBillHouseName);
//	var objBillStreet			= glbGetElementById(glbBillStreetName);
//	var objBillTown				= glbGetElementById(glbBillTownName);
//	var objBillPostcode			= glbGetElementById(glbBillPostcodeName);
//	var objBillCountry			= glbGetElementById(glbBillCountryName);
//	var objBillEmail			= glbGetElementById(glbBillEmailName);
	var objBillTermsAccept		= glbGetElementById(glbBillTermsName);
	
//	var strBillCountry			= getFieldValue(objBillCountry);

	var blnPostcodeRequired = false;
	
	if (!checkRequiredField(objCardName, "Name for the Card", true, "")) return false;


	if (!checkRequiredField(objCardNumber, "Card number", true, "number")) return false;
	if (!checkRequiredField(objCardType, "Card type", true, "")) return false;
	if (!checkRequiredField(objCardExpiryMonth, "Card expiry month", true, "")) return false;
	if (!checkRequiredField(objCardExpiryYear, "Card expiry year", true, "")) return false;


	var strMonth = getFieldValue(objCardExpiryMonth);

	if (strMonth.substr(0,1) == "0")						//==	Remove padded zero	
		strMonth = strMonth.substr(1,1);
	var intMonth = parseInt(strMonth);
	
	var strYear = getFieldValue(objCardExpiryYear);
	if (strYear.length == 2) strYear = "20" + strYear;
	var intYear = parseInt(strYear);
	
	var intDaysMonth = daysInMonth(intMonth, intYear);
	
	var dteExpiryDate = new Date (intDaysMonth + " " + monthName(intMonth) + " " + intYear);
	var dteNow = new Date();
	
	if (dteNow > dteExpiryDate) {
		alert (msgInvalidExpiryDate);
		objCardExpiryMonth.focus();
		return false;
	}
	
//	if (!checkRequiredField(objCardIssueNumber, "Card Issue number", false, "number")) return false;

//	if (!checkRequiredField(objBillHouse, "Street address", true, "")) return false;
//	if (!checkRequiredField(objBillStreet, "Street", true, "")) return false;
//	if (!checkRequiredField(objBillTown, "Town", true, "")) return false;

//	if (strBillCountry == "UK") {		//==	Require the postcode for UK customers
//		blnPostcodeRequired = true;
//	} else {
//		blnPostcodeRequired = false;
//	}

//	if (!checkRequiredField(objBillPostcode, "Postcode", blnPostcodeRequired, "")) return false;
//	if (!checkRequiredField(objBillCountry, "Country", true, "")) return false;
//	if (!checkRequiredField(objBillEmail, "Email address", true, "email")) return false;

	if (!objBillTermsAccept.checked) {	//==	The user has not ticked the Terms box
		alert (msgAcceptTerms);
		objBillTermsAccept.focus();
		return false;
	}

	// if no error, disable submit button and return true
	var objSubmitButton =	 glbGetElementById("submitButton");	
	objSubmitButton.disabled = 'true';

	return true;

} 

//function openTermsWindow (url) {
//	
//	termsWindow = window.open(url,'Jet2tsandcs','scrollbars=yes,width=550,height=450,resizable=yes');
//	termsWindow.focus();	
//}





//== validation for LFF
function checkFormLFFIE4()
{
	var col = document.all.tags("INPUT");
	var i;
	var bSelect1 = false;
	var bSelect2 = false;

	for (i = 0;i < col.length;i++)
	{
	  if (col[i].name == "SELECT_LINE")
	  {
		if (col[i].checked)
		{
			bSelect1 = true;
		}
	  }
	  if (col[i].name == "SELECT_LINE2")
	  {
		if (col[i].checked)
		{
			bSelect2 = true;
		}
	  }
	}

	if (!(bSelect1 && bSelect2))
	{
		alert("Please select your flight(s)");
		return false;
	}

	return true;
}

function checkFormLFF(formObj)
{
	var objOrigin 			= formObj.ORIGIN;
	var objDestination 		= formObj.DESTINATION;
	var objDate           		= formObj.MONTHYEAR;
	var objRDate           		= formObj.RMONTHYEAR;
	var objDay			= formObj.DAY;
	var objRDay			= formObj.RDAY;
	var objAdults			= formObj.ADULTS;
	var objChildren			= formObj.KIDS;
	var objInfants			= formObj.INFANTS;
	var strOriginAirportValue	= getFieldValue(objOrigin);
	var strDestinationAirportValue	= getFieldValue(objDestination);
	var strAdultsValue		= getFieldValue(objAdults);
	var strChildrenValue		= getFieldValue(objChildren);
	var strInfantsValue		= getFieldValue(objInfants);

	if (formObj.action.indexOf('171015') > -1) {
		var strDate		= getDateValue(objDay, objDate);
		var strRDate		= getDateValue(objRDay, objRDate);

	   	if (formObj.DAY && !getFieldValue(objDay)) {
		        alert("Please select a departure date");
		        objDate.focus();
		       	return false;
	    	}
	
	   	if (formObj.RDAY && !getFieldValue(objRDay)) {
		        alert("Please select a return date");
		        objDate.focus();
		       	return false;
	    	}

	}
	else {
		var strDate		= getDateValue("", objDate);
		var strRDate		= getDateValue("", objRDate);
	}
	if (isIE4)
	{
		return checkFormLFFIE4();
	}

	if (strDestinationAirportValue == "" || strOriginAirportValue == "-1") {		//==	destination not selected
		alert(msgSelectCities);
		objOriginAirport.focus();
		return false;
	}

    	if (Date.parse(strDate) > Date.parse(strRDate)) {
        	if (objRDate) {
            		alert("Please select a departure date earlier than the return date");
            		document.forms[0].elements['MONTHYEAR'].focus();
            		return false;
        	}
    	}

	var intTotalParty = parseInt(strAdultsValue) + parseInt(strChildrenValue);

	if (intTotalParty > constMaxNumberPassengers) {						//==	Number in party more than Max number set
		alert(msgTooManyPeople);
		objAdults.focus();
		return false;
	}

	return true;
}



//== added 10/16/2003
//== copy of checkFormPage5() with address info commented

function checkFormChange4() {
	var objCardName				= glbGetElementById(glbCardNameName);

//var objCardType                         = glbGetElementById(glbCardTypeName);

	var objCardNumber			= glbGetElementById(glbCardNumberName);

	var objCardExpiryMonth		= glbGetElementById(glbCardExpiryMonthName);
	var objCardExpiryYear		= glbGetElementById(glbCardExpiryYearName);
	var objCardIssueNumber		= glbGetElementById(glbCardIssueNumberName);
//	var objBillHouse			= glbGetElementById(glbBillHouseName);
//	var objBillStreet			= glbGetElementById(glbBillStreetName);
//	var objBillTown				= glbGetElementById(glbBillTownName);
//	var objBillPostcode			= glbGetElementById(glbBillPostcodeName);
//	var objBillCountry			= glbGetElementById(glbBillCountryName);
	var objBillEmail			= glbGetElementById(glbBillEmailName);
	var objBillTermsAccept		= glbGetElementById(glbBillTermsName);
	
//	var strBillCountry			= getFieldValue(objBillCountry);

//	var blnPostcodeRequired = false;
	
	if (!checkRequiredField(objCardName, "Name for the Card", true, "")) return false;


	if (!checkRequiredField(objCardNumber, "Card number", true, "number")) return false;
	if (!checkRequiredField(objCardExpiryMonth, "Card expiry month", true, "")) return false;
	if (!checkRequiredField(objCardExpiryYear, "Card expiry year", true, "")) return false;
	
	var strMonth = getFieldValue(objCardExpiryMonth);

	if (strMonth.substr(0,1) == "0")						//==	Remove padded zero	
		strMonth = strMonth.substr(1,1);
	var intMonth = parseInt(strMonth);
	
	var strYear = getFieldValue(objCardExpiryYear);
	if (strYear.length == 2) strYear = "20" + strYear;
	var intYear = parseInt(strYear);
	
	var intDaysMonth = daysInMonth(intMonth, intYear);
	
	var dteExpiryDate = new Date (intDaysMonth + " " + monthName(intMonth) + " " + intYear);
	var dteNow = new Date();
	
	if (dteNow > dteExpiryDate) {
		alert (msgInvalidExpiryDate);
		objCardExpiryMonth.focus();
		return false;
	}
	
	if (!checkRequiredField(objCardIssueNumber, "Card Issue number", false, "number")) return false;

//	if (!checkRequiredField(objBillHouse, "Street address", true, "")) return false;
//	if (!checkRequiredField(objBillStreet, "Street", true, "")) return false;
//	if (!checkRequiredField(objBillTown, "Town", true, "")) return false;
//
//	if (strBillCountry == "UK") {		//==	Require the postcode for UK customers
//		blnPostcodeRequired = true;
//	} else {
//		blnPostcodeRequired = false;
//	}

//	if (!checkRequiredField(objBillPostcode, "Postcode", blnPostcodeRequired, "")) return false;
//	if (!checkRequiredField(objBillCountry, "Country", true, "")) return false;
	if (!checkRequiredField(objBillEmail, "Email address", true, "email")) return false;

	if (!objBillTermsAccept.checked) {	//==	The user has not ticked the Terms box
		alert (msgAcceptTerms);
		objBillTermsAccept.focus();
		return false;
	}
	var objSubmitButton =	 glbGetElementById("submitButton");	
	objSubmitButton.disabled = 'true';

	return true;
} 

function clearInput()
{
}
