<%temp_customer_reg_form_show=site.object_p%>
<!-- object[<%=site.object_p%>]::temp_customer_reg_form_show -->
<%
if request.form("reg")<>"ok" then 
site.error.info="请先同意相关的注册条款！"
site.error.location="back"
site.error.err()
end if
%>

<TABLE cellSpacing=0 cellPadding=0 width=100%  border=0 bgcolor="#fafafa" style="border: 0px dashed #808080" <%=site.object(site.object_p).style%>  >
                <tr>
                  <td align="center">
                      <form name=userinfo method=post action=do.asp?tr=customer|reg|reg >
                        <div align="center">
                        <table width="100%" border="0" cellpadding="5" cellspacing="1" >
                          <tr>
                            <td height=15 colspan=2 bgcolor="#f1f1f1"><font color="#FF3300">·必填项</font></td>
                          </tr>
                          <tr >
                            <td width="18%" align=right>用户性质：</td>
                            <td align=left ><input type=hidden name=customer_sort value="<%=site.temp.customer.reg.reg_sort%>" >
                                <%=site.temp.customer.reg.sort_description%>
                                </td>
                          </tr>
						  <tr >
						    <td width="100%" align=left colspan=2 background="<%=site.object(site.object_p).image%>/dot03.gif" height="1" ></td>
						  </tr>
                          <tr >
                            <td width="18%" align=right>用 户 名：</td>
                            <td width="79%" align=left ><input  name="customer_name" type="text" id="customer_name" maxLength="18">
                                <font color=red>**</font> 不支持特殊符号如:*%#!-&%$(6-16位)</td>
                          </tr>
						  <tr >
						    <td width="100%" align=left colspan=2 background="<%=site.object(site.object_p).image%>/dot03.gif" height="1" ></td>
						  </tr>
                          <tr >
                            <td width="18%" align=right>密　　码：</td>
                            <td align=left ><input  name="customer_password" type="password" id="customer_password" maxLength="18">
                                <font color=red>**</font> 不支持特殊符号如:*%#!-&%$</td>
                          </tr>
						  <tr >
						    <td width="100%" align=left colspan=2 background="<%=site.object(site.object_p).image%>/dot03.gif" height="1" ></td>
						  </tr>
                          <tr >
                            <td width="18%" align=right>确认密码：</td>
                            <td align=left ><input  name="customer_password_verify" type="password" id="customer_password_verify" maxLength="18">
                                <font color=red>**</font></td>
                          </tr>
						  <tr >
						    <td width="100%" align=left colspan=2 background="<%=site.object(site.object_p).image%>/dot03.gif" height="1" ></td>
						  </tr>
                          <tr >
                            <td width="18%" align=right>密码问题：</td>
                            <td align=left ><input  name="customer_password_verify_question" type="text" maxlength="30"  id="customer_password_verify_question" size="35">
                                <font color=red>** 一旦注册不能修改！</font></td>
                          </tr>
						  <tr >
						    <td width="100%" align=left colspan=2 background="<%=site.object(site.object_p).image%>/dot03.gif" height="1" ></td>
						  </tr>
                          <tr >
                            <td width="18%" align=right>密码答案：</td>
                            <td align=left ><input  name="customer_password_verify_answer" type="text" maxlength="30" id="customer_password_verify_answer" size="35" >
                                <font color=red>** 一旦注册不能修改！</font></td>
                          </tr>
						  <tr >
						    <td width="100%" align=left colspan=2 background="<%=site.object(site.object_p).image%>/dot03.gif" height="1" ></td>
						  </tr>
                          <tr >
                            <td width="18%" align=right>电子邮箱：</td>
                            <td align=left ><input  name="customer_email" type="text" id="customer_email">
                                <font color=red>**</font></td>
                          </tr>
						  <tr >
						    <td width="100%" align=left colspan=2 background="<%=site.object(site.object_p).image%>/dot03.gif" height="1" ></td>
						  </tr>
                          <tr>
                            <td width="18%" align=right>真实姓名：</td>
                            <td align=left >
							<input  name="customer_realname" type="text" id="customer_realname" size="20">
                                <font color=red>**</font> 以便发货确认 </td>
                          </tr>
						  <tr >
						    <td width="100%" align=left colspan=2 background="<%=site.object(site.object_p).image%>/dot03.gif" height="1" ></td>
						  </tr>
						  <tr>
                            <td width="18%" align=right>姓　　别：</td>
                            <td align=left ><input type=radio name=customer_sex id=Select1 value=1 checked>
                              男
                                <input type=radio name=customer_sex id=Select1 value=0>
                                女 <font color=red>**</font></td>
                          </tr>
						  <tr >
						    <td width="100%" align=left colspan=2 background="<%=site.object(site.object_p).image%>/dot03.gif" height="1" ></td>
						  </tr>
						  <tr>
                            <td width="18%" align=right>年　　龄：</td>
                            <td align=left ><input type=text name=customer_age size=5 maxlength="2" onKeyPress="event.returnValue=IsDigit();">
                            <font color=red>**</font></td>
                          </tr>
						  <tr >
						    <td width="100%" align=left colspan=2 background="<%=site.object(site.object_p).image%>/dot03.gif" height="1" ></td>
						  </tr>
							<tr>
                            <td width="18%" align=right>邮　　编：</td>
                            <td align=left ><input  name="customer_postcode" type="text" id="customer_postcode" maxlength="6" size="10" onKeyPress="event.returnValue=IsDigit();">
                                <font color=red>**</font> </td>
                          </tr>
						  <tr >
						    <td width="100%" align=left colspan=2 background="<%=site.object(site.object_p).image%>/dot03.gif" height="1" ></td>
						  </tr>
							<tr>
                            <td width="18%" align=right>联系电话：</td>
                            <td align=left ><input  name="customer_telnumber" maxlength="18" type="text" id="customer_telnumber">
                                <font color=red>**</font> </td>
                          </tr>
						  <tr >
						    <td width="100%" align=left colspan=2 background="<%=site.object(site.object_p).image%>/dot03.gif" height="1" ></td>
						  </tr>
							<tr>
                            <td width="18%" align=right>收货地址：</td>
                            <td align=left >
							<input  name="customer_address" type="text" id="customer_address" size="48" maxlength="30">
                                <font color=red>**</font> </td>
                          </tr>                          
						  <tr >
						    <td width="100%" align=left colspan=2 background="<%=site.object(site.object_p).image%>/dot03.gif" height="1" ></td>
						  </tr>
                          <%
                          site.temp.customer.reg.reg_property_show session("FB_EM_1_SQL_reg_sort"),"1","customerp",""
                          %>
                          <tr >
                            <td colspan="2" valign="middle" bgcolor="#f1f1f1"><font color="#FF3300">·选填项</font></td>
                          </tr>
                          <tr >
                            <td width="18%" align=right>您的身份证号：</td>
                            <td align=left ><input  name="customer_classid" type="text" id="customer_classid" maxlength="18" onKeyPress="event.returnValue=IsDigit();">
                            </td>
                          </tr>
						  <tr >
						    <td width="100%" align=left colspan=2 background="<%=site.object(site.object_p).image%>/dot03.gif" height="1" ></td>
						  </tr>
                          <tr >
                            <td width="18%" align=right>QQ号：</td>
                            <td align=left ><input  name="customer_qqnumber" type="text" id="customer_qqnumber" maxlength="12" onKeyPress="event.returnValue=IsDigit();">
                            </td>
                          </tr>
						  <tr >
						    <td width="100%" align=left colspan=2 background="<%=site.object(site.object_p).image%>/dot03.gif" height="1" ></td>
						  </tr>
                          <%
                          site.temp.customer.reg.reg_property_show session("FB_EM_1_SQL_reg_sort"),"0","customerp",""
                          %>
						  <tr >
						    <td width="100%" align=left colspan=2 background="<%=site.object(site.object_p).image%>/dot03.gif" height="1" ></td>
						  </tr>
                          <tr >
                            <td width="18%" align="right"></td>
                            <td align=left ><input type=hidden name=customer_property ><input onClick="reginfosubmit();" type=button value=" 提交信息 ">
                                <input type=reset name="Clear" value=" 重新填写 ">
                            </td>
                          </tr>
                        </table>
                    	</div>
                    </form></td>
                </tr>
