// JavaScript Document
function sendrequest() {
var test;
strEmail = document.form.email.value;
if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(strEmail))){		
	alert("E mail Address Not Valid");
	return false;
}
}


function requestpassword() {
var test;
strEmail = document.add.email.value;
if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(strEmail))){		
	alert("E mail Address Not Valid");
	return false;
}
}

function loginvalidation() {
var test;
strEmail = document.login.txtemail.value;
if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(strEmail))){		
	alert("E mail Address Not Valid");
	return false;
}	
if(document.login.txtpwd.value=='')
	  {
	   alert('Please Enter Password.');
	   document.login.txtpwd.focus();
	   return false;
	  } 	
}


function loginvalidation1() {
var test;
strEmail = document.loginform.txtemail.value;
if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(strEmail))){		
	alert("E mail Address Not Valid");
	return false;
}	
if(document.loginform.txtpwd.value=='')
	  {
	   alert('Please Enter Password.');
	   document.loginform.txtpwd.focus();
	   return false;
	  } 	
}

function validate1()
     {
     if(document.form1.txtkeyword.value=='')
	  {
	   alert('Please Enter A Criteria to Search.');
	   document.form1.txtkeyword.focus();
	   return false;
	  }
}
	 
	 
 function validate2()
     {
     if(document.form2.txtkeyword.value=='')
	  {
	   alert('Please Enter A Criteria to Search.');
	   document.form2.txtkeyword.focus();
	   return false;
	  }
     }

 function ordervalidation()
     {
     if(document.order.sizeavaliable.value=='null')
	  {
	   alert('Please Select Size.');
	   document.order.sizeavaliable.focus();
	   return false;
	  }
	   if(document.order.price.value=='null')
	  {
	   alert('Please Select Quantity.');
	   document.order.price.focus();
	   return false;
	  }
     }
	 
function alphanumeric(alphane)
            {
	            var numaric = alphane;
	            for(var j=0; j<numaric.length; j++)
		            {
		              var alphaa = numaric.charAt(j);
		              var hh = alphaa.charCodeAt(0);
		              if(hh!=32)		              
		              {
		                  if((hh > 64 && hh<91) || (hh > 96 && hh<123))
		                  {
		                  }
		                    else
		                    {
			                 return false;
		                    }
		               }
		            }
             return true;
            }
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 ;
		 }

 		 return true;					
	}
	
	
 function contactvalidation()
     {
	var emailID=document.add.emailid
	if(document.add.name.value=='')
	{
	alert('Please Enter Your Name.');
	document.add.name.focus();
	return false;
	}
	if(alphanumeric(document.add.name.value)==false)
           {
            alert('Please Enter Valid Name. Only Letters with No Punctuation.');
            document.add.name.focus();
            return false; 
           }
	if(document.add.emailid.value=='')
	{
	alert('Please Enter Email ID.');
	document.add.emailid.focus();
	return false;
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	if(document.add.phone.value=='')
	{
	alert('Please Enter Phone Number.');
	document.add.phone.focus();
	return false;
	}
	if(document.add.query.value=='')
	{
	alert('Please Enter Query.');
	document.add.query.focus();
	return false;
	}
  }
  
  
  function registration()
     {
	var emailID=document.add.email
	if(document.add.email.value=='')
	{
	alert('Please Enter Email ID.');
	document.add.email.focus();
	return false;
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	if(document.add.pwdd.value=='')
	{
	alert('Please Enter Your Password.');
	document.add.pwdd.focus();
	return false;
	}
	if(document.add.pwdd.value!=document.add.rpwdd.value)
	{
	alert('Password not Match.');
	return false;
	}
	if(document.add.name.value=='')
	{
	alert('Please Enter Your Name.');
	document.add.name.focus();
	return false;
	}
	if(alphanumeric(document.add.name.value)==false)
           {
            alert('Please Enter Valid Name. Only Letters with No Punctuation.');
            document.add.name.focus();
            return false; 
           }	
	if(document.add.security_code.value=='')
	{
	alert('Please Enter Security Code.');
	document.add.security_code.focus();
	return false;
	}
  }
  
  
  function registration1()
     {
	var emailID=document.add.email
	if(document.add.email.value=='')
	{
	alert('Please Enter Email ID.');
	document.add.email.focus();
	return false;
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	if(document.add.pwdd.value!=document.add.rpwdd.value)
	{
	alert('Password not Match.');
	return false;
	}
	if(document.add.name.value=='')
	{
	alert('Please Enter Your Name.');
	document.add.name.focus();
	return false;
	}
	if(alphanumeric(document.add.name.value)==false)
           {
            alert('Please Enter Valid Name. Only Letters with No Punctuation.');
            document.add.name.focus();
            return false; 
           }	
  }
  
  
  function validate4()
{
	if(document.form4.name.value=='')
	{
	alert('Please Enter Your Full Name');
	document.form4.name.focus();
	return false;
	}
	if(!isNaN(document.getElementById('name').value))
	  {
	    alert("Please Enter Valid Name. Only Letters with No Punctuation.");	
		document.getElementById('name').focus();			      
		return false 
	  }
	   if(alphanumeric(document.getElementById('name').value)==false)
                    {
                        alert('Please Enter a Valid Name. Only Letters with No Punctuation.');
                        document.getElementById('name').focus();
                        return false; 
                    } 
	if(document.form4.email.value=='')
	{
	alert('Please Enter a Email ID.');
	document.form4.email.focus();
	return false;
	}
	strEmail = document.form4.email.value;
    if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(strEmail))){		
	alert("E mail Address Not Valid");
	return false;
    }
   if(document.form4.phone.value=='')
	{
	alert('Please Enter a Phone Number.');
	document.form4.phone.focus();
	return false;
	}
	if(document.form4.address.value=='')
	{
	alert('Please Enter a Delivery Address.');
	document.form4.address.focus();
	return false;
	}
	if(document.form4.terms_cond[0].checked!=true)
	{
	alert('Please Accept Our Terms & Conditions.');
	document.form4.terms_cond[0].focus();
	return false;
	}
	
}
	function custom_validate(x)
	{
	if(x.name.value=='')
	{
	alert('Please Enter Your Full Name');
	x.name.focus();
	return false;
	}
	if(x.email.value=='')
	{
	alert('Please Enter a Email ID.');
	x.email.focus();
	return false;
	}
	strEmail = x.email.value;
    if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(strEmail))){		
	alert("Email Address Not Valid");
	x.email.focus();
	return false;
    }
	if(x.size.value=='')
	{
	alert('Please Enter Size Of Card.');
	x.size.focus();
	return false;
	}
	if(x.ship_add.value=='')
	{
	alert('Please Enter Shipping Address.');
	x.ship_add.focus();
	return false;
	}
/*	if(x.agree.checked!=true)
	{
	alert('Please Accept Our Terms & Conditions.');
	x.ship_add.focus();
	return false;
	}
*/	}

