<!--

function isblank(s)
{
    for(var i = 0; i < s.length; i++) {
        var c = s.charAt(i);
        if ((c != ' ') && (c != '\n') && (c != '\t')) return false;
    }
    return true;
}
function isValidEmail(e)
{
	var alnum="a-zA-Z0-9";
	exp="^[^@\\s]+@(["+alnum+"+\\-]+\\.)+["+alnum+"]["+alnum+"]["+alnum+"]?$";
	emailregexp = new RegExp(exp);

	result = e.match(emailregexp);
	if (result != null)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function isValidNumber(numval)
{
	if (numval==""){return false;}
	var myRegExp = new RegExp("^[/+|/-]?[0-9]*[/.]?[0-9]*$");
	return myRegExp.test(numval);
}


function validate()
{
var check1,check2,flag;
var url;
url=window.location.href;
document.tripForm.url.value=url;

var cName = document.tripForm.S_name.value;
var lName = document.tripForm.L_name.value;
var cCountry = document.tripForm.S_country.value;
var cPhone = document.tripForm.S_phone.value;
var cCarType = "";
var cCar ="";

var arDate=parseInt(document.tripForm.Date_of_travel.value);
var arMonth=parseInt(document.tripForm.Month_of_travel.value);
var arYear=parseInt(document.tripForm.Year_of_travel.value);

var noAdult=parseInt(document.tripForm.Number_of_adults.value);
var noChild=parseInt(document.tripForm.Number_of_children.value);

var cRequirements = document.tripForm.Description.value;



flag=true;

//date validation
	todayDate=new Date();
	thisday=todayDate.getDay();
		
	thismonth=todayDate.getMonth()+1;
	thisdate=todayDate.getDate();
	thisyear=todayDate.getFullYear();
	
	if(arYear<thisyear)
	{
		
		alert("Please enter Valid Year");
		flag=false;
		document.tripForm.Year_of_travel.focus();
		return false;
									
	}
	else
	{
		if(arYear==thisyear)
		{
					
			if(arMonth<thismonth)
			{
				alert("Month Error");
				flag=false;
				document.tripForm.Month_of_travel.focus();
				return false;
									
			}
			else
			{
			
				if(arMonth==thismonth)
				{
					if(arDate<=thisdate)
					{
						if(deDate<=arDate)
						{
							alert("Date error");
							flag=false;
							document.tripForm.Date_of_travel.focus();
							return false;
						}
					}
								
		
				}
				else
				{
					flag=true;
				}
	
				flag=true;
			}	
		
			flag=true;
	}

}
		
		
// date validation ends





//validation country field
if(cName=="")
{
	alert("Please enter your Name");
	flag=false;
	document.tripForm.S_name.focus()
	return false;
}

if (!isValidEmail(document.getElementById("S_email").value))
	{
		alert("Enter Valid Email ID!");
		document.getElementById("S_email").focus();
		return false;
	}

//validation country field
if(cCountry==0)
{
	alert("Please Select your Country");
	flag=false;
	document.tripForm.S_country.focus()
	return false;
}


//validation Car required field

if (!isValidNumber(document.getElementById("S_phone").value))
	{
		alert("Enter Valid Phone Number!");
		document.getElementById("S_phone").focus();
		return false;
	}
	
if (isblank(document.getElementById("Description").value))
	{
		alert("Enter Comments!");
		document.getElementById("Description").focus();
		return false;
	}	
	
if (document.tripForm.BotBootInput.value!=specimanSignature)
	{
		alert("Spam Validation Failed!");
		document.tripForm.BotBootInput.focus();
		newSpeciman();
		return false;
	}


if(flag==true)
	{
	
	document.tripForm.submit();
	}

}




// end the hiding comment -->

