var reg_name = /^[a-zA-Z][a-zA-Z ]+$/;
var reg_phone = /^0?[0-9]{10}$/;
var reg_email = /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+$/; 
var reg_comments = /^[a-zA-Z]+$/;
function validate_contact_us()
{
	var ref_name = document.getElementById("txt_name");
	var ref_email = document.getElementById("txt_email");
	var ref_comments = document.getElementById("txtarea_comments");
	if(!ref_name.value.match(reg_name))
	{
		alert("Please enter the valid name");
		ref_name.select();
		return false;
	}
	else
	{
		ref_email.focus();
	}
	if(!ref_email.value.match(reg_email))
	{
		alert("Please enter the valid email Id");
		ref_email.select();
		return false;
	}
	else
	{
		ref_comments.focus();
	}
	if(!txtarea_comments.value.match(reg_comments))
	{
		alert("Please enter the comments");
		txtarea_comments.select();
		return false;
	}
	else
	{
		return true;
	}
}

function validate_hotels_booking()
{
	var reg_no_adult = /^[0-9]{1,2}$/;
	var reg_no_child = /^[0-9]*$/;
	var ref_name = document.getElementById("txt_name");
	var ref_email = document.getElementById("txt_email");
	var ref_phone = document.getElementById("txt_phone");
	var ref_check_in_date = document.getElementById("check_in_date");
	var ref_check_in_month= document.getElementById("check_in_month");
	var ref_check_in_year = document.getElementById("check_in_year");
	var ref_check_out_date= document.getElementById("check_out_date");
	var ref_check_out_month= document.getElementById("check_out_month");
	var ref_check_out_year= document.getElementById("check_out_year");
	var ref_rooms= document.getElementById("rooms");
	var ref_txt_no_people_adult= document.getElementById("txt_no_people_adult");
	var ref_txt_no_people_child= document.getElementById("txt_no_people_child");
	if(!ref_name.value.match(reg_name))
	{
		alert("Please enter the valid name");
		ref_name.select();
		return false;
	}
	else
	{
		ref_email.focus();
	}
	if(!ref_email.value.match(reg_email))
	{
		alert("Please enter the valid email Id");
		ref_email.select();
		return false;
	}
	if(!ref_phone.value.match(reg_phone))
	{
		alert("Please enter the valid phone no");
		ref_phone.focus();
		return false;
	}
	if(ref_check_in_year.value > ref_check_out_year.value )
	{
		alert("Please select the valid check in and check out date");
		ref_check_in_year.focus();
		return false;
	}
	if(ref_check_in_year.value == ref_check_out_year.value)
	{
		if(ref_check_in_month.value== ref_check_out_month.value)
		{
			if(ref_check_in_date.value < ref_check_out_date.value)
			{
			}
			else
			{
				alert("Please enter the valid check in and check out dates");
				ref_check_in_year.focus();
				return false;
			}
		}
	}
	
	if(!ref_txt_no_people_adult.value.match(reg_no_adult))
	{
		alert("Please enter the valid no of adults in\nNumeric Value e.g 0 1 2 3 ..");
		ref_txt_no_people_adult.focus();
		return false;
	}
	if(!ref_txt_no_people_child.value.match(reg_no_child))
	{
		alert("Please enter the valid no of child in numeric value");
		ref_txt_no_people_child.focus();
		return false;
	}
	return true;
}

function validate_ticketing()
{
	var reg_no_adult = /^[0-9]{1,2}$/;
	var reg_no_child = /^[0-9]*$/;
	var ref_name = document.getElementById("txt_name");
	var ref_email = document.getElementById("txt_email");
	var ref_phone = document.getElementById("txt_phone");
	var ref_type_travel_round_trip = document.getElementById("type_travel_round_trip");
	var ref_select_departing_from = document.getElementById("select_departing_from");
	var ref_select_destination = document.getElementById("select_destination");
	var ref_check_in_date = document.getElementById("check_in_date");
	var ref_check_in_month= document.getElementById("check_in_month");
	var ref_check_in_year = document.getElementById("check_in_year");
	var ref_check_out_date= document.getElementById("check_out_date");
	var ref_check_out_month= document.getElementById("check_out_month");
	var ref_check_out_year= document.getElementById("check_out_year");
	var ref_txt_no_people_adult= document.getElementById("txt_no_people_adult");
	var ref_txt_no_people_child= document.getElementById("txt_no_people_child");
	if(!ref_name.value.match(reg_name))
	{
		alert("Please enter the valid name");
		ref_name.select();
		return false;
	}
	else
	{
		ref_email.focus();
	}
	if(!ref_email.value.match(reg_email))
	{
		alert("Please enter the valid email Id");
		ref_email.select();
		return false;
	}
	if(!ref_phone.value.match(reg_phone))
	{
		alert("Please enter the valid Phone no");
		ref_phone.select();
		return false;
	}

	if(ref_select_departing_from.value = "")
	{
		ref_select_departing_from.select();
		alert("Please select the departing from");
		return false;
	}
	if(ref_select_destination.value = "")
	{
		ref_select_destination.focus();
		alert("Please enter the destination");
		return false;
	}
	if(ref_check_in_year.value > ref_check_out_year.value )
	{
		alert("Please select the valid check in and check out date");
		ref_check_in_year.focus();
		return false;
	}
	if(ref_check_in_year.value == ref_check_out_year.value)
	{
		if(ref_check_in_month.value== ref_check_out_month.value)
		{
			if(ref_check_in_date.value < ref_check_out_date.value)
			{
			}
			else
			{
				alert("Please enter the valid check in and check out dates");
				ref_check_in_year.focus();
				return false;
			}
		}
	}
	
	if(!ref_txt_no_people_adult.value.match(reg_no_adult))
	{
		alert("Please enter the valid no of adults in\nNumeric Value e.g 0 1 2 3 ..");
		ref_txt_no_people_adult.focus();
		return false;
	}
	if(!ref_txt_no_people_child.value.match(reg_no_child))
	{
		alert("Please enter the valid no of child in numeric value");
		ref_txt_no_people_child.focus();
		return false;
	}
}