

//----------------- from iwl_common_functions.js -----------------

var win

//*****************************************************************************************
function HighlightCell( obj, flag, pointer )
{

/*	// cell. */


//	test.borderColor = "red"

//	if ( flag = 1)
//	 alert( obj.id + " " +  obj.tagName )

		alert( 'test: ' + obj.tagName )

	if ( obj.tagName == "TD" )
	{

		switch ( flag )
		{
			case 1:
				// test.bgColor = "blue"
				// test.style.backgroundColor = "blue"
				// test.style.color = "yellow"
				if ( obj.id != "test" )
				{
				
				obj.style.backgroundColor = "lightsteelblue"
				obj.style.color = "yellow"
				}
				// test.style.borderColor = "grey"
				// test.style.textDecoration = "none"
				break
				
			case 0:
				// test.style.backgroundColor = "green"
				// test.style.color = "blue"
				alert( 'test: ' + flag )
				if ( obj.id != "test" )
				{
				// obj.style.backgroundColor = "white"
				// obj.style.color = "gray"
				obj.style.backgroundColor = "#000FF"
				obj.style.color = "white"
				}
				else
					{
					obj.style.backgroundColor = "#000FF"
					obj.style.color = "white"
					}
				// test.style.borderColor = "grey"
				// test.style.textDecoration = "none"
				break
		}	
	
		switch (pointer)
		{
			case 0:
//				test.style.cursor = ""
				obj.style.cursor = ""
				break	
			
			case 1:
//				test.style.cursor = "pointer"
				obj.style.cursor = "pointer"
				break
			
	
	
		}
	}

}

// function LinkTo(url, mode, xpos, ypos, height, width, name)

//*****************************************************************************************
function LinkTo( sUrl, sWinName, iWinLeftPos, iWinTopPos, iWinWidth, iWinHeight, sScroll, sResize  )
{

	var varName = 'BestSelect'
	var varFeatures = 'width=300,height=300,top=150,left=150'
	var h = '300'
	var w = '300'
	var LeftPosition = '50'
	var TopPosition = '50'
	var scroll = 'no'		// 'yes'
	var mypage = 'http://www.cnn.com'
	var myname = 'RamiTesting'
	var ScreenWidth
	var ScreenHeight
	
/**************** New *******************************/

	varFeatures = 'height='+h+',width='+w+',top='+TopPosition+',	\
				left='+LeftPosition+',scrollbars='+scroll+',resizable'

	varFeatures = 'height=' + iWinHeight.ToString
	varFeatures += ',width='+ iWinWidth.ToString
	varFeatures += ',top=' + TopPosition
	varFeatures += ',left=' + LeftPosition
	// if ( sScroll == 'Y' )
	varFeatures += ',scrollbars=' + sScroll
	if ( sResize == 'Y' )
		varFeatures += ',resizable'

// settings =
// 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'

// alert(settings)
// win = window.open(mypage,myname,settings)

	ScreenWidth = screen.Height
	ScreenHeight = screen.width
	
	// LeftPosition = ScreenWidth - w/2
	LeftPosition = ScreenWidth -60
	TopPosition = 1

	varFeatures = 'height='+h+',width='+w+',top='+TopPosition+',	\
				left='+LeftPosition+',scrollbars='+scroll+',resizable'

	win = window.open( sUrl , sWinName, varFeatures)	// ,'width=100,height=100,top=100,left=100')
	// window.location = url

// win = window.open(mypage,myname,settings)

	return win


}

function CloseWindow( w )
{
	win.close
}




//-----------------------------------------------------------------

<!--Ulead(R) RollOverButton(TM) 1.0 Generated JavaScript. Please do not edit.
nMaxItem = 4;
NameIndex = 0;
DefaultState = 1;

MouseOverState = 2;
MouseDownState = 3;
imgCounter = 0;

ImageList = new Array();

bIsSupportOK = (
	((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 )) ||
	((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ))
);

function AddImageToImageList(name, Default, MouseOver, MouseDown)
{
	ImageList[imgCounter] = new Array(nMaxItem);
	ImageList[imgCounter][NameIndex] = name;
	ImageList[imgCounter][DefaultState] = new Image();
	ImageList[imgCounter][DefaultState].src = Default;
	if (MouseOver != "") {
		ImageList[imgCounter][MouseOverState] = new Image();
		ImageList[imgCounter][MouseOverState].src = MouseOver;
	}
	if (MouseDown != "") {
		ImageList[imgCounter][MouseDownState] = new Image();
		ImageList[imgCounter][MouseDownState].src = MouseDown;
	}

	imgCounter++;
}

function ReplaceImage(name, state)
{
	for (i = 0; i < imgCounter; i++) {
		if (document.images[ImageList[i][NameIndex]] != null) {
			if ((name == ImageList[i][NameIndex]) && (ImageList[i][state] != null))
				document.images[name].src = ImageList[i][state].src;
		}
	}
}

