<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="conn.asp"-->
<%
set rs=server.createobject("adodb.recordset")
sqltext="select * from RegUser where UserId='" & request.form("uid") & "'"
rs.open sqltext,conn,1,1

'ݿ⣬ûǷѾע
if rs.recordcount >= 1 then 
   if rs("userid")=request.form("uid") then
      Response.Redirect "messagebox.asp?msg=ûѾעѡû!"
      response.end
      rs.close
   end if
end if
%>
<head>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<STYLE type=text/css>.main {
	FONT-SIZE: 12px
}
.main1 {
	FONT-SIZE: 14px
}
.main2 {
	FONT-SIZE: 16px
}
.main3 {
	FONT-SIZE: 7px
}
.main4 {
	FONT-SIZE: 10px
}
A:link {
	COLOR: #000000; TEXT-DECORATION: none
}
A:visited {
	COLOR: #000000; TEXT-DECORATION: none
}
A:active {
	COLOR: #ff0000; TEXT-DECORATION: none
}
A:hover {
	COLOR: #aa0000; TEXT-DECORATION: underline
}
</STYLE>

<SCRIPT language=javascript id=clientEventHandlersJS>
//chksafe
//ܽܣǷ"'",'\\',"/"
//˵Ҫַ
//ֵ0  1
function chksafe(a)
{	
	return 1;
/*	fibdn = new Array ("'" ,"\\", "", ",", ";", "/");
	i=fibdn.length;
	j=a.length;
	for (ii=0;ii<i;ii++)
	{	for (jj=0;jj<j;jj++)
		{	temp1=a.charAt(jj);
			temp2=fibdn[ii];
			if (tem';p1==temp2)
			{	return 0; }
		}
	}
	return 1;
*/	
}

//chkspc
//ܽܣǷпո
//˵Ҫַ
//ֵ0  1
function chkspc(a)
{
	var i=a.length;
	var j = 0;
	var k = 0;
	while (k<i)
	{
		if (a.charAt(k) != " ")
			j = j+1;
		k = k+1;
	}
	if (j==0)
	{
		return 0;
	}
	
	if (i!=j)
	{ return 2; }
	else
	{
		return 1;
	}
}


//chkemail
//ܽܣǷΪEmail Address
//˵Ҫַ
//ֵ0  1
function chkemail(a)
{	var i=a.length;
	var temp = a.indexOf('@');
	var tempd = a.indexOf('.');
	if (temp > 1) {
		if ((i-temp) > 3){
			
				if ((i-tempd)>0){
					return 1;
				}
			
		}
	}
	return 0;
}

//opt1 С     opt2   
//opt2Ϊ1ʱnumǷǸ
//opt1Ϊ1ʱnumǷС
//1ȷģ0Ǵ
function chknbr(num,opt1,opt2)
{
	var i=num.length;
	var staus;
//stausڼ¼.ĸ
	status=0;
	if ((opt2!=1) && (num.charAt(0)=='-'))
	{
		//alert("You have enter a invalid number.");
		return 0;
	
	}
//һλΪ.ʱ
	if (num.charAt(i-1)=='.')
	{
		//alert("You have enter a invalid number.");
		return 0;
	}

	for (j=0;j<i;j++)
	{
		if (num.charAt(j)=='.')
		{
			status++;
		}
		if (status>1) 
		{
		//alert("You have enter a invalid number.");
		return 0;		
		}
		if (num.charAt(j)<'0' || num.charAt(j)>'9' )
		{
			if (((opt1==0) || (num.charAt(j)!='.')) && (j!=0)) 
			{
				//alert("You have enter a invalid number.");
				return 0;
			}
		}
	}
	return 1;
}

