var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i

function Validate()
{
      if(PageForm.fname.value=="")
	     {
		alert("Please Enter First Name In Billing Information");
		PageForm.fname.focus();
		return false;
	      }  

		if(PageForm.lname.value=="")
	    {
		alert("Please Enter Last Name In Billing Information");
		PageForm.lname.focus();
		return false;
	    }  

//Email validation start	
var e=PageForm.email;
if(e.value=="")
	{
		alert("Please Enter Your Valid Email address.");
		e.focus();
		return false;
	}

var returnval=emailfilter.test(e.value)
if (returnval==false){
alert("Invalid Email Address.")
//e.select();
e.focus();
return false;
}

//return returnval;

//Email validation end

    if(PageForm.address.value=="")
	   {
		alert("Please Enter Address In Billing Information");
		PageForm.address.focus();
		return false;
	   } 	  

	   if(PageForm.city.value=="")
	   {
		alert("Please Enter City In Billing Information");
		PageForm.city.focus();
		return false;
	   } 

	   if(PageForm.state.value=="")
	   {
		alert("Please Select State In Billing Information");
		PageForm.state.focus();
		return false;
	   } 
	   
	    if(PageForm.country.value=="")
	  {
		alert("Please Select Country In Billing Information");
		PageForm.country.focus();
		return false;
	   }   
	     
	   if(PageForm.zip.value=="")
	   {
		alert("Please Enter Zip Code In Billing Information");
		PageForm.zip.focus();
		return false;
	   }    

	  if(PageForm.phone.value=="")
	  {
		alert("Please Enter Phone In Billing Information");
		PageForm.phone.focus();
		return false;
	   } 

}


function ValidateForm()
{
      if(PageForm.ShipFirst.value=="")
	     {
		alert("Please Enter First Name In Shipping Information");
		PageForm.ShipFirst.focus();
		return false;
	      } 

		if(PageForm.ShipLast.value=="")
	     {
		alert("Please Enter Last Name In Shipping Information");
		PageForm.ShipLast.focus();
		return false;
	     }   

//Email validation start	
var e=PageForm.ShipEmail;
if(e.value=="")
	{
		alert("Please Enter Your Valid Email address.");
		e.focus();
		return false;
	}

var returnval=emailfilter.test(e.value)
if (returnval==false){
alert("Invalid Email Address.")
//e.select();
e.focus();
return false;
}

//return returnval;

//Email validation end

    if(PageForm.ShipAddress.value=="")
	     {
		alert("Please Enter Address In Shipping Information");
		PageForm.ShipAddress.focus();
		return false;
	    }  

		if(PageForm.ShipCity.value=="")
	    {
		alert("Please Enter City In Shipping Information");
		PageForm.ShipCity.focus();
		return false;
	    } 

		if(PageForm.ShipState.value=="")
	    {
		alert("Please Select State In Shipping Information");
		PageForm.ShipState.focus();
		return false;
	    } 
		
		if(PageForm.ShipCountry.value=="")
	    {
		alert("Please Select country In Shipping Information");
		PageForm.ShipCountry.focus();
		return false;
	    }  

		if(PageForm.ShipZip.value=="")
	    {
		alert("Please Enter Zip In Shipping Information");
		PageForm.ShipZip.focus();
		return false;
	    }   


		if(PageForm.ShipPhone.value=="")
	    {
		alert("Please Enter Phone In Shipping Information");
		PageForm.ShipPhone.focus();
		return false;
	    } 

}

function CPassForm()
{
      if(PageForm.oldpass.value=="")
	    {
		alert("Please Enter Old Password");
		PageForm.oldpass.focus();
		return false;
	    } 
		  
		if(PageForm.newpass.value=="")
	    {
		alert("Please Enter New Password");
		PageForm.newpass.focus();
		return false;
	    } 
		if(PageForm.conpass.value=="")
	    {
		alert("Please Re-Type New Password");
		PageForm.conpass.focus();
		return false;
	    } 
		
		if(PageForm.newpass.value!=PageForm.conpass.value)
	    {
		alert("You New Password and Re-type New Password are not same");
		PageForm.conpass.focus();
		return false;
	    } 
		  
}		  

function FPassForm()
{
//Email validation start	
var e=fForm.email;
if(e.value=="")
	{
		alert("Please Enter Your Valid Email address.");
		e.focus();
		return false;
	}

var returnval=emailfilter.test(e.value)
if (returnval==false){
alert("Invalid Email Address.")
//e.select();
e.focus();
return false;
}

//return returnval;

//Email validation end
}



