// ------------
// . First:
// . You can copy the "AddImageToImageList(...)" script and
// . paste it into your HTML file to compile and
// . define your rollover button.
// . ------------

AddImageToImageList("tag_book_a_car_now_new", "images/book_a_car_now_new_normal.jpg", "images/book_a_car_now_new_over.jpg", "images/book_a_car_now_new_down.jpg");

// ------------>


function PrevPage()
{

	window.history.back()

}


function HighlightCell( obj, flag, pointer )
{


// alert( 'test: ' + obj.tagName )

	if ( obj.tagName == "TD" )
	{

//		alert( 'Flag: ' + flag + ' ID: ' +  obj.id )

		switch ( flag )
		{
			case 1:
//				if ( obj.id != "test" )
//				{
//				obj.style.backgroundColor = "lightsteelblue"
//				obj.style.color = "yellow"
				// alert( 'Flag: ' + flag + ' ID: ' +  obj.id )
				// #808080
				obj.style.backgroundColor = "#808080"
				// obj.style.backgroundColor = "lightsteelblue"
				obj.style.color = "#000080"
//				}
				break
				
			case 0:
//				if ( obj.id != "test" )
//				{
//				obj.style.backgroundColor = "white"
//				obj.style.color = "gray"
// 		alert( 'Flag: ' + flag + ' ID: ' +  obj.id )
				obj.style.backgroundColor = "blue"
				obj.style.color = "white"
//				}
				break
		}	
	
		switch (pointer)
		{
			case 0:
				obj.style.cursor = ""
				break	
			
			case 1:
				obj.style.cursor = "pointer"
				break
	
	
		}
	}

}

function ChangePointer(obj, pointer)
{
		switch (pointer)
		{
			case 0:
				obj.style.cursor = ""
				break	
			
			case 1:
				obj.style.cursor = "pointer"
				break	
		}
}




// imported from book_car.asp
//*****************************************************************************************

function SetFocus()
	{
	document.frmBooking("txtName").focus()
	}

//*****************************************************************************************
// validate date and time
function ValidateDate()
{
	
	// date
	var InpDate = new Date(document.frmBooking.lstMonths.value + " " + document.frmBooking.lstDays.value +  ", " + document.frmBooking.lstYears.value)
	// alert( InpDate) 
	
	
	// var datea=new Date("September 8, 2003")
	var CurrDate = new Date()

//	alert( "Curr date: " + InpDate )	
//	alert( "Curr date: " + CurrDate )
//	alert( "Confirm Code: " + (InpDate - CurrDate) )
// ***** changed 01/08/7 to to problem with future pickup date booking
	if ( (InpDate - CurrDate) < -86400000 )
		return false
	else
		return true
			
}

//*****************************************************************************************


//*****************************************************************************************
function ValidateBookRetDate()
{

	// check date and time not in the past
	
	// date
	var InpDate = new Date(document.frmBooking.lstMonths.value + " " + document.frmBooking.lstDays.value +  ", " + document.frmBooking.lstYears.value)

	var InpRetDate = new Date(document.frmBooking.lstRetMonths.value + " " + document.frmBooking.lstRetDays.value +  ", " + document.frmBooking.lstRetYears.value)
	// alert( InpDate) 
	
	// var datea=new Date("September 8, 2003")
	// var CurrDate = new Date()
	
	// verify the rest of the 
	
	// alert(  InpDate - CurrDate )
//	if ( (InpDate - CurrDate) < -86400000 )
//	alert("Confirm Ret Code: " + (InpRetDate - InpDate))
//	if ( (InpRetDate - InpDate) < -86400000 )
		// alert(InpRetDate - InpDate)
//	if ( (InpRetDate - InpDate) < -86400000 )
	if ( InpRetDate < InpDate ) // changed 11/12/07 RG
		{
		return false
		}
	else
		return true
			
}
//*****************************************************************************************


//******************************* spam validation - 21/01/07 **************************************
function CheckSpam( sStr )
{
		sStr = sStr.toLowerCase()

		if ( sStr.indexOf( 'http:' ) > 0 )
			return false
		else
			if ( sStr.indexOf( 'viagra' ) > 0 )
				return false
			else
				if ( sStr.indexOf( 'cialis' ) > 0 )
					return false
				else
					return true

}
//******************************* spam validation - 21/01/07 **************************************


