/*
-----------------------------------------------------------------------------
 Javascript Docoment (copyright -c- 2008, www.nepalmirror.com)
-------------------------------------------------------------------------------
The source code on this document is copyrighted to www.nepalmirror.com and any unauthorized use or publication may lead to severe criminal penalties according to the international cyber law.
*/
function reG(frm)
{
	var strPatt=/^[a-zA-Z-]+$/;
	var strrPatt=/^[a-zA-Z-]$/;
	var emailPatt=/^[_a-zA-Z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)+(.[a-z]{2,3})$/;
	//var noPatt = /^+[1-9]+[000-999]+$/;
	
	if(frm.txtNoOfGuests.value=="" || (isNaN(frm.txtNoOfGuests.value))){
		alert("Please Enter No. Of Guests");
		frm.txtNoOfGuests.style.background="#f8c752";
		frm.txtNoOfGuests.value="No. Here"
		frm.txtNoOfGuests.select();		
		return false;
	}
	
	if(frm.txtNoOfRooms.value=="" || (isNaN(frm.txtNoOfRooms.value))){
		alert("Please Enter No. Of Required Rooms");
		frm.txtNoOfRooms.style.background="#f8c752";
		frm.txtNoOfRooms.value="No. Here"
		frm.txtNoOfRooms.select();		
		return false;
	}
	
	if(frm.txtName.value=="" || frm.txtName.value=="<<Your Full Name Here Pls>>" || (frm.txtName.value.match(strPatt))){
		alert("Please Enter Your Full Name");		
		frm.txtName.style.background="#f8c752";
		frm.txtName.value="<<Your Full Name Here Pls>>";		
		frm.txtName.focus();
		frm.txtName.select();		
		return false;
	}
	
	if (frm.txtAddress.value=="" || frm.txtAddress.value=="<<Your Address Here Pls>>" || (frm.txtAddress.value.match(strrPatt))) {
		alert("Please Enter Your Address");
		frm.txtAddress.style.background="#f8c752";
		frm.txtAddress.value="<<Your Address Here Pls>>";
		frm.txtAddress.focus();
		frm.txtAddress.select();
		return false;
	}	
	if (frm.txtNation.value=="" || frm.txtNation.value=="<<Your Nationality Here Pls>>" || (frm.txtNation.value.match(strrPatt))) {
		alert("Please Enter Your Nationality");
		frm.txtNation.style.background="#f8c752";
		frm.txtNation.value="<<Your Nationality Here Pls>>";
		frm.txtNation.focus();
		frm.txtNation.select();
		return false;
	}
	if(frm.txtMail.value=="" || (!frm.txtMail.value.match(emailPatt))){
		alert("E-mail Field is Compoulsory\nPlease Enter a Valid E-mail\nEg:john_smith@yahoo.com");
		frm.txtMail.style.background="#f8c752";
		frm.txtMail.value="<<Your E-mail Here>>";		
		frm.txtMail.focus();
		frm.txtMail.select();
		return false;
	}
	if(frm.txtPhone.value=="" || frm.txtPhone.value=="<<Your Phone Here>>"){
		alert("Phone is also compoulsory to fill");
		frm.txtPhone.style.background="#f8c752";
		frm.txtPhone.value="<<Your Phone Here>>";
		frm.txtPhone.focus();
		frm.txtPhone.select();
		return false;
	}
}

