// JavaScript Document


//Feedback form


function validate_form()





{





	var f = document.form1;





	var emailID=document.form1.email;





	if (f.name.value=="")





    {





        alert ("Please enter your name");





		f.name.focus();





	    return false





    }





	else if ((emailID.value==null)||(emailID.value=="")){





		alert("Please enter your Email ID")





		emailID.focus()





		return false





	}


	else if (echeck(emailID.value)==false){





		emailID.value=""





		emailID.focus()





		return false





	}


	else if (f.security_code.value=="")





    {





        alert ("Please enter security code");





		f.security_code.focus();





	    return false





    }





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 E-mail ID")





		   return false





		}











		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){





		   alert("Invalid E-mail ID")





		   return false





		}











		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){





		    alert("Invalid E-mail ID")





		    return false





		}











		 if (str.indexOf(at,(lat+1))!=-1){





		    alert("Invalid E-mail ID")





		    return false





		 }











		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){





		    alert("Invalid E-mail ID")





		    return false





		 }











		 if (str.indexOf(dot,(lat+2))==-1){





		    alert("Invalid E-mail ID")





		    return false





		 }





		





		 if (str.indexOf(" ")!=-1){





		    alert("Invalid E-mail ID")





		    return false





		 }





	}





}











//Reservation form





function reservation_form()





{





	var f = document.form2;





	var emailID=document.form2.email;





	if (f.full_name.value=="")





    {





        alert ("Please enter your full name");





		f.full_name.focus();





	    return false





    }





	else if ((emailID.value==null)||(emailID.value=="")){





		alert("Please enter your Email ID")





		emailID.focus()





		return false





	}





	if (echeck(emailID.value)==false){





		emailID.value=""





		emailID.focus()





		return false





	}





	else if (f.phone.value=="")





    {





        alert ("Please enter phone number");





		f.phone.focus();





        return false





    }





	else if (f.fax.value=="")





    {





        alert ("Please enter fax number");





		f.fax.focus();





        return false





    }





	else if (f.address.value=="")





    {





        alert ("Please enter address");





		f.address.focus();





        return false





    }





	else if (f.city.value=="")





    {





        alert ("Please enter city");





		f.city.focus();





        return false





    }





	else if (f.state.value=="")





    {





        alert ("Please enter state");





		f.state.focus();





        return false





    }





	else if (f.zip.value=="")





    {





        alert ("Please enter zip code");





		f.zip.focus();





        return false





    }





	else if (f.country.value=="Select your Country")





    {





        alert("Please select country name");





		f.country.focus();





        return false;





    }





	else if (f.day.value=="day")





    {





        alert ("Please select day");





		f.day.focus();





        return false





    }





	else if (f.month.value=="month")





    {





        alert ("Please select month");





		f.month.focus();





        return false





    }





	else if (f.year.value=="year")





    {





        alert ("Please select year");





		f.year.focus();





        return false





    }





	else if (f.which_tour.value=="Choose Tour")





    {





        alert ("Please select your tour");





		f.which_tour.focus();





        return false





    }





	else if (f.hotel_villa.value=="")





    {





        alert ("Please enter Name & Address of your Hotel or Villa");





		f.hotel_villa.focus();





        return false





    }





	else if (f.hotel_villa_ph.value=="")





    {





        alert ("Please enter Phone (of Hotel/Villa)");





		f.hotel_villa_ph.focus();





        return false





    }





	else if (f.adults.value=="")





    {





        alert ("Please enter number of adults");





		f.adults.focus();





        return false





    }





	else if (f.children.value=="")





    {





        alert ("Please enter number of children");





		f.children.focus();





        return false





    }


	else if (f.security_code.value=="")





    {


        alert ("Please enter security code");





		f.security_code.focus();





        return false





    }








}











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 E-mail ID")





		   return false





		}











		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){





		   alert("Invalid E-mail ID")





		   return false





		}











		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){





		    alert("Invalid E-mail ID")





		    return false





		}











		 if (str.indexOf(at,(lat+1))!=-1){





		    alert("Invalid E-mail ID")





		    return false





		 }











		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){





		    alert("Invalid E-mail ID")





		    return false





		 }











		 if (str.indexOf(dot,(lat+2))==-1){





		    alert("Invalid E-mail ID")





		    return false





		 }





		





		 if (str.indexOf(" ")!=-1){





		    alert("Invalid E-mail ID")





		    return false





		 }





}











//Numbers only 





function numbersonly(e){





var unicode=e.charCode? e.charCode : e.keyCode





	if(unicode==9 || unicode==46 || unicode==127)





	{	





	return true;





	}





 	if (unicode!=8){ //if the key isn't the backspace key (which we should allow)





 		if (unicode<48||unicode>57) //if not a number





  		return false //disable key press





 	}





}	





//Contact form


function validate_contact()


{


	var f = document.form1;





	var emailID=document.form1.email;


	var email_cID=document.form1.email_c;


	if (f.full_name.value=="")





    {





        alert ("Please enter your full name");





		f.full_name.focus();





	    return false





    }





	else if ((emailID.value==null)||(emailID.value=="")){





		alert("Please enter your Email ID")





		emailID.focus()





		return false





	}


	else if (echeck(emailID.value)==false){





		emailID.value=""





		emailID.focus()





		return false





	}


	else if ((email_cID.value==null)||(email_cID.value=="")){





		alert("Please enter your confirmation Email ID")





		email_cID.focus()





		return false





	}


	else if (echeck_c(email_cID.value)==false){





		email_cID.value=""





		email_cID.focus()





		return false





	}


	else if ((document.getElementById("email").value)!=(document.getElementById("email_c").value))





    {


		


        alert ("Please enter exact confirmation E-Mail Id");





		f.email_c.focus();





	    return false





    }


	else if (f.comments.value=="")





    {





        alert ("Please enter your Question/Comments");





		f.comments.focus();





	    return false





    }


	else if (f.security_code.value=="")





    {





        alert ("Please enter security code");





		f.security_code.focus();





	    return false





    }


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 E-mail ID")





		   return false





		}











		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){





		   alert("Invalid E-mail ID")





		   return false





		}











		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){





		    alert("Invalid E-mail ID")





		    return false





		}











		 if (str.indexOf(at,(lat+1))!=-1){





		    alert("Invalid E-mail ID")





		    return false





		 }











		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){





		    alert("Invalid E-mail ID")





		    return false





		 }











		 if (str.indexOf(dot,(lat+2))==-1){





		    alert("Invalid E-mail ID")





		    return false





		 }





		





		 if (str.indexOf(" ")!=-1){





		    alert("Invalid E-mail ID")





		    return false





		 }





	}


//Confirmation valid id


function echeck_c(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 E-mail ID")





		   return false





		}











		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){





		   alert("Invalid E-mail ID")





		   return false





		}











		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){





		    alert("Invalid E-mail ID")





		    return false





		}











		 if (str.indexOf(at,(lat+1))!=-1){





		    alert("Invalid E-mail ID")





		    return false





		 }











		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){





		    alert("Invalid E-mail ID")





		    return false





		 }











		 if (str.indexOf(dot,(lat+2))==-1){





		    alert("Invalid E-mail ID")





		    return false





		 }





		





		 if (str.indexOf(" ")!=-1){





		    alert("Invalid E-mail ID")





		    return false





		 }





	}





}








//-->
