// JavaScript Document
function addform()
{
	
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
     var address = document.from.newsemail.value;
     if(reg.test(address) == false) 
	 {
      alert('Invalid Email Address');
	  document.from.newsemail.focus();
      return false;
    }
	
var emailadd=document.getElementById('newsemail').value;
var pageurl="checkemail.php?email="+emailadd;
	//alert(pageurl);
	
	getRequest(pageurl,"registerBox","");
	document.getElementById("divregisterBox").style.display="none";
	document.from.newsemail.value="";

}
function addformindex()
{
	
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
     var address = document.from.email.value;
     if(reg.test(address) == false) 
	 {
      alert('Invalid Email Address');
	  document.from.email.focus();
      return false;
    }
	
	
	
var email = document.getElementById('email').value;
var pageurl="checkemailindex.php?email="+email;
	//alert(pageurl);
	
	getRequest(pageurl,"registerBox","");
	document.getElementById("divregisterBox").style.display="none";
	document.from.email.value="";


}

function contactform()
{
	var x=document.sentfrom.name.value.charCodeAt(0); 
	 //alert(x);
	if(document.sentfrom.name.value=="" || x=='32')
	{ alert("Please Specify Nombre"); document.sentfrom.name.focus(); return false; }
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
     var address = document.sentfrom.email.value;
     if(reg.test(address) == false) 
	 {
      alert('Invalid Email Address');
	  document.sentfrom.email.focus();
      return false;
	  
     }
	 
	 var z=document.sentfrom.telephone.value.charCodeAt(0);
	
	if(document.sentfrom.telephone.value=="" || z=='32')
	{
	alert("Please Enter Valid Teléfono");
	document.sentfrom.telephone.focus();
	return false;
	}
	if(isNaN(document.sentfrom.telephone.value) == true)
    { alert("Please Enter Digit "); 	document.sentfrom.telephone.focus();  return false;  }
	
	
	 var h=document.sentfrom.consult.value.charCodeAt(0); 
	if(document.sentfrom.consult.value=="" || h=='32')
	{ alert("Please Specify consult"); document.sentfrom.consult.focus(); return false; }
	




document.sentfrom.submit();



}






function contratarForm()
{
	var x=document.contractfrom.name.value.charCodeAt(0); 
	if(document.contractfrom.name.value=="" || x=='32')
	{ alert("Please Specify Nombre"); document.contractfrom.name.focus(); return false; }
	var y=document.contractfrom.fristsurname.value.charCodeAt(0);
	if(document.contractfrom.fristsurname.value=="" || y=='32')
	{ alert("Please Specify 1er apellido"); document.contractfrom.fristsurname.focus(); return false; }
	
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
     var address = document.contractfrom.email.value;
     if(reg.test(address) == false) 
	 {
      alert('Invalid Email Address');
	  document.contractfrom.email.focus();
      return false;
    }
	
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
     var address = document.contractfrom.confrim.value;
     if(reg.test(address) == false) 
	 {
      alert('Invalid Confirmar email Address');
	  document.contractfrom.confrim.focus();
      return false;
    }
	
	if((document.contractfrom.email.value)!=(document.contractfrom.confrim.value))
	{
		alert('Plz Confrim Confirmar email Address');
	  document.contractfrom.confrim.focus();
      return false;
	  
		}
	
	
	
	var z=document.contractfrom.phone.value.charCodeAt(0);
	
	if(document.contractfrom.phone.value=="" || z=='32')
	{
	alert("Please Enter Valid Teléfono");
	document.contractfrom.phone.focus();
	return false;
	}
	
	
 



document.contractfrom.submit();



}
function validateForm()
{

	//alert(formnm);
     var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
     var address = document.frmLogin.txtUserName.value;
     if(reg.test(address) == false) 
	 {
      alert('Invalid Email Address');
	  document.frmLogin.txtUserName.focus();
      return false;
    }
	

   if (document.frmLogin.txtpass.value =="")
   {

	   alert("Please enter Contraseña !");
	   document.frmLogin.txtpass.focus();
	   return false; 	   

   }

document.frmLogin.submit();
}

function ForgotForm()
{

	//alert(formnm);
     var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
     var address = document.frmforgot.txtUserName.value;
     if(reg.test(address) == false) 
	 {
      alert('Invalid Email Address');
	  document.frmforgot.txtUserName.focus();
      return false;
    }
	

   

document.frmforgot.submit();
}
function checkShippingAndPaymentInfo()

{

	
  
     var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
     var address = document.frmResgister.txtShippingEmail.value;
     if(reg.test(address) == false) 
	 {
      alert('Invalid Email Address');
	  document.frmResgister.txtShippingEmail.focus();
      return false;
    }
   var x=document.frmResgister.txtPassword.value.charCodeAt(0); 
	if(document.frmResgister.txtPassword.value=="" || x=='32')
	{ alert("Please Specify Contraseña"); document.frmResgister.txtPassword.focus(); return false; }
	var y=document.frmResgister.txtCPassword.value.charCodeAt(0);
	if(document.frmResgister.txtCPassword.value=="" || y=='32')
	{ alert("Please Specify Confirmar Contraseña"); document.frmResgister.txtCPassword.focus(); return false; }
    if((document.frmResgister.txtCPassword.value)!=(document.frmResgister.txtPassword.value))
	{ alert("Contraseña Is Not Matching"); document.frmResgister.txtCPassword.focus(); return false;}
     var a=document.frmResgister.txtShippingFirstName.value.charCodeAt(0); 
	if(document.frmResgister.txtShippingFirstName.value=="" || a=='32')
	{ alert("Please Specify Nombre"); document.frmResgister.txtShippingFirstName.focus(); return false; }
	var b=document.frmResgister.txtShippingAddress1.value.charCodeAt(0); 
	if(document.frmResgister.txtShippingAddress1.value=="" || b=='32')
	{ alert("Please Specify Dirección"); document.frmResgister.txtShippingAddress1.focus(); return false; }
	var c=document.frmResgister.txtcountry.value.charCodeAt(0); 
	if(document.frmResgister.txtcountry.value=="" || c=='32')
	{ alert("Please Specify Pais"); document.frmResgister.txtcountry.focus(); return false; }
   if(!document.frmResgister.accept.checked)
	{ alert("You must agree to the terms.");document.frmResgister.accept.focus();  return false; }
document.frmResgister.submit();
}