//chkdate
//ܽܣǷΪ
//˵Ҫַ
//ֵ0  1
function chkdate(datestr)
{
	var lthdatestr
	if (datestr != "")
		lthdatestr= datestr.length ;
	else
		lthdatestr=0;
		
	var tmpy="";
	var tmpm="";
	var tmpd="";
	//var datestr;
	var status;
	status=0;
	if ( lthdatestr== 0)
		return 0

	
	for (i=0;i<lthdatestr;i++)
	{	if (datestr.charAt(i)== '-')
		{
			status++;
		}
		if (status>2)
		{
			//alert("Invalid format of date!");
			return 0;
		}
		if ((status==0) && (datestr.charAt(i)!='-'))
		{
			tmpy=tmpy+datestr.charAt(i)
		}
		if ((status==1) && (datestr.charAt(i)!='-'))
		{
			tmpm=tmpm+datestr.charAt(i)
		}
		if ((status==2) && (datestr.charAt(i)!='-'))
		{
			tmpd=tmpd+datestr.charAt(i)
		}

	}
	year=new String (tmpy);
	month=new String (tmpm);
	day=new String (tmpd)
	//tempdate= new String (year+month+day);
	//alert(tempdate);
	if ((tmpy.length!=4) || (tmpm.length>2) || (tmpd.length>2))
	{
		//alert("Invalid format of date!");
		return 0;
	}
	if (!((1<=month) && (12>=month) && (31>=day) && (1<=day)) )
	{
		//alert ("Invalid month or day!");
		return 0;
	}
	if (!((year % 4)==0) && (month==2) && (day==29))
	{
		//alert ("This is not a leap year!");
		return 0;
	}
	if ((month<=7) && ((month % 2)==0) && (day>=31))
	{
		//alert ("This month is a small month!");
		return 0;
	
	}
	if ((month>=8) && ((month % 2)==1) && (day>=31))
	{
		//alert ("This month is a small month!");
		return 0;
	}
	if ((month==2) && (day==30))
	{
		//alert("The Febryary never has this day!");
		return 0;
	}
	
	return 1;
}

//fucPWDchk
//ܽܣǷзֻĸ
//˵Ҫַ
//ֵ0 1ȫΪֻĸ
function fucPWDchk(str)
{
  var strSource ="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  var ch;
  var i;
  var temp;
  
  for (i=0;i<=(str.length-1);i++)
  {
  
    ch = str.charAt(i);
    temp = strSource.indexOf(ch);
    if (temp==-1) 
    {
     return 0;
    }
  }
  if (strSource.indexOf(ch)==-1)
  {
    return 0;
  }
  else
  {
    return 1;
  } 
}

function jtrim(str)
{     while (str.charAt(0)==" ")
          {str=str.substr(1);}      
     while (str.charAt(str.length-1)==" ")
         {str=str.substr(0,str.length-1);}
     return(str);
}


//fucCheckNUM
//ܽܣǷΪ
//˵Ҫ
//ֵ1Ϊ֣0Ϊ
function fucCheckNUM(NUM)
{
	var i,j,strTemp;
	strTemp="0123456789";
	if ( NUM.length== 0)
		return 0
	for (i=0;i<NUM.length;i++)
	{
		j=strTemp.indexOf(NUM.charAt(i));	
		if (j==-1)
		{
		//˵ַ
			return 0;
		}
	}
	//˵
	return 1;
}

//fucCheckTEL
//ܽܣǷΪ绰
//˵Ҫַ
//ֵ1ΪǺϷ0ΪϷ
function fucCheckTEL(TEL)
{
	var i,j,strTemp;
	strTemp="0123456789-()# ";
	for (i=0;i<TEL.length;i++)
	{
		j=strTemp.indexOf(TEL.charAt(i));	
		if (j==-1)
		{
		//˵ַϷ
			return 0;
		}
	}
	//˵Ϸ
	return 1;
}

//fucCheckLength
//ܽܣַĳ
//˵Ҫַ
//ֵֵ
function fucCheckLength(strTemp)
{
	var i,sum;
	sum=0;
	for(i=0;i<strTemp.length;i++)
	{
		if ((strTemp.charCodeAt(i)>=0) && (strTemp.charCodeAt(i)<=255))
			sum=sum+1;
		else
			sum=sum+2;
	}
	return sum;
}


</SCRIPT>

<SCRIPT language=javascript>
function enb1()
{
	if (document.form1.countryid.value!=1)
	{
		document.form1.provinceid.disabled=true;
		document.form1.cityid.disabled=true;
		document.form1.haddr.value="";
	}
	else
	{
		document.form1.provinceid.disabled=false;
		document.form1.cityid.disabled=false;
	}
}

function ctychg()
{	
	document.form1.methodflag.value = "1";
	document.form1.action = "mbrregdetail.asp" ; 
	document.form1.submit();
}
</SCRIPT>

<SCRIPT language=javascript id=clientEventHandlersJS>
<!--

function call51go(frm)
{ 

  // transfer parameter to 51goForm
  //
 
		if  (form1.magazine51go.checked == true  )
		{
		  // optin id
			  p_mid="";  

			  //partner_id, each partner should have a id to be identified
			  p_pid="108";
			  
			  // construct string of optin id
		  for(i=0;i<=17;i++)
		    if (frm.magazine_id[i].checked)
		       p_mid=p_mid+","+frm.magazine_id[i].value;
			 if  (p_mid!="" ) 
			 {
					// give the email to the variable p_email
					p_email=frm.email.value;
					window.showModalDialog("http://www.51go.com/optin-partner/partner-link2.jsp?magazine_id=" + p_mid+"&partner_id="+p_pid+"&email="+p_email,
					       "","dialogWidth:600;dialogHeight:480;dialogTop:0;dialogLeft:0");
		       }
		}	       
 }


