function checkDate(){
	
var currentTime = new Date();
var months=new Array(12);
months[0]="January";
months[1]="February";
months[2]="March";
months[3]="April";
months[4]="May";
months[5]="June";
months[6]="July";
months[7]="August";
months[8]="September";
months[9]="October";
months[10]="November";
months[11]="December";
var month = months[currentTime.getMonth()];
var day = currentTime.getDate();
var year = currentTime.getFullYear();
var month1=document.bookingForm1.jmonth.value;
var day1=document.bookingForm1.jday.value;
var year1=document.bookingForm1.jyear.value;


if(month==month1&&day==day1&&year==year1)
{
alert("Sorry,For sameday booking please call us on 0208 577 0009 now");
}

}
function updatefromto(){
	if(document.form1.srcOption.value=='FRM_LHA')
		document.getElementById('frmdiv').innerHTML='To';
	else
		document.getElementById('frmdiv').innerHTML='From';
}

function check(){

	if((document.forms[0].id.value)	!='search')
	{
		document.getElementById('message').innerHTML="";
		document.forms[0].submit();
	}else{
		document.getElementById('message').innerHTML="Please Select Location ..";
	}
}


function quickBooking(id){
	document.forms[1].action="bookingStep1.php"
	document.forms[1].id.value	=id;	
	document.forms[1].submit();	
}


function acceptQuote(vtype){

	document.bookingForm.vtype.value=vtype;
	
	if(document.bookingForm.updatedTravelType.value=="")
	{
		alert("Please select a Quote to book now..");
		return false;
	}else{
		document.bookingForm.submit();	
	}

}


function updateRadio(ttype){

	
	document.bookingForm.updatedTravelType.value=ttype;
}




function validate_form2 ( )
{
	if(document.login.txtMail.value=="")
	{
		alert("Please fill in the Email id");
		return false;
	}
	var txtMailPat = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	var txtMailid=document.login.txtMail.value;
	var matchArray = txtMailid.match(txtMailPat);
	if (matchArray == null)
	{
		alert("Your email address seems incorrect. Please try again.");
		return false;
	}
	if (document.login.txtPass.value=="") {
		alert('Please enter password.');
		return false;
	}
}

function validate_form( )
{
	if ( document.formRegistration.txtname.value == "" )
	{
		alert ( "Please fill in the Company Name." );
		return false;
	}
	
	if ( document.formRegistration.txtAdd1.value == "" )
	{
		alert ( "Please fill in the Address." );
		return false;
	}
	
	if ( document.formRegistration.txtTown.value == "" )
	{
		alert ( "Please fill in the Town." );
		return false;
	}
	
	if ( document.formRegistration.txtPnumber2.value == "" )
	{
		alert ( "Please fill in the postcode." );
		return false;
	}
	
	if ( document.formRegistration.txtCntry.value == "" )
	{
		alert ( "Please fill in the Country." );
		return false;
	}
	
	if ( document.formRegistration.txtPnumber.value == "" )
	{
		alert ( "Please fill in the Contact No." );
		return false;
	}   
	
	if(document.formRegistration.txtMail.value=="")
	{
		alert("Please fill in the Email id");
		return false;
	}
	var txtMailPat = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	var txtMailid=document.formRegistration.txtMail.value;
	var matchArray = txtMailid.match(txtMailPat);
	if (matchArray == null)
	{
		alert("Your email address seems incorrect. Please try again.");
		return false;
	}

	if ( document.formRegistration.txtsname.value == "")
	{
		alert ( "Please fill in the Name." );
		return false;
	}
	
	if ( document.formRegistration.txtsPosition.value=="" )
	{
		alert ( "Please fill in your Position." );
		return false;
	}
	
	if (document.formRegistration.txtPass.value=="") {
		alert('Please enter password.');
		return false;
	}
	var invalid = " "; // Invalid character is a space
	var minLength = 6; // Minimum length
	var pw1 = document.formRegistration.txtPass.value;
	var pw2 = document.formRegistration.txtCnfPass.value;
	// check for a value in both fields.
	if (pw1 == '' || pw2 == '') {
		alert('Please re-Type your password.');
		return false;
	}
	// check for minimum length
	if (document.formRegistration.txtPass.value.length < minLength) {
		alert('Your password must be at least ' + minLength + ' characters long. Try again.');
		return false;
	}
	// check for spaces
	if (document.formRegistration.txtPass.value.indexOf(invalid) > -1) {
		alert("Sorry, spaces are not allowed.");
		return false;
	}else {
		if (pw1 != pw2) {
		alert ("You did not enter the same new password twice. Please re-enter your password.");
		return false;
		}
	}
	if (!document.formRegistration.terms.checked)
	{
		alert ( "Please accept terms to continue..." );
		return false;
	}
	document.formRegistration.submit();
}



