// JavaScript Document
function validate()
{

//Contact Person validation
var re = /\$|,|@|#|~|`|\%|\*|\^|\&|\(|\)|\+|\=|\[|\-|\_|\]|\[|\}|\{|\;|\:|\'|\"|\<|\>|\?|\||\\|\!|\$|\./g;
if(""==form1.name.value)
{
alert("Please enter your Contact Name");
form1.name.focus();
return false;
}
if (form1.name.value.match(/^\d+$/)&& form1.name.value.match("") || form1.name.value.match(re)) 
   { 
      alert('Numbers & Special Characters are not allowed in name') 
      form1.name.focus(); 
      return false; 
      } 

//email validation
if(""==form1.email.value)
{
alert('Please enter your e-mail id');
form1.email.focus();
return false;
}
else 
if (form1.email.value!="") 
{
if (form1.email.value.indexOf("@")==-1 ||
form1.email.value.indexOf(".")==-1 || 
form1.email.value.indexOf(" ")!=-1 || 
form1.email.value.length<6) 
{alert("Sorry, your email address is not valid.");
form1.email.focus();
return false;
}
}
//Phone number validation

var re = /\$|,|@|#|~|`|\%|\*|\^|\&|\(|\)|\+|\=|\[|\-|\_|\]|\[|\}|\{|\;|\:|\'|\"|\<|\>|\?|\||\\|\!|\$|\./g;
if(""==form1.phone.value)
{
alert("Please Type your Phone Number");
form1.phone.focus();
return false;
}
else if(!form1.phone.value.match(/^\d+$/) || form1.phone.value.match(re))
{  
alert("Characters & Special Characters not allowed");
form1.phone.focus(); 
return false;
}


//Country validation
if(""==form1.country.value)
{
alert("Please Type your Country Name");
form1.country.focus();
return false;
}

//No of Person validation

var re = /\$|,|@|#|~|`|\%|\*|\^|\&|\(|\)|\+|\=|\[|\-|\_|\]|\[|\}|\{|\;|\:|\'|\"|\<|\>|\?|\||\\|\!|\$|\./g;
if(""==form1.no_of_person.value)
{
alert("Please Type No of Person field");
form1.no_of_person.focus();
return false;
}
else if(!form1.no_of_person.value.match(/^\d+$/) || form1.no_of_person.value.match(re))
{  
alert("Characters & Special Characters not allowed");
form1.no_of_person.focus(); 
return false;
}
//Date validation
if(""==form1.date_of_arrival.value)
{
alert("Please Type Date of Arrival");
form1.date_of_arrival.focus();
return false;
}

//Duration of stay validation

var re = /\$|,|@|#|~|`|\%|\*|\^|\&|\(|\)|\+|\=|\[|\-|\_|\]|\[|\}|\{|\;|\:|\'|\"|\<|\>|\?|\||\\|\!|\$|\./g;
if(""==form1.duration_of_stay.value)
{
alert("Please Type Duration of Stay");
form1.duration_of_stay.focus();
return false;
}
else if(!form1.duration_of_stay.value.match(/^\d+$/) || form1.duration_of_stay.value.match(re))
{  
alert("Characters & Special Characters not allowed");
form1.duration_of_stay.focus(); 
return false;
}

//Comments validation
if(""==form1.comment.value)
{
alert("Please Type Your Comments");
form1.comment.focus();
return false;
}
}