function ValidateBooking()
{

	var sErrMes, objForm, iErrFlag, objField, sFN, sErrMsg, sStr, sMess
	
	// alert("Please click to continue...")
	
	// objField = ""
	objForm = document.frmBooking
	sFN = ""
	sErrMsg = ""
	sStr = ""
	
	iErrFlag = true

	if ( objForm.txtName.value.length < 3 )
		{
		iErrFlag = false
		objField = document.frmBooking.txtName
		sFN = "txtName"
		objForm.txtName.className = "mandatory_field"
		}
	else
		{
		objForm.txtName.className = "valid_field"
		}
/*
	if ( objForm.txtLastName.value.length < 3 )
		{
		iErrFlag = false
		if ( sFN == "" )
			sFN = "txtLastName"
		objForm.txtLastName.className = "mandatory_field"	
		}
	else
		objForm.txtLastName.className = "valid_field"
*/

	if ( objForm.txtTel.value.length < 3 )
		{
		iErrFlag = false
		if ( sFN == "" )
			sFN = "txtTel"
		objForm.txtTel.className = "mandatory_field"
		}	
	else
		objForm.txtTel.className = "valid_field"

/**************** removed, RG, 27/04/2004 ***********************
	if ( objForm.txtAddress.value.length < 3 )
		{
		iErrFlag = false
		if ( sFN == "" )
			sFN = "txtAddress"
		objField = document.frmBooking.txtAddress
		objForm.txtAddress.className = "mandatory_field"
		}
	else
		{
		objForm.txtAddress.className = "valid_field"
		}
******************************************************************/

	// alert(document.frmBooking.txtCollectAddress.value + " " + document.frmBooking.txtCollectAddress.value.length)

	if ( objForm.txtEmail.value.length < 3 )
		{
		iErrFlag = false
		if ( sFN == "" )
			sFN = "txtEmail"
		objForm.txtEmail.className = "mandatory_field"
		}
	else
		{
		sStr = objForm.txtEmail.value
		if ( sStr.indexOf( '@' ) < 1 )
			{
			iErrFlag = false
			sErrMsg = "\n\nPlease ensure your E-mail address is valid. (user@domain)\n"
			if ( sFN == "" )
				sFN = "txtEmail"
			objForm.txtEmail.className = "mandatory_field"
			}
		else
			objForm.txtEmail.className = "valid_field"
		}

//------------- added 21/09/06 -------------------------------

	if ( document.frmBooking.lstDays.value  == "dd" )
		{
		iErrFlag = false
		objField = document.frmBooking.lstDays
		if ( sFN == "" )
			sFN = "lstDays"
		objForm.lstDays.className = "mandatory_field"
		}
	else
		{
		objForm.lstDays.className = "valid_field"
		}
	
	if ( document.frmBooking.lstMonths.value == "Month" )
		{
		iErrFlag = false
		objField = document.frmBooking.lstMonths
		if ( sFN == "" )
			sFN = "lstMonths"
		objForm.lstMonths.className = "mandatory_field"
		}
	else
		{
		objForm.lstMonths.className = "valid_field"
		}

	if ( ValidateDate() == false )
		{
		iErrFlag = false
		if ( sFN == "" )
			sFN = "lstDays"
		objForm.lstDays.className = "mandatory_field"
		objForm.lstMonths.className = "mandatory_field"
		objForm.lstYears.className = "mandatory_field"
		}
	else
		{
		objForm.lstDays.className = "valid_field"
		objForm.lstMonths.className = "valid_field"
		objForm.lstYears.className = "valid_field"
		objForm.lstHours.className = "valid_field"
		objForm.lstMinutes.className = "valid_field"
		}	

	if ( document.frmBooking.lstHours.value  == "hh" )
		{
		iErrFlag = false
		objField = document.frmBooking.lstHours
		if ( sFN == "" )
			sFN = "lstHours"
		objForm.lstHours.className = "mandatory_field"
		}
	else
		{
		objForm.lstHours.className = "valid_field"
		}
	
	if ( document.frmBooking.lstMinutes.value == "mm" )
		{
		iErrFlag = false
		objField = document.frmBooking.lstMinutes
		if ( sFN == "" )
			sFN = "lstMinutes"
		objForm.lstMinutes.className = "mandatory_field"
		}
	else
		{
		objForm.lstMinutes.className = "valid_field"
		}

//------------- the above added 21/09/06 -------------------------------

	if ( objForm.txtCollectAddress.value.length < 3 )
		{
		iErrFlag = false
		objField = document.frmBooking.txtCollectAddress
		if ( sFN == "" )
			sFN = "txtCollectAddress"
		objForm.txtCollectAddress.className = "mandatory_field"
		}
	else
		{
		// +++ added 21/01/07 to check for http: etc.
		sStr = objForm.txtCollectAddress.value
		// alert ("Checking address! " + sStr )
		if ( CheckSpam( sStr ) == false )
			{
			alert ("Check contents of Pickup address!")
			iErrFlag = false
			if ( sFN == "" )
				sFN = "txtCollectAddress"
			objForm.txtCollectAddress.className = "mandatory_field"
			}
			// ---
		else
			objForm.txtCollectAddress.className = "valid_field"
		}

	if ( objForm.txtDestAddress.value.length < 3 )
		{
		iErrFlag = false
		objField = document.frmBooking.txtDestAddress
		if ( sFN == "" )
			sFN = "txtDestAddress"
		objForm.txtDestAddress.className = "mandatory_field"
		}
	else
		{
		// +++ added 21/01/07 to check for http: etc.
		sStr = objForm.txtDestAddress.value
		// alert ("Checking address! " + sStr )
		if ( CheckSpam( sStr ) == false )
			{
			alert ("Check contents of Destination address!")
			iErrFlag = false
			if ( sFN == "" )
				sFN = "txtDestAddress"
			objForm.txtDestAddress.className = "mandatory_field"
			}
			// ---
		else
			objForm.txtDestAddress.className = "valid_field"
		}
		
// added R Gan, 15/02/2004
				
	sStr = objForm.lstCar.value
	if ( sStr.indexOf("select_car") >= 0 )
		{
		iErrFlag = false
		if ( sFN == "" )
			sFN = "lstCar"
		objForm.lstCar.className = "mandatory_field"
		}
	else
		objForm.lstCar.className = "valid_field"


	/******************************************************************/
	// added 25/05/2004
	/******************************************************************/
	sStr = objForm.lstRetDays.value
	sStrM = objForm.lstRetMonths.value
	sStrY = objForm.lstRetYears.value
	sStrH = objForm.lstRetHours.value
	sStrM = objForm.lstRetMinutes.value
	// alert(sStr)
	// alert(sStr.indexOf( 'dd' ))
	if ( ( sStr.indexOf( 'dd' ) < 0 ) && ( sStrM.indexOf( 'Month' ) < 0 ) && ( sStrY.indexOf( 'yyyy' ) < 0 )  && ( sStrH.indexOf( 'hh' ) < 0 )  && ( sStrM.indexOf( 'mm' ) < 0 ) )	// user selected return day
		{
		if ( ValidateBookRetDate() == false )
			{
			iErrFlag = false
			// alert("Incorrect Return date")
			if ( sFN == "" )
				sFN = "lstRetDays"
			}
		}
	
	/******************************************************************/


	if ( iErrFlag == false )
		{
		// alert("Please complete all the required details which are highlighted in red" + sErrMsg)
		// objField.focus()

		sMess = "To complete your order, please fill in all details highlighted in Red\n" // + sMess
		
		sMess = sMess + "\nPlease ensure also that:\n1. E-mail address format is name@domain\n2. Booking date requested isn't earlier than today\n3. If entered, the Return Date/Time is later than Collection Date/Time"
		
		sMess = sMess + "\n\nThe error occurred at the Cursor's location - click OK to resume\n"
		
		// sMess = sMess + "\n"
				sMess = sMess + "\nIf you experience difficulties in completing this form,\nor wish to book at a short notice, "
		sMess = sMess + "please contact us on:\nTel. +44 (0) 20 8930 9075, or "
		sMess = sMess + "E-mail: info@airportchauffeurcars.com\n"
		
		alert( sMess )
		
//		if ( ( navigator.appName.indexOf("Microsoft" ) >= 0 ) && (sFN == "") )
		if ( navigator.appName.indexOf("Microsoft" ) >= 0 )
			{
			// alert( "Microsoft Internet Explorer")
			objForm(sFN).focus()
			}
		else
			// objForm.getElementById(sFN).focus()
			// objForm(sFN).focus()
			document.frmBooking.txtName.focus()
			
		
		
		// objForm.txtTitle.focus()
		// document.frmBooking.item(objField).focus()
		// document.frmBooking.namedItem
		// document.frmBooking.focus
		}
	// else
	//	alert("Validation okay...")
		
	return iErrFlag

}