</TABLE>
<script language=javascript>
function IsDigit()
{
  return ((event.keyCode >= 48) && (event.keyCode <= 57));
}

function checkreginfo()
{
   if(checkspace(document.userinfo.customer_name.value)) {
	document.userinfo.customer_name.focus();
    alert("对不起，请填写用户名！");
	return false;
  }
    if(checkspace(document.userinfo.customer_password.value) || document.userinfo.customer_password.value.length < 6 || document.userinfo.customer_password.value.length >20) {
	document.userinfo.customer_password.focus();
    alert("密码长度不能不能这空，在6位到20位之间，请重新输入！");
	return false;
  }
    if(document.userinfo.customer_password.value != document.userinfo.customer_password_verify.value) {
	document.userinfo.customer_password.focus();
	document.userinfo.customer_password.value = '';
	document.userinfo.customer_password_verify.value = '';
    alert("两次输入的密码不同，请重新输入！");
	return false;
  }

 if(document.userinfo.customer_email.value.length!=0)
  {
    if (document.userinfo.customer_email.value.charAt(0)=="." ||        
         document.userinfo.customer_email.value.charAt(0)=="@"||       
         document.userinfo.customer_email.value.indexOf('@', 0) == -1 || 
         document.userinfo.customer_email.value.indexOf('.', 0) == -1 || 
         document.userinfo.customer_email.value.lastIndexOf("@")==document.userinfo.customer_email.value.length-1 || 
         document.userinfo.customer_email.value.lastIndexOf(".")==document.userinfo.customer_email.value.length-1)
     {
      alert("Email地址格式不正确！");
      document.userinfo.customer_email.focus();
      return false;
      }
   }
 else
  {
   alert("Email不能为空！");
   document.userinfo.customer_email.focus();
   return false;
   }
  if(checkspace(document.userinfo.customer_password_verify_question.value)) {
	document.userinfo.customer_password_verify_quetsion.focus();
   alert("对不起，请填写密码提问！");
   return false;
  }
  if(checkspace(document.userinfo.customer_password_verify_answer.value)) {
	document.userinfo.customer_password_verify_answer.focus();
    alert("对不起，请填写密码提问的答案！");
	return false;
  }
   if(checkspace(document.userinfo.customer_realname.value)) {
	document.userinfo.customer_realname.focus();
    alert("对不起，请填写真实姓名！");
	return false;
  }
  if(checkspace(document.userinfo.customer_address.value)) {
	document.userinfo.customer_address.focus();
    alert("对不起，请填写收货人详细收货地址！");
	return false;
  }
  if(checkspace(document.userinfo.customer_postcode.value)) {
	document.userinfo.customer_postcode.focus();
    alert("对不起，请填写邮编！");
	return false;
  }
  if(document.userinfo.customer_postcode.value.length!=6) {
	document.userinfo.customer_postcode.focus();
    alert("对不起，请正确填写邮编！");
	return false;
  } 
    if(checkspace(document.userinfo.customer_telnumber.value)) {
	document.userinfo.customer_telnumber.focus();
    alert("对不起，请留下您的联系电话！");
	return false;
  }
//      if(checkspace(document.userinfo.songhuofangshi.value)) {
//	document.userinfo.songhuofangshi.focus();
//    alert("对不起，您还没有选择送货方式！");
//	return false;
//  }
//      if(checkspace(document.userinfo.zhifufangshi.value)) {
//	document.userinfo.zhifufangshi.focus();
//    alert("对不起，您还没有选择支付方式！");
//	return false;
//  }
return true;
}

function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}

function reginfosubmit(){
var customer_p=""
<%
for i_r=0 to site.temp.customer.reg.reg_property_show(session("FB_EM_1_SQL_reg_sort"),"3","dd","")
response.write "customer_p=customer_p+document.userinfo.customerp_"&i_r&".value+','"&vbcrlf
next
%>
document.userinfo.customer_property.value=customer_p;
if(checkreginfo(customer_p))
userinfo.submit();
//alert(customer_p);
}
</script>
