// JavaScript Document
<!--
function validate()
    {
  // First Name field
  // check if empty
  	if (checkNull(deleteExtremeSpaces(document.memform.fname), "Please enter a value for the First Name field." ))
  		{

		return false;
		}
  // Last Name field
  // check if empty
     	if (checkNull(deleteExtremeSpaces(document.memform.lname), "Please enter a value for the Last Name field." ))
   		{
		return false;
		}
    
  // validate Email field
  // begin by stripping leading/trailing blanks
     	if (checkNull(document.memform.email, "Please enter a value for the Email field." ))
   		{
			return false;
		}   
		
		if (!validate_email(document.memform.email))
			{
				alert("The email address you have supplied appears to be invalid.");
				document.memform.email.focus();
				return false;
			}
		//document.memform.EmailId.value = deleteExtremeSpaces(document.memform.EmailId.value);
		
	// Password field
	// strip leading/trailing blanks
	    if (checkNull(deleteExtremeSpaces(document.memform.password), "Please enter a valid password (between 6 and 15 characters)."))
    {
	return false;
    }
  
  if (document.memform.password.value.length < 6)
  {
    alert("Please enter between 6 and 15 characters in the password field.");
    memform.password.focus();
    return false;
  }

  if (document.memform.password.value.length > 15)
  {
    alert("Please enter between 6 and 15 characters in the password field.");
    memform.password.focus();
    return false;
  }
	
// Confirm Password field
// strip leading/trailing blanks
 // document.memform.local_PasswordConfirm.value = deleteExtremeSpaces(document.memform.local_PasswordConfirm);
	 if (document.memform.password2.value != document.memform.password.value)
  {
    alert("Your confirm password did not match your original password. Please check them and try again.");
    document.memform.password2.focus();
    return false;
  }
   
    // BillAddress1 field
    // strip leading/trailing blanks
  	if (checkNull(deleteExtremeSpaces(document.memform.address), "Please enter a value for the Postal Address field." ))
  		{
		return false;
		}
                
    // BillCity field
    // strip leading/trailing blanks
  	if (checkNull(deleteExtremeSpaces(document.memform.city), "Please enter a value for the City field." ))
  		{
		return false;
		}

    // BillState field
    // strip leading/trailing blanks
  	if (checkNull(deleteExtremeSpaces(document.memform.state), "Please enter a value for the State field." ))
  		{
		return false;
		}

    // BillZipCode field
    // strip leading/trailing blanks
  	if (checkNull(deleteExtremeSpaces(document.memform.zipcode), "Please enter a value for the Zip Code field." ))
  		{
		return false;
		}
   
    //  FK_BillCountryId drop down
    //  Get value of selected item
    for (var i = 0; i < document.memform.country.options.length; i++)
        {
        if (document.memform.country.options[i].selected)
           {
			   var x = document.memform.country.options[i].value;   
			 if ((x == '') || (x == 'xx'))
                {
                alert("Please select one of the country of residence options.");
                document.memform.country.focus();
                return false;
				}
			  }   
        }
        
	for (var i=0; i < document.memform.terms.length; i++)
	   {
	   if (document.memform.terms[i].checked)
		  {
			var rad_val = document.memform.terms[i].value;
		if (rad_val != 'yes')
				{
					alert("You must Agree to the Terms and Conditions.");
					document.memform.terms[i].focus();
					return false;
				}
			}
		}
}

//End-->
