//------------------- 用户注册信息全面检查 -------------------------
function customer_check(theform)
{   
  var str=""
  
  str=fun_username(theform.txt_username.value,"Username");
  if (str.length != 0){alert(str);return false;}
  
  str=fun_password(theform.txt_password.value,theform.txt_cpassword.value,6);
  if (str.length != 0){alert(str);return false;}
	
  str=fun_email(theform.txt_email.value,"Email Address");
  if (str.length != 0){alert(str);return false;}
    
  str=fun_null(theform.txt_fname.value,"First Name");
  if (str.length != 0){alert(str);return false;}
  
  str=fun_null(theform.txt_lname.value,"Last Name");
  if (str.length != 0){alert(str);return false;}
  
  str=fun_null(theform.dr_city.value,"City");
  if (str.length != 0){alert(str);return false;}
  else
    {
	  if(parseInt(theform.dr_city.value) == 0)
	  {
	    str=fun_null(theform.txt_city.value,"City");
        if (str.length != 0){alert(str);return false;}
	  }
	}
  
  str=fun_null(theform.txt_dphone.value,"Day-time Phone");
  if (str.length != 0){alert(str);return false;}
  
  str=fun_postcode(theform.txt_postcode.value,"Post Code");
  if (str.length != 0){alert(str);return false;}
  
  str=fun_null(theform.txt_address.value,"Address");
  if (str.length != 0){alert(str);return false;}
}

//------------ 用于在My_Account修改用户信息中 --------------------
function customer_check_myaccount(theform)
{   
  var str=""
  
  str=fun_null(theform.txt_fname.value,"First Name");
  if (str.length != 0){alert(str);return false;}
  
  str=fun_null(theform.txt_lname.value,"Last Name");
  if (str.length != 0){alert(str);return false;}
  
  str=fun_null(theform.dr_city.value,"City");
  if (str.length != 0){alert(str);return false;}
  else
    {
	  if(parseInt(theform.dr_city.value) == 0)
	  {
	    str=fun_null(theform.txt_city.value,"City");
        if (str.length != 0){alert(str);return false;}
	  }
	}
  
  str=fun_null(theform.txt_dphone.value,"Day-time Phone");
  if (str.length != 0){alert(str);return false;}
  
  str=fun_email(theform.txt_email.value,"Email Address");
  if (str.length != 0){alert(str);return false;}
  
  str=fun_postcode(theform.txt_postcode.value,"Post Code");
  if (str.length != 0){alert(str);return false;}
  
  str=fun_null(theform.txt_address.value,"Address");
  if (str.length != 0){alert(str);return false;}
}

//------------ 用于在My_Account修改用户口令中 --------------------
function change_password_check(theform)
{
  var str="";
     
  str=fun_single_password(theform.txt_opassword.value,4);
  if (str.length != 0){alert(str);return false;}

  str=fun_password(theform.txt_password.value,theform.txt_cpassword.value,4);
  if (str.length != 0){alert(str);return false;}
}