//*****************************************************************************************

function ValidateSpeedBooking()
{

	var sErrMes, objForm, iErrFlag, objField, sFN, sErrMsg, sStr, sMess
	
	// objField = ""
	objForm = document.frmBooking
	sFN = ""
	sErrMsg = ""
	sStr = ""
	
	iErrFlag = true

	if ( objForm.txtContactName.value.length < 3 )
		{
		iErrFlag = false
		objField = document.frmBooking.txtContactName
		sFN = "txtContactName"
		objForm.txtContactName.className = "mandatory_field"
		}
	else
		{
		objForm.txtContactName.className = "valid_field"
		}
/*
	if ( objForm.txtLastName.value.length < 3 )
		{
		iErrFlag = false
		if ( sFN == "" )
			sFN = "txtLastName"
		objForm.txtLastName.className = "mandatory_field"	
		}
	else
		objForm.txtLastName.className = "valid_field"
*/

	if ( objForm.txtTel.value.length < 3 )
		{
		iErrFlag = false
		if ( sFN == "" )
			sFN = "txtTel"
		objForm.txtTel.className = "mandatory_field"
		}	
	else
		objForm.txtTel.className = "valid_field"

	if ( objForm.txtEmail.value.length < 3 )
		{
		iErrFlag = false
		if ( sFN == "" )
			sFN = "txtEmail"
		objForm.txtEmail.className = "mandatory_field"
		}
	else
		{
		sStr = objForm.txtEmail.value
		if ( sStr.indexOf( '@' ) < 1 )
			{
			iErrFlag = false
			sErrMsg = "\n\nPlease ensure your E-mail address is valid. (user@domain)\n"
			if ( sFN == "" )
				sFN = "txtEmail"
			objForm.txtEmail.className = "mandatory_field"
			}
		else
			objForm.txtEmail.className = "valid_field"
		}

//------------- added 21/09/06 -------------------------------

	if ( document.frmBooking.lstDays.value  == "dd" )
		{
		iErrFlag = false
		objField = document.frmBooking.lstDays
		if ( sFN == "" )
			sFN = "lstDays"
		objForm.lstDays.className = "mandatory_field"
		}
	else
		{
		objForm.lstDays.className = "valid_field"
		}
	
	if ( document.frmBooking.lstMonths.value == "Month" )
		{
		iErrFlag = false
		objField = document.frmBooking.lstMonths
		if ( sFN == "" )
			sFN = "lstMonths"
		objForm.lstMonths.className = "mandatory_field"
		}
	else
		{
		objForm.lstMonths.className = "valid_field"
		}

	if ( ValidateDate() == false )
		{
		iErrFlag = false
		if ( sFN == "" )
			sFN = "lstDays"
		objForm.lstDays.className = "mandatory_field"
		objForm.lstMonths.className = "mandatory_field"
		objForm.lstYears.className = "mandatory_field"
		}
	else
		{
		objForm.lstDays.className = "valid_field"
		objForm.lstMonths.className = "valid_field"
		objForm.lstYears.className = "valid_field"
		objForm.lstHours.className = "valid_field"
		objForm.lstMinutes.className = "valid_field"
		}	

	if ( document.frmBooking.lstHours.value  == "hh" )
		{
		iErrFlag = false
		objField = document.frmBooking.lstHours
		if ( sFN == "" )
			sFN = "lstHours"
		objForm.lstHours.className = "mandatory_field"
		}
	else
		{
		objForm.lstHours.className = "valid_field"
		}
	
	if ( document.frmBooking.lstMinutes.value == "mm" )
		{
		iErrFlag = false
		objField = document.frmBooking.lstMinutes
		if ( sFN == "" )
			sFN = "lstMinutes"
		objForm.lstMinutes.className = "mandatory_field"
		}
	else
		{
		objForm.lstMinutes.className = "valid_field"
		}

//------------- the above added 21/09/06 -------------------------------
/*
	if ( objForm.txtCollectAddress.value.length < 3 )
		{
		iErrFlag = false
		objField = document.frmBooking.txtCollectAddress
		if ( sFN == "" )
			sFN = "txtCollectAddress"
		objForm.txtCollectAddress.className = "mandatory_field"
		}
	else
		{
		// +++ added 21/01/07 to check for http: etc.
		sStr = objForm.txtCollectAddress.value
		// alert ("Checking address! " + sStr )
		if ( CheckSpam( sStr ) == false )
			{
			alert ("Check contents of Pickup address!")
			iErrFlag = false
			if ( sFN == "" )
				sFN = "txtCollectAddress"
			objForm.txtCollectAddress.className = "mandatory_field"
			}
			// ---
		else
			objForm.txtCollectAddress.className = "valid_field"
		}
*/

	if ( objForm.txtDestAddress.value.length < 3 )
		{
		iErrFlag = false
		objField = document.frmBooking.txtDestAddress
		if ( sFN == "" )
			sFN = "txtDestAddress"
		objForm.txtDestAddress.className = "mandatory_field"
		}
	else
		{
		// +++ added 21/01/07 to check for http: etc.
		sStr = objForm.txtDestAddress.value
		// alert ("Checking address! " + sStr )
		if ( CheckSpam( sStr ) == false )
			{
			alert ("Check contents of Destination address!")
			iErrFlag = false
			if ( sFN == "" )
				sFN = "txtDestAddress"
			objForm.txtDestAddress.className = "mandatory_field"
			}
			// ---
		else
			objForm.txtDestAddress.className = "valid_field"
		}
		
// added R Gan, 15/02/2004
				
	sStr = objForm.lstCar.value
	if ( sStr.indexOf("select_car") >= 0 )
		{
		iErrFlag = false
		if ( sFN == "" )
			sFN = "lstCar"
		objForm.lstCar.className = "mandatory_field"
		}
	else
		objForm.lstCar.className = "valid_field"


	/******************************************************************/
	// added 25/05/2004
	/******************************************************************/
	sStr = objForm.lstRetDays.value
	sStrM = objForm.lstRetMonths.value
	sStrY = objForm.lstRetYears.value
	sStrH = objForm.lstRetHours.value
	sStrM = objForm.lstRetMinutes.value
	// alert(sStr)
	// alert(sStr.indexOf( 'dd' ))
	if ( ( sStr.indexOf( 'dd' ) < 0 ) && ( sStrM.indexOf( 'Month' ) < 0 ) && ( sStrY.indexOf( 'yyyy' ) < 0 )  && ( sStrH.indexOf( 'hh' ) < 0 )  && ( sStrM.indexOf( 'mm' ) < 0 ) )	// user selected return day
		{
		if ( ValidateBookRetDate() == false )
			{
			iErrFlag = false
			// alert("Incorrect Return date")
			if ( sFN == "" )
				sFN = "lstRetDays"
			}
		}
	
	/******************************************************************/


	if ( iErrFlag == false )
		{
		// alert("Please complete all the required details which are highlighted in red" + sErrMsg)
		// objField.focus()

		sMess = "To complete your order, please fill in all details highlighted in Red\n" // + sMess
		
		sMess = sMess + "\nPlease ensure also that:\n1. E-mail address format is name@domain\n2. Booking date requested isn't earlier than today\n3. If entered, the Return Date/Time is later than Collection Date/Time"
		
		sMess = sMess + "\n\nThe error occurred at the Cursor's location - click OK to resume\n"
		
		// sMess = sMess + "\n"
				sMess = sMess + "\nIf you experience difficulties in completing this form,\nor wish to book at a short notice, "
		sMess = sMess + "please contact us on:\nTel. +44 (0) 20 8930 9075, or "
		sMess = sMess + "E-mail: info@airportchauffeurcars.com\n"
		
		alert( sMess )
		
//		if ( ( navigator.appName.indexOf("Microsoft" ) >= 0 ) && (sFN == "") )
		if ( navigator.appName.indexOf("Microsoft" ) >= 0 )
			{
			// alert( "Microsoft Internet Explorer")
			objForm(sFN).focus()
			}
		else
			// objForm.getElementById(sFN).focus()
			// objForm(sFN).focus()
			document.frmBooking.txtName.focus()
			
		
		
		// objForm.txtTitle.focus()
		// document.frmBooking.item(objField).focus()
		// document.frmBooking.namedItem
		// document.frmBooking.focus
		}
	// else
	//	alert("Validation okay...")
		
	return iErrFlag

}

