function FormValidation()
{
		

	
	
				myOption = -1;
				for (i=document.frm.title.length-1; i > -1; i--)
				{
					
					if (document.frm.title[i].checked)
					{
						myOption = i; i = -1;
					}
				}
					
				if (myOption == -1)
				{
					alert("Please select title!");
					document.frm.focus();
					return false;
				}
				if(document.frm.fname.value=="")
				{
					alert("Please enter your first name!");
					document.frm.fname.focus();
					return false;
				}
				if(document.frm.fname.value.charAt(0)==' ')
				{
					alert("First name cannot start with space")
					document.frm.fname.focus();
					return false;
				}
											
				if(document.frm.lname.value=="")
				{
					alert("Please enter last name!");
					document.frm.lname.focus();
					return false;
				}
				if(document.frm.lname.value.charAt(0)==' ')
				{
					alert("Last name cannot start with space")
					document.frm.lname.focus();
					return false;
				}
				if(document.frm.address.value=="")
				{
					alert("Please enter address!");
					document.frm.address.focus();
					return false;
				}
				if(document.frm.address.value.charAt(0)==' ')
				{
					alert("Address cannot start with space")
					document.frm.address.focus();
					return false;
				}
				
				if(document.frm.tel_off.value.charAt(0)==' ')
				{
					alert("Office telephone number cannot start with space")
					document.frm.tel_off.focus();
					return false;
				}
				if(document.frm.tel_res.value=="")
				{
					alert("Please enter residence telephone number!");
					document.frm.tel_res.focus();
					return false;
				}
				if(document.frm.tel_res.value.charAt(0)==' ')
				{
					alert("Residence telephone number cannot start with space")
					document.frm.tel_res.focus();
					return false;
				}
				
				if(document.frm.mobile.value.charAt(0)==' ')
				{
					alert("Mobile number cannot start with space")
					document.frm.mobile.focus();
					return false;
				}
				var changeToNumberType=document.frm.mobile.value
				if(changeToNumberType!="")
				{
					if(changeToNumberType.charAt(0)!=9)
					{
						alert("Mobile number must start with the digit 9.")
						document.frm.mobile.select();
						document.frm.mobile.focus();
						return false; 
						
					}
					if(changeToNumberType.length !=10)
					{
						alert("Mobile number contains upto 10 digits.")
						document.frm.mobile.select();
						document.frm.mobile.focus();
						return false; 
					}
				}
				if(document.frm.fax_no.value.charAt(0)==' ')
				{
					alert("Fax number cannot start with space")
					document.frm.fax_no.focus();
					return false;
				}
				if(document.frm.email.value=="")
				{
					alert("Please enter email address!");
					document.frm.email.focus();
					return false;
				}
				var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
				var str=document.frm.email.value;
				if(document.frm.email.value=="" || filter.test(str)=="")
				{
					alert("please enter valid email address !");
					document.frm.email.select();
					document.frm.email.focus();
					return false;
					
				}
				//*****************Date Validation Script Here****************************
					
					var departdate=document.frm.deptdate.value;
					var departmonth=document.frm.deptmonth.value;
					var departyear=document.frm.deptyear.value;
					
					var arrivedate=document.frm.arrdate.value
					var arrivemonth=document.frm.arrmonth.value
					var arriveyear=document.frm.arryear.value	
					
					var d = new Date();
					var curr_date = d.getDate();
					var curr_month = d.getMonth();
					var curr_year = d.getFullYear();
					
					var d1 = new Date(departyear,departmonth,departdate);
					var curr_date1 = d1.getDate();
					var curr_month1 = d1.getMonth();
					var curr_year1 = d1.getFullYear();
					
					var d2 = new Date(arriveyear,arrivemonth,arrivedate);
					var curr_date2 = d2.getDate();
					var curr_month2 = d2.getMonth();
					var curr_year2 = d2.getFullYear();
					
					ddt0=new Date(curr_year,curr_month,curr_date);
					ddt1=new Date(curr_year1,curr_month1-1,curr_date1);
					ddt2=new Date(curr_year2,curr_month2-1,curr_date2);
				
				//***************End of Date Validation Script Here ********************
				
				
			 	if(document.frm.flights.value=="flights")
				{
					
											
						myOption = -1;
						for (i=document.frm.trip.length-1; i > -1; i--)
						{
							
							if (document.frm.trip[i].checked)
							{
								myOption = i; i = -1;
							}
						}
							
						if (myOption == -1)
						{
							alert("Please select trip!");
							document.frm.focus();
							return false;
						}
						if(myOption=='0')
						{
								if(document.frm.origin.value=="Origin" || document.frm.origin.value=="")
								{
									alert("Please enter the city you will be departing from!");
									document.frm.origin.focus();
									return false;
								}
								if(document.frm.origin.value.charAt(0)==' ')
								{
									alert("Departing city cannot start with space")
									document.frm.origin.focus();
									return false;
								}
								if(document.frm.destination.value=="Destination" || document.frm.destination.value=="")
								{
									alert("Please enter your destination !");
									document.frm.destination.focus();
									return false;
								}
								if(document.frm.destination.value.charAt(0)==' ')
								{
									alert("Destination cannot start with space")
									document.frm.destination.focus();
									return false;
								}
																
								if(departdate=="")
								{
									alert("Please select departure date!");
									document.frm.deptdate.focus();
									return false;
								}
															
								if(departmonth=="")
								{
									alert("Please select departure month!");
									document.frm.deptmonth.focus();
									return false;
								}
								
								if ((departmonth==4 || departmonth==6 || departmonth==9 || departmonth==11) && departdate==31) 
								{
									alert("Month "+ departmonth +" doesn't have 31 days!");
									document.frm.deptdate.focus();
									return false;
								}
								
								if (departmonth == 2) 
								{ // check for february 29th
									var isleap = (departyear % 4 == 0 && (departyear % 100 != 0 || departyear % 400 == 0));
									if (departdate>29 || (departdate==29 && !isleap)) 
										{
											alert("February " + departyear + " doesn't have " + departdate + " days!");
											document.frm.deptdate.focus();
											return false;
										}	
								}
								if(departyear=="")
								{
									alert("Please select departure year!");
									document.frm.deptyear.focus();
									return false;
								}
								
								//var arrive=arrdate+arrmonth+arryear
								if(ddt0 > ddt1)
								{
									alert("Departure date should not be less than your Current date!");
									return false;
								}

								if(arrivedate=="")
								{
									alert("Please select arrival date!");
									document.frm.arrdate.focus();
									return false;
								}
								
								if(arrivemonth=="")
								{
									alert("Please select arrival month!");
									document.frm.arrmonth.focus();
									return false;
								}
								
								if ((arrivemonth==4 || arrivemonth==6 || arrivemonth==9 || arrivemonth==11) && arrivemonth==31) 
								{
									alert("Month "+ arrivemonth +" doesn't have 31 days!");
									document.frm.arrdate.focus();
									return false;
								}
								
								if (arrivemonth == 2) 
								{ // check for february 29th
									var isleap = (arriveyear % 4 == 0 && (arriveyear % 100 != 0 || arriveyear % 400 == 0));
									if (arrivedate>29 || (arrivedate==29 && !isleap)) 
										{
											alert("February " + arriveyear + " doesn't have " + arrivedate + " days!");
											document.frm.arrdate.focus();
											return false;
										}	
								}
								
								
								if(arriveyear=="")
								{
									alert("Please select arrival year!");
									document.frm.arryear.focus();
									return false;
								}
								
										
								if(ddt1 > ddt2)
								{
											
									alert("Arrival date should not be less than your Departure date!");
									return false;
								}
								
						}//Trip=round_trip
						if(myOption=='1')
						{
							
								if(document.frm.origin.value=="Origin" || document.frm.origin.value=="")
								{
									alert("Please enter the city you will be departing from!");
									document.frm.origin.focus();
									return false;
								}
								if(document.frm.origin.value.charAt(0)==' ')
								{
									alert("Departing city cannot start with space")
									document.frm.origin.focus();
									return false;
								}
								if(document.frm.destination.value=="Destination" || document.frm.destination.value=="")
								{
									alert("Please enter your destination !");
									document.frm.destination.focus();
									return false;
								}
								if(document.frm.destination.value.charAt(0)==' ')
								{
									alert("Destination cannot start with space")
									document.frm.destination.focus();
									return false;
								}
								
								if(departdate=="")
								{
									alert("Please select departure date!");
									document.frm.deptdate.focus();
									return false;
								}
								
								
								if(departmonth=="")
								{
									alert("Please select departure month!");
									document.frm.deptmonth.focus();
									return false;
								}
								if ((departmonth==4 || departmonth==6 || departmonth==9 || departmonth==11) && departmonth==31) 
								{
									alert("Month "+ departmonth +" doesn't have 31 days!");
									document.frm.deptdate.focus();
									return false;
								}
								
								if (departmonth == 2) 
								{ // check for february 29th
									var isleap = (departyear % 4 == 0 && (departyear % 100 != 0 || departyear % 400 == 0));
									if (departdate>29 || (departdate==29 && !isleap)) 
										{
											alert("February " + departyear + " doesn't have " + departdate + " days!");
											document.frm.deptdate.focus();
											return false;
										}	
								}
								if(departyear=="")
								{
									alert("Please select departure year!");
									document.frm.departyear.focus();
									return false;
								}
								
								if(ddt0 > ddt1)
								{
									alert("Departure date should not be less than your Current date!");
									return false;
								}

								
						}
				}
				
							
}
function charonly(e)
	{
		
		var unicode=e.charCode? e.charCode : e.keyCode
		if (unicode!=8)
			{
				if (unicode!=32 && (unicode<65 || (unicode>90 && (unicode<97 || unicode>122))))
				return false
			}
	}
	//Catch Characters & Special Character Keys.....
function numbersonly(e)
	{
		var unicode=e.charCode? e.charCode : e.keyCode
		if (unicode!=8)
			{
				if (unicode<48||unicode>57) 
				return false
			}
	}


	
