
function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid Email Address")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid Email Address")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid Email Address")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid Email Address")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid Email Address")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid Email Address")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid Email Address")
		    return false
		 }

 		 return true					
	}

function ValidateForm(){

	var name=document.form.fullname
	var contactForm=document.form.contactno
	var emailID=document.form.emailaddress
	var placeForm=document.form.arivalPlace
	var timeForm=document.form.arivalTime
	var personForm=document.form.noperson
	var childrenForm=document.form.nochildren

	if ((name.value==null)||(name.value=="")){
		alert("Please Enter Your Complete Name")
		name.focus()
		return false
	}
	
	if ((contactForm.value==null)||(contactForm.value=="")){
		alert("Please Enter Your Contact Number")
		contactForm.focus()
		return false
	}

//--------------------------email address validation-----------------------------
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter Email Address")
		emailID.focus()
		return false
	}
	
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
//--------------------------email address validation-----------------------------


	if ((placeForm.value==null)||(placeForm.value=="")){
		alert("Please Enter Arival Place")
		placeForm.focus()
		return false
	}
	
	if ((timeForm.value==null)||(timeForm.value=="")){
		alert("Please Enter Arival Time")
		timeForm.focus()
		return false
	}
	
	
	if ((personForm.value==null)||(personForm.value=="")){
		alert("Please Enter Number of Person")
		personForm.focus()
		return false
	}
	
	if ((childrenForm.value==null)||(childrenForm.value=="")){
		alert("Please Enter Number of Children 4-11 years old")
		childrenForm.focus()
		return false
	}
	
	



	
	
	
	return true
 }