//*****************************************************************************************



// *************** from get_a_quote.asp ****************

function ValidateQuoteDate()
{

	// check date and time not in the past
	
	// date
	var InpDate = new Date(document.frmGetQuote.lstMonths.value + " " + document.frmGetQuote.lstDays.value +  ", " + document.frmGetQuote.lstYears.value)
	// alert( InpDate) 
	
	
	// var datea=new Date("September 8, 2003")
	var CurrDate = new Date()
	
	// alert(  InpDate - CurrDate )
	if ( (InpDate - CurrDate) < -86400000 )
		return false
	else
		return true
			
}
//*****************************************************************************************
function ValidateQuoteRetDate()
{

	// check date and time not in the past
	
	// date
	var InpDate = new Date(document.frmGetQuote.lstMonths.value + " " + document.frmGetQuote.lstDays.value +  ", " + document.frmGetQuote.lstYears.value)

	var InpRetDate = new Date(document.frmGetQuote.lstRetMonths.value + " " + document.frmGetQuote.lstRetDays.value +  ", " + document.frmGetQuote.lstRetYears.value)
	// alert( InpDate) 
	
	// var datea=new Date("September 8, 2003")
	// var CurrDate = new Date()
	
	// verify the rest of the 
	
	// alert(  InpDate - CurrDate )
//	if ( (InpDate - CurrDate) < -86400000 )
//	alert(InpRetDate - InpDate)
//	if ( (InpRetDate - InpDate) < -86400000 )
	if ( (InpRetDate - InpDate) < 0 )
		{
		// alert(InpRetDate - InpDate)
		return false
		}
	else
		return true
			
}
//*****************************************************************************************
function GetNavType()
{
	alert( navigator.appCodeName + " [" + navigator.appVersion + "." +  navigator.appMinorVersion + "]") 
	alert( navigator.appName )
}