function form1_onsubmit() 
{



	if (document.form1.methodflag.value == "1")// || document.form1.methodflag.value == "3")
	{
		document.form1.action = "mbrregdetail.asp"
	}
	else
	{	document.form1.action = "reg_user_ok.asp"
	
	if (chkspc(document.form1.name.value)==0)
	{	alert("д");
		document.form1.name.focus();
		return false;
	}
	
	if ((window.form1.sex[0].checked == 0)  &&  (window.form1.sex[1].checked == 0  ))
	{	alert("ѡԱ");
		return false;
	}
	
	if ((chksafe(document.form1.name.value)==0)||(fucCheckLength(document.form1.name.value)>20))
	{	alert("дȷ");
		document.form1.name.focus();
		return false;		
	}
	
	if (fucCheckLength(document.form1.pwd.value)<4) 
	{	alert("4λ")
		document.form1.pwd.focus();
		return false;
	}
	
	if ((chksafe(document.form1.pwd.value)==0)||(fucCheckLength(document.form1.pwd.value)>18))
	{	alert("дȷ롣")
		document.form1.pwd.focus();
		return false;		
	}
	
	
	if (document.form1.PasswordConfirm.value!=document.form1.pwd.value)
	{
		alert ("ȷ롣");
		document.form1.PasswordConfirm.value='';    
		document.form1.pwd.value='';
		document.form1.pwd.focus();
		return false;
	}
	
/*	if (fucCheckLength(document.form1.aliasname.value)>20)
	{	alert("дǳƳ");
		document.form1.aliasname.focus();
		return false;		
	}
	if (chksafe(document.form1.aliasname.value)==0)
	{	alert("дȷǳơ");
		document.form1.alians.focus();
		return false;		
	}*/
		
	if (chkspc(document.form1.question.value)==0)
	{	alert("дʡ");
		document.form1.question.focus();
		return false;
	}
	if ((chksafe(document.form1.question.value)==0)||(fucCheckLength(document.form1.question.value)>50))
	{	alert("дȷʡ");
		document.form1.question.focus();
		return false;		
	}
	if (fucCheckLength(document.form1.answer.value)<4) 
	{	alert("ʾ𰸱4λ")
		document.form1.answer.focus();
		return false;
	}
	if (chkspc(document.form1.answer.value)==0)
	{	alert("дʾ𰸡");
		document.form1.answer.focus();
		return false;
	}
	if ((chksafe(document.form1.answer.value)==0)||(fucCheckLength(document.form1.answer.value)>50))
	{	alert("дȷʾ𰸡");
		document.form1.answer.focus();
		return false;		
	}
	
	/*if ((chkspc(document.form1.birthday.value)!=0) && (chkdate(document.form1.birthday.value)==0))
	{	alert ("дϷڡ");
		document.form1.birthday.focus();
		return false;
	}
	if (chksafe(document.form1.birthday.value)==0)
	{	alert ("дϷڡ");
		document.form1.birthday.focus();
		return false;		
	}*/
	if ((chkspc(document.form1.email.value)==0) || (chkemail(document.form1.email.value)==0))
	{	alert ("дȷe-mailַ");
		document.form1.email.focus();
		return false;
	}
	if ((chksafe(document.form1.email.value)==0)||(fucCheckLength(document.form1.email.value)>40))
	{	alert ("дȷe-mailַ");
		document.form1.email.focus();
		return false;		
	}
/*	if (chkspc(document.form1.certifierno.value)==0)
	{	alert ("д֤롣");
		document.form1.certifierno.focus();
		return false;
	}
	
	if ((chksafe(document.form1.certifierno.value)==0)||(fucCheckLength(document.form1.certifierno.value)>30))
	{	alert ("дȷ֤롣");
		document.form1.certifierno.focus();
		return false;		
	}
*/	
	if (chkspc(document.form1.haddr.value)==0)
	{	alert ("дջַ");
		document.form1.haddr.focus();
		return false;
	}
	if ((chksafe(document.form1.haddr.value)==0)||(fucCheckLength(document.form1.haddr.value)>200))
	{	alert ("дȷջַ");
		document.form1.haddr.focus();
		return false;		
	}
	if (chkspc(document.form1.postcode.value)==0)
	{	alert ("д롣");
		document.form1.postcode.focus();
		return false;
	}
	if ((chksafe(document.form1.postcode.value)==0)||(fucCheckLength(document.form1.postcode.value)>15))
	{	alert ("дȷ롣");
		document.form1.postcode.focus();
		return false;		
	}
	/*if ((chksafe(document.form1.oname.value)==0)||(fucCheckLength(document.form1.oname.value)>200))
	{	alert ("дȷĵλơ");
		document.form1.oname.focus();
		return false;			
	}
	if ((chksafe(document.form1.opostcode.value)==0)||(fucCheckLength(document.form1.opostcode.value)>15))
	{	alert ("дȷĵλʱࡣ");
		document.form1.oname.focus();
		return false;			
	}
	if ((chksafe(document.form1.oaddr.value)==0)||(fucCheckLength(document.form1.oaddr.value)>200))
	{	alert ("дȷĵλַ");
		document.form1.oname.focus();
		return false;			
	}
	
	if ((chksafe(document.form1.position.value)==0)||(fucCheckLength(document.form1.oaddr.value)>200))
	{	alert ("дȷְ");
		document.form1.position.focus();
		return false;			
	}
	if ((fucCheckLength(document.form1.ophone.value)>30)||(fucCheckTEL(document.form1.ophone.value)==0))
	{	alert("İ칫绰д");
		document.form1.ophone.focus();
		return false;			
	}
//	if (chksafe(document.form1.hphone.value)==0)
//	{	document.form1.hphone.focus();
//		return false;			
//	}
//	if ((document.form1.hphone.value=='') || (chkspc(document.form1.hphone.value)==0) || (fucCheckLength(document.form1.hphone.value)>30)||(fucCheckTEL(document.form1.hphone.value)==0))
//	{
//		alert("ļͥ绰д");
//		document.form1.hphone.focus();
//		return false;
//	}
	if ((fucCheckLength(document.form1.mphone.value)>30)||(fucCheckTEL(document.form1.mphone.value)==0))
	{
		alert("ƶ绰д");
		document.form1.mphone.focus();
		return false;
	}
	if ((fucCheckLength(document.form1.bp.value)>30)||(fucCheckTEL(document.form1.bp.value)==0))
	{
		alert("BPд");
		document.form1.bp.focus();
		return false;
	}
	*/
	
	if ((document.form1.usephone.value=='') || (chkspc(document.form1.usephone.value)==0) || (fucCheckLength(document.form1.usephone.value)>30)||(fucCheckTEL(document.form1.usephone.value)==0))
	{
		alert("ĳõ绰д");
		document.form1.usephone.focus();
		return false;
	}
	
/*	if ((document.form1.sex.item(0).checked==false)|| (document.form1.sex.item(1).checked==false))
	{
		alert("дԱ");
		//document.form1.sex.focus();
		return false;
	}
*/	
	for (lgth=0;lgth<=document.form1.pwd.value.length;lgth++)
		{	if ( (document.form1.pwd.value.charCodeAt(lgth)>128)  || (document.form1.pwd.value.charAt(lgth)=="'") )
			{	alert("벻Ҫߵţ");
				document.form1.pwd.focus();
				return false;
			}
		}
		
	call51go(document.form1)

	}
	
}