function PAvalidate_form()
{
	if ( document.formRegistration.txtsname.value == "" )
	{
		alert ( "Please fill in the Your Name." );
		return false;
	}
	
	if ( document.formRegistration.txtAdd1.value == "" )
	{
		alert ( "Please fill in the Address." );
		return false;
	}
	
	if ( document.formRegistration.txtTown.value == "" )
	{
		alert ( "Please fill in the Town." );
		return false;
	}
	
	if ( document.formRegistration.txtPnumber2.value == "" )
	{
		alert ( "Please fill in the postcode." );
		return false;
	}
	
	if ( document.formRegistration.txtCntry.value == "" )
	{
		alert ( "Please fill in the Country." );
		return false;
	}
	
	if ( document.formRegistration.txtPnumber.value == "" )
	{
		alert ( "Please fill in the Contact No." );
		return false;
	}   
	
	if(document.formRegistration.txtMail.value=="")
	{
		alert("Please fill in the Email id");
		return false;
	}
	var txtMailPat = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	var txtMailid=document.formRegistration.txtMail.value;
	var matchArray = txtMailid.match(txtMailPat);
	if (matchArray == null)
	{
		alert("Your email address seems incorrect. Please try again.");
		return false;
	}

	
	if (document.formRegistration.txtPass.value=="") {
		alert('Please enter password.');
		return false;
	}
	var invalid = " "; // Invalid character is a space
	var minLength = 6; // Minimum length
	var pw1 = document.formRegistration.txtPass.value;
	var pw2 = document.formRegistration.txtCnfPass.value;
	// check for a value in both fields.
	if (pw1 == '' || pw2 == '') {
		alert('Please re-Type your password.');
		return false;
	}
	// check for minimum length
	if (document.formRegistration.txtPass.value.length < minLength) {
		alert('Your password must be at least ' + minLength + ' characters long. Try again.');
		return false;
	}
	// check for spaces
	if (document.formRegistration.txtPass.value.indexOf(invalid) > -1) {
		alert("Sorry, spaces are not allowed.");
		return false;
	}else {
		if (pw1 != pw2) {
		alert ("You did not enter the same new password twice. Please re-enter your password.");
		return false;
		}
	}
	if (!document.formRegistration.terms.checked)
	{
		alert ( "Please accept terms to continue..." );
		return false;
	}
	document.formRegistration.submit();
}






function summary1(){

	if(document.bookingForm1.txtsname.value==''){
		alert("Please fill passenger name");
		return false;
	}
	
	if(document.bookingForm1.txtMail.value==''){
		alert("Please fill email");
		return false;
	}else{
		var txtMailPat = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		var txtMailid=document.bookingForm1.txtMail.value;
		var matchArray = txtMailid.match(txtMailPat);
		if (matchArray == null)
		{
			alert("Your email address seems incorrect. Please try again.");
			return false;
		}	
	}
	
	
	if(document.bookingForm1.txtPnumber.value==''){
		alert("Please fill phone number");
		return false;
	}
	
	if(document.bookingForm1.srcOption.value!='FRM_LHA')
	{
		if(document.bookingForm1.txtPostcode.value==''){
			alert("Please fill postcode");
			return false;
		}
		
		if(document.bookingForm1.txtAddress.value==''){
			alert("Please fill address");
			return false;
		}
	}
	
	if(document.bookingForm1.jday.value=='day'||document.bookingForm1.jmonth.value=='month'){
		alert("Please fill date of travel");
		return false;
	}
	
	if(document.bookingForm1.jhour.value=='hour'||document.bookingForm1.jminutes.value=='minutes'){
		alert("Please fill time of travel");
		return false;
	}
	if(document.bookingForm1.travelType.value=='TWOWAY')
	{
		if(document.bookingForm1.rday.value=='day'||document.bookingForm1.rmonth.value=='month'){
			alert("Please fill date of travel");
			return false;
		}
		
		if(document.bookingForm1.phour.value=='hour'||document.bookingForm1.pminutes.value=='minutes'){
			alert("Please fill time of travel");
			return false;
		}
	}
	document.bookingForm1.submit();
}