//*****************************************************************************************
function ValidateQuote()
{

	var sErrMes, objForm, iErrFlag, objField, sFN, sErrMsg, sStr
	
	// objField = ""
	objForm = document.frmGetQuote
	sFN = ""
	sErrMsg = ""
	sStr = ""
	
	iErrFlag = true
	// changed 21/02/2004 - field name from txtFirstName to txtName
	if ( objForm.txtName.value.length < 3 )
		{
		iErrFlag = false
		objField = document.frmGetQuote.txtName
		sFN = "txtName"
		objForm.txtName.className = "mandatory_field"
		}
	else
		{
		objForm.txtName.className = "valid_field"
		}
	// removed 21/02/2004 
	/*
	if ( objForm.txtLastName.value.length < 3 )
		{
		iErrFlag = false
		if ( sFN == "" )
			sFN = "txtLastName"
		objForm.txtLastName.className = "mandatory_field"	
		}
	else
		objForm.txtLastName.className = "valid_field"
	*/

	if ( objForm.txtTel.value.length < 3 )
		{
		iErrFlag = false
		if ( sFN == "" )
			sFN = "txtTel"
		objForm.txtTel.className = "mandatory_field"
		}	
	else
		objForm.txtTel.className = "valid_field"


// added R Gan, 15/02/2004
				
	sStr = objForm.lstCar.value
	if ( sStr.indexOf("select_car") >= 0 )
		{
		iErrFlag = false
		if ( sFN == "" )
			sFN = "lstCar"
		objForm.lstCar.className = "mandatory_field"
		}
	else
		objForm.lstCar.className = "valid_field"


	if ( objForm.txtEmail.value.length < 3 )
		{
		iErrFlag = false
		if ( sFN == "" )
			sFN = "txtEmail"
		objForm.txtEmail.className = "mandatory_field"
		}
	else
		{
		sStr = objForm.txtEmail.value
		if ( sStr.indexOf( '@' ) < 1 )
			{
			iErrFlag = false
			sErrMsg = "\n\nPlease ensure your E-mail address is valid. (user@domain)\n"
			if ( sFN == "" )
				sFN = "txtEmail"
			objForm.txtEmail.className = "mandatory_field"
			}
		else
			objForm.txtEmail.className = "valid_field"
		}

	if ( objForm.txtAddress.value.length < 3 )
		{
		iErrFlag = false
		if ( sFN == "" )
			sFN = "txtAddress"
		objForm.txtAddress.className = "mandatory_field"
		}
	else
		{
		// +++ added 21/01/07 to check for http:
		sStr = objForm.txtAddress.value
		// alert ("Checking address! " + sStr )
		if ( CheckSpam( sStr ) == false )
			{
			alert ("Check contents of Pickup address!")
			iErrFlag = false
			if ( sFN == "" )
				sFN = "txtAddress"
			objForm.txtAddress.className = "mandatory_field"
			}
		// ---
		else
			objForm.txtAddress.className = "valid_field"
		}
	
	if ( objForm.txtItinerary.value.length < 3 )
		{
		iErrFlag = false
		if ( sFN == "" )
			sFN = "txtItinerary"
		objForm.txtItinerary.className = "mandatory_field"
		}
	else
		{
		// +++ added 21/01/07 to check for http:
		sStr = objForm.txtItinerary.value
		// alert ("Checking address! " + sStr )
		if ( CheckSpam( sStr ) == false )
			{
			alert ("Check contents of Destination Address!")
			iErrFlag = false
			if ( sFN == "" )
				sFN = "txtItinerary"
			objForm.txtItinerary.className = "mandatory_field"
			}
		// ---
		else	
			objForm.txtItinerary.className = "valid_field"
		}

	if ( ValidateQuoteDate() == false )
		{
		objForm.lstDays.className = "mandatory_field"
		objForm.lstMonths.className = "mandatory_field"
		objForm.lstYears.className = "mandatory_field"
		// alert("Incorrect date")
		iErrFlag = false
		if ( sFN == "" )
			sFN = "lstDays"
		}
	else
		{
		objForm.lstDays.className = "valid_field"
		objForm.lstMonths.className = "valid_field"
		objForm.lstYears.className = "valid_field"
		}	

	/******************************************************************/
	// added 03/05/2004
	/******************************************************************/
	sStr = objForm.lstRetDays.value
	sStrM = objForm.lstRetMonths.value
	sStrY = objForm.lstRetYears.value
	sStrH = objForm.lstRetHours.value
	sStrM = objForm.lstRetMinutes.value
	// alert(sStr)
	// alert(sStr.indexOf( 'dd' ))
	if ( ( sStr.indexOf( 'dd' ) < 0 ) && ( sStrM.indexOf( 'Month' ) < 0 ) && ( sStrY.indexOf( 'yyyy' ) < 0 )  && ( sStrH.indexOf( 'hh' ) < 0 )  && ( sStrM.indexOf( 'mm' ) < 0 ) )	// user selected return day
		{
		if ( ValidateQuoteRetDate() == false )
			{
			iErrFlag = false
			// alert("Incorrect Return date")
			if ( sFN == "" )
				sFN = "lstRetDays"
			}
		}
	
	/******************************************************************/


	if ( iErrFlag == false )
		{
		// alert("Please complete all the required details that are highlighted in red" + sErrMsg)
		// objField.focus()

		sMess = "To complete your quote request, please fill in all details highlighted in Red\n\n" // + sMess
		
		sMess = sMess + "\nPlease ensure that:\n1. E-mail address format is name@domain\n2. Collection date requested isn't earlier than today\n3. If entered, the Return Date/Time is later than Collection Date/Time"
		
		sMess = sMess + "\n"
				sMess = sMess + "\nIf you experience difficulties in completing this form,\nor wish to book at a short notice, "
		sMess = sMess + "please contact us on:\nTel. +44 (0) 20 8930 9075, or "
		sMess = sMess + "E-mail: info@airportchauffeurcars.com\n"

		alert(sMess)
		
		if ( navigator.appName.indexOf("Microsoft" ) >= 0 )
			{
			// alert( "Microsoft Internet Explorer")
			if ( sFN != "" )
				{ 
				objForm(sFN).focus()
				}
			else
				document.frmGetQuote.txtName.focus()
			}
		else
			// objForm.getElementById(sFN).focus()
			// objForm(sFN).focus()
			document.frmGetQuote.txtName.focus()
		
		
		// objForm.txtTitle.focus()
		// document.frmGetQuote.item(objField).focus()
		// document.frmGetQuote.namedItem
		// document.frmGetQuote.focus
		}
		
	return iErrFlag

}
//*****************************************************************************************
function ValidateAccApp()
{
	var sErrMes, objForm, iErrFlag, objField, sFN, sErrMsg, sStr
	
	// objField = ""
	objForm = document.frmAccApp
	sFN = ""
	sErrMsg = ""
	sStr = ""
	
	iErrFlag = true
	
	
	if ( objForm.txtContactName.value.length < 3 )
		{
		iErrFlag = false
		objField = document.frmAccApp.txtContactName
		sFN = "txtName"
		objForm.txtContactName.className = "mandatory_field"
		}
	else
		{
		objForm.txtContactName.className = "valid_field"
		}

	if ( objForm.txtTel.value.length < 3 )
		{
		iErrFlag = false
		objField = document.frmAccApp.txtTel
		sFN = "txtName"
		objForm.txtTel.className = "mandatory_field"
		}
	else
		{
		objForm.txtTel.className = "valid_field"
		}
		
/*		
	if ( objForm.txtEmail.value.length < 3 )
		{
		iErrFlag = false
		objField = document.frmAccApp.txtEmail
		sFN = "txtName"
		objForm.txtEmail.className = "mandatory_field"
		}
	else
		{
		objForm.txtEmail.className = "valid_field"
		}
*/
	if ( objForm.txtEmail.value.length < 3 )
		{
		iErrFlag = false
		if ( sFN == "" )
			sFN = "txtEmail"
		objForm.txtEmail.className = "mandatory_field"
		}
	else
		{
		sStr = objForm.txtEmail.value
		if ( sStr.indexOf( '@' ) < 1 )
			{
			iErrFlag = false
			sErrMsg = "\n\nPlease ensure your E-mail address is valid. (user@domain)\n"
			if ( sFN == "" )
				sFN = "txtEmail"
			objForm.txtEmail.className = "mandatory_field"
			}
		else
			objForm.txtEmail.className = "valid_field"
		}

	// +++ added 21/01/07
	if ( objForm.txtTradingAddress.value.length < 3 )
		{
		iErrFlag = false
		if ( sFN == "" )
			sFN = "txtTradingAddress"
		objForm.txtTradingAddress.className = "mandatory_field"
		}
	else
		{
		// +++ added 21/01/07 to check for http: etc.
		sStr = objForm.txtTradingAddress.value
		// alert ("Checking address! " + sStr )
		if ( CheckSpam( sStr ) == false )
			{
			alert ("Check contents of address!")
			iErrFlag = false
			if ( sFN == "" )
				sFN = "txtTradingAddress"
			objForm.txtTradingAddress.className = "mandatory_field"
			}
			// ---
		else
			objForm.txtTradingAddress.className = "valid_field"
		}
	// --- added 21/01/07

	
	// alert(objForm.chkAccept.checked)
	if ( objForm.chkAccept.checked != 1 )
		{
		iErrFlag = false
		objField = document.frmAccApp.chkAccept
		sFN = "chkAccept"
		// objForm.txtName.className = "mandatory_field"
		}
	else
		{
		// objForm.txtName.className = "valid_field"
		}

		
	if ( iErrFlag == false )
		{
		// alert("Please complete all the required details that are highlighted in red" + sErrMsg)
		// objField.focus()

		sMess = "To complete your application please fill in all essential details\n"
		sMess = sMess + "(in the Red boxes) and accept our Terms & Conditions\n" // + sMess		
		sMess = sMess + "\n"
				sMess = sMess + "\nIf you experience difficulties in completing this form, "
		sMess = sMess + "please contact us on:\nTel. +44 (0) 20 8930 9075, or "
		sMess = sMess + "\nE-mail: cs@airportchauffeurcars.com\n"

		alert(sMess)
		
		// if ( navigator.appName.indexOf("Microsoft" ) >= 0 )
			// {
			// alert( "Microsoft Internet Explorer")
			if ( sFN != "" )
				{ 
				// objForm(sFN).focus()
				document.frmAccApp.chkAccept.focus()
				// document.frmAccApp.txtRefTwo.focus()
				}
			// else
			//	document.frmGetQuote.txtFirstName.focus()
			// }
		// else
			// objForm.getElementById(sFN).focus()
			// objForm(sFN).focus()
			// document.frmGetQuote.txtFirstName.focus()
		
		
		// objForm.txtTitle.focus()
		// document.frmGetQuote.item(objField).focus()
		// document.frmGetQuote.namedItem
		// document.frmGetQuote.focus
		}
		
	return iErrFlag

}
//*****************************************************************************************