function cityChange(p)
{
	/*document.form1.methodflag.value = "3";
	document.form1.action = "mbrregdetail.asp" ; 
	document.form1.submit();*/
	//alert(getCityName(p));
	document.form1.haddr.value=document.form1.prvname.value+getCityName(p);
	//alert(CityArray[0].name);
	//alert(p);
//	ctychg();
}
function magazine51go_onclick() {
	if  (form1.magazine51go.checked == true ) tr_51go.style.display="";
	else tr_51go.style.display="none";
}

//-->
</SCRIPT>
<META content="Microsoft FrontPage 4.0" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff>
<DIV align=center>
<TABLE cellSpacing=0 cellPadding=0 width=750>
  <TBODY>
  <TR>
    <TD height=62>
      <DIV align=center><BR>
      <FORM language=javascript name=form1 onsubmit="return form1_onsubmit()" 
      method=post>  <INPUT 
      type=hidden value=<%=request.form("uid")%> name=uid> <INPUT type=hidden value=2 
      name=methodflag> 
      <TABLE cellSpacing=0 cellPadding=2 width=602 bgColor=#416327>
        <TBODY>
        <TR>
          <TD class=main width=590 bgColor=#ffffff colSpan=4><FONT 
            color=#416327>ΪǸõΪ񣬸׼ȷʱĽƷ͵кϵϸдϢ˶    
            ûʵ ģδǽֻڴĶϢⱣܡ    
            (Ϊ)</FONT> <BR> 
          </TD></TR></TBODY></TABLE>
      <TABLE class=main cellSpacing=1 cellPadding=2 width=602 bgColor=#416327>
        <TBODY>
        <TR>
          <TD class=main2 bgColor=#6d8e4d colSpan=2><FONT 
            color=#ffffff><B>עϢ</B></FONT></TD></TR>
        <TR>
          <TD width=86 bgColor=#ffffff>ĻԱʺţ </TD>
          <TD bgColor=#ffffff><%=request.form("uid")%><BR>[ղѡõ֣ҪѡȡԵ<A 
            href="reg_user.htm">һ</A>] </TD></TR>
        <TR>
          <TD width=86 bgColor=#ffffff><FONT color=#e71c17>*</FONT></TD>
          <TD bgColor=#ffffff><INPUT maxLength=20 size=10 name=name> 
            <BR>[ʵϵԼ] </TD></TR>
        <TR>
          <TD width=86 bgColor=#ffffff><FONT color=#000000><FONT 
            color=#e71c17>*</FONT>Ա</FONT></TD>
          <TD bgColor=#ffffff><FONT color=#000000><INPUT id=sex 
            type=radio CHECKED value= name=sex>  <INPUT id=sex type=radio 
            value=Ů name=sex> Ů</FONT> </TD></TR>
        <TR>
          <TD width=86 bgColor=#ffffff><FONT color=#e71c17>*</FONT>룺</TD>
          <TD bgColor=#ffffff>
            <P><FONT color=#000000><INPUT type=password maxLength=18 name=pwd> 
            </FONT><BR>[̫Сܲȫֲ̫䣬ĳ416ַ֮䡣ԪֻӢĸ֡ţ磺small2000199707ȡ] 
            </P></TD></TR>
        <TR>
          <TD width=86 bgColor=#ffffff><FONT color=#e71c17>*</FONT>ȷϣ</TD>
          <TD bgColor=#ffffff><FONT color=#000000><INPUT 
            type=password maxLength=18 name=PasswordConfirm> 
            <BR>[ڡȷ롱롰롱ͬϢΪ˷ֹʱ] </FONT></TD></TR>
        <TR>
          <TD width=86 bgColor=#ffffff><FONT color=#e71c17>*</FONT>ʣ</TD>
          <TD bgColor=#ffffff><FONT color=#000000><INPUT 
            maxLength=50 size=40 name=question> 
            </FONT><BR>[룬ϵͳ⡣ѡһ׹Ļɣ] </TD></TR>
        <TR>
          <TD width=86 bgColor=#ffffff><FONT color=#e71c17>*</FONT>𰸣</TD>
          <TD bgColor=#ffffff><INPUT maxLength=50 size=40 
            name=answer> (ʱ֤˴)  
            <BR>[˴ǰӦʱϵͳ趨ʾʹ𰸰롣] </TD></TR>
        <TR>
          <TD width=86 bgColor=#ffffff><FONT color=#e71c17>*</FONT>E-MAIL</TD>
          <TD bgColor=#ffffff><INPUT maxLength=40 name=email> 
            <BR>[ȷĵʼַǲŷϵ<FONT 
            color=#ff0000>ϵ䣬ֻдõһַ</FONT>] </TD></TR>
        <TR>
          <TD width=86 bgColor=#ffffff><FONT color=#e71c17>*</FONT>õ绰</TD>
          <TD bgColor=#ffffff><INPUT id=text5 maxLength=30 
            name=usephone> <BR>[дʱϵĵ绰Աڹʱʱȡϵ] </TD></TR>
        <TR>
          <TD width=86 bgColor=#ffffff><FONT color=#e71c17>*</FONT>ջַ</TD>
          <TD bgColor=#ffffff><INPUT maxLength=200 size=60 name=haddr> <BR>[дֱյĵַԱܾ콫ݽ] 
        </TD></TR>
        <TR>
          <TD width=86 bgColor=#ffffff><FONT color=#e71c17>*</FONT>ʱࣺ</TD>
          <TD bgColor=#ffffff><INPUT maxLength=15 name=postcode> 
        </TD></TR>
        <TR>
          <TD bgColor=#ffffff colSpan=2></TD></TR>
        <TR id=tr_51go style="DISPLAY: none" bgColor=#ffffff>
          <TD class=main1 width=590 colSpan=2></TD></TR></TBODY></TABLE><INPUT class=main1 type=submit value=ȷ name=button1><INPUT class=main1 id=button2 type=reset value= name=reset> 
      <BR></FORM></DIV></TD></TR></TBODY></TABLE>
</DIV></BODY>