<!--<?php print <<<EOT
-->
<style type="text/css">
.Correct,.Wrong,.Exp{display:block;height:18px;line-height:17px;padding:0 5px 0 2em;}
.Correct{background:#e6ffe6 url($imgpath/post/register/register.png) 5px 2px no-repeat;border:1px dashed #00a8ff;color:#008800;}
.Wrong{background:#fff2e9 url($imgpath/post/register/register.png) 5px -79px no-repeat;border:1px dashed #ff6600;color:#8b2b34;}
.Exp{background:#e2f5ff url($imgpath/post/register/register.png) 5px -134px no-repeat;border:1px dashed #00a8ff;color:#006699;}
.regItem { padding-bottom:2em }
.regItem dl { padding:.2em 0; margin:0}
.regItem dt{  margin:0;width:20%; float:left; padding-right:2em;text-align:right; font-size:12px; }
.regItem dd{ width:23%; float:left;padding-right:2em; margin:0}
.regItem dd.regTips { width:48%;text-align:left;height:30px;padding-right:0; margin:0}
.p10 td{padding:.5em 1em;}
</style>
<!--
EOT;
if(GetGP('vip')=='activating'){print <<<EOT
-->
<div style="margin-bottom:8px;">
		<div id="breadCrumb" class="cc f16 b" style="color:$linkcolor">邮件激活</div>
		<div class="y-bg"></div>
		<div class="y-bg2"></div>
		<div class="y-bg3"></div>
		<div class="y-bg4">
			<div class="p10 cc">
				<form action="$db_registerfile?" method="post" name="register">
				<input type="hidden" name="verify" value="$verifyhash" />
				<input type="hidden" name="step" value="finish" />
				<input type="hidden" name="option" value="1" />
				<table width="100%" cellspacing="0" cellpadding="0" align="center">
					<tr align="center"><td>亲爱的会员，您邮件激活成功。</td></tr>
					<tr align="center"><td><input class="btn" type="button" onclick="window.location.href='$loginurl'" value="立即登录" />&nbsp;<a href="./$db_bfn" style="color:blue">先去逛逛</a></td></tr>
				</table></form>
			</div>
		</div>
		<div class="y-bg3"></div>
		<div class="y-bg2"></div>
		<div class="y-bg"></div>
</div>
<!--
EOT;
}elseif(!$step && $step!=2){print <<<EOT
-->
<div style="margin-bottom:8px;">
		<div id="breadCrumb" class="cc f16 b" style="color:$linkcolor">注册</div>
			<div>
				<div class="y-bg"></div>
				<div class="y-bg2"></div>
				<div class="y-bg3"></div>
				<div class="y-bg4">
					<div class="p10 cc">
						<div class="cc b p10 f14">请填写以下必填信息完成注册</div>
						<form action="$db_registerfile?" method="post" name="register" onSubmit="return checkAll();">
						<input type="hidden" value="$forward" name="forward" />
						<input type="hidden" value="2" name="step" />
						<input type="hidden" value="cn0zz" name="_hexie" />
<!--
EOT;
$tmpVerify = GetVerify($onlineip);print <<<EOT
-->
<script type="text/javascript">
document.register._hexie.value='$tmpVerify';
</script>
						<div class="cc p10 regItem">
<!--
EOT;
if($db_sitemsg['reg']['0']){
print<<<EOT
-->
							<dl class="cc" style="margin-bottom:1em;">
								<dt>&nbsp;</dt>
								<dd style="width:auto;"><div class="blockquote" style="margin:0;">{$db_sitemsg[reg][array_rand($db_sitemsg[reg])]}</div></dd>
							</dl>
<!--
EOT;
}print<<<EOT
-->
							<dl class="cc">
								<dt>用户名<font color="red">*</font></dt>
								<dd style="width:140px;">
									 <input class="input" type="text" size="20" maxlength="$regmaxname" name="regname" id="regname" />
								</dd>
								<dd class="regTips"><span class="span" id="regname_info">
								不能有空格，可以是中文，长度控制在 {$regminname}-{$regmaxname} 字节以内
								</span></dd>
							</dl>
							<dl class="cc">
								<dt>密&#160;&#160;码<font color="red">*</font></dt>
								<dd style="width:140px;">
									<input class="input" type="password" size="20" maxlength="$regmaxpwd" name="regpwd" id="regpwd" onKeyUp="CreateRatePasswdReq(this,'$regminname');" />
								</dd>
								<dd class="regTips"><span id="pwd_info">最小长度:{$regminpwd} 最大长度:{$regmaxpwd}</span></dd>
							</dl>
							<dl class="cc">
								<dt>&nbsp;</dt>
								<dd style="width:140px;">
									<div class="fl" style="width:132px;margin-right:1em;">
									<table id="passwdBar" cellSpacing="0" cellPadding="0" border="0" width="132" style="border:0px;margin-top:7px;">
										<tbody>
											<tr>
												<td id="posBar" style="width:0px;padding:0;border-right:0;height:4px;background:#e5e9eb;"></td>
												<td id="negBar" style="padding:0;border-right:0;height:4px;background:#e5e9eb;"></td>
											</tr>
										</tbody>
									</table>
									</div >
								</dd>
								<dd class="regTips"><span id="passwdRating" class="fl" style="height:20px;line-height:20px;"></span></dd>
							</dl>
							<dl class="cc">
								<dt>确认密码<font color="red">*</font></dt>
								<dd style="width:140px;">
									<input class="input" type="password" size="20" maxlength="75" name="regpwdrepeat" id="regpwdrepeat" />
								</dd>
								<dd class="regTips"><span id="pwdrepeat_info">请再输入一遍您上面填写的密码</span></dd>
							</dl>
							<dl class="cc">
								<dt>Email<font color="red">*</font></dt>
								<dd style="width:140px;">
									<input class="input" type="text" size="20" maxlength="75" name="regemail" value="" id="regemail"/>
									<div style="padding:.5em 0"><input type="checkbox" name="regemailtoall" value="1" /> 公开邮箱</div>
								</dd>
								<dd class="regTips">
									<span id="email_info">
										请填写真实并且最常用的邮箱
<!--
EOT;
if($rg_config['rg_emailtype'] == '1' && $rg_config['rg_email']){print <<<EOT
-->
									<div style="overflow:hidden;margin:4px auto">为避免无法收取站点邮件，请使用以下邮箱进行注册:<br />({$rg_config[rg_email]})</div>
<!--
EOT;
} elseif($rg_config['rg_emailtype'] == '2' && $rg_config['rg_banemail']){print <<<EOT
-->
									<div style="overflow:hidden;margin:4px auto">为避免无法收取站点邮件，以下邮箱无法进行注册:<br />({$rg_config[rg_banemail]})</div>
<!--
EOT;
}print<<<EOT
-->
									</span>

								</dd>
							</dl>
<!--
EOT;
if($inv_config['inv_open']){print <<<EOT
-->
							<dl class="cc">
								<dt>邀请注册码<font color="red">*</font>
								</dt>
								<dd>
									<input class="input" type="text" value="$invcode" name="invcode" id="invcode" />
								</dd>
								<dd class="regTips"><span id="invcode_info"></span>
<!--
EOT;
if($inv_config['inv_price']){print <<<EOT
-->
								&nbsp;<a href="hack.php?H_name=invite&action=pay">获取邀请码</a>
<!--
EOT;
}print <<<EOT
-->
								</dd>
							</dl>
<!--
EOT;
}if($regq && $db_question){
$qkey = array_rand($db_question);
$db_question[$qkey] = addcslashes($db_question[$qkey],'"');
print <<<EOT
-->
							<dl class="cc">
								<dt>站点防恶意注册<font color="red">*</font></dt>
								<dd>
									<input class="input" type="text" name="qanswer" id="qanswer" />
									<input type="hidden" id="regqkey" name="qkey" value="$qkey" />
									<div style="padding:.5em 0">问题:$db_question[$qkey]</div>
								</dd>
								<dd class="regTips"><span id="qanswer_info">正确答案:$db_answer[$qkey]</span></dd>
							</dl>
<!--
EOT;
}if($rg_config['rg_ifcheck']){print <<<EOT
-->
							<dl class="cc">
								<dt>注册原因<font color="red">*</font></dt>
								<dd>
									<textarea name="regreason" rows="4" cols="50"></textarea>
								</dd>
								<dd class="regTips"></dd>
							</dl>
<!--
EOT;
}if($customfield){
$fields = array();
print <<<EOT
-->
							<dl class="cc">
								<dt><b>附加信息</b></dt>
								<dd>&nbsp;</dd>
								<dd class="regTips"></dd>
							</dl>
<!--
EOT;
foreach($customfield as $key=>$val){
$ids = '';
$field="field_".(int)$val[id];
$fieldinfo = $field."_info";
$required=$val[required]?'<font color="red">*</font>':'';
$editable=(!$userdb[$field]||$val[editable])?'':'disabled';
!$val[editable] && $val[descrip] .='(请认真填写该栏信息，填写后将不允许修改)';
if($val[type]=='1'){
	if($val[required]){
		$fields[] = array('field'=>$field,'type'=>'text','descrip'=>$val[descrip]);
		$ids = "id=\"$field\"";
	}
	$field_type="<input class=\"input\" type=\"text\" size=\"30\" name=\"$field\" $ids />";
}elseif($val[type]=='2'){
	if($val[required]){
		$fields[] = array('field'=>$field,'type'=>'textarea','descrip'=>$val[descrip]);
		$ids = "id=\"$field\"";
	}
	$field_type="<textarea name=\"$field\" $ids rows=\"5\" cols=\"35\"></textarea>";
}elseif($val[type]=='3'){
	$field_type="<select name=\"$field\" id=\"$field\">";
	$options=explode("\n",$val[options]);
	foreach($options as $k=>$v){
		list($k,$v)=explode('=',$v);
		$field_type.="<option value=\"$k\">$v</option>";
	}
	$field_type.="</select>";
}
print <<<EOT
-->
							<dl class="cc">
								<dt>$val[title] {$required}</dt>
								<dd>{$field_type}</dd>
								<dd class="regTips">
								<span id="$fieldinfo">
									$val[descrip]
								</span>
								</dd>
							</dl>
<!--
EOT;
}}print <<<EOT
-->
<!--
EOT;
if($db_ifsafecv){print <<<EOT
-->
							<dl class="cc">
								<dt>安全问题</dt>
								<dd>
									<select name="question" onchange="showcustomquest(this.value)" style="width:130px">
										<option value="0" id="question_0">无安全问题</option>
	<option value="1">我爸爸的出生地</option>
	<option value="2">我妈妈的出生地</option>
	<option value="3">我的小学校名</option>
	<option value="4">我的中学校名</option>
	<option value="5">我最喜欢的运动</option>
	<option value="6">我最喜欢的歌曲</option>
	<option value="7">我最喜欢的电影</option>
	<option value="8" >我最喜欢的颜色</option>
	<option value="-1" id="question_99">自定义问题</option>
									</select>
									<input id="customquested" style="display:none" type="text" name="customquest" class="input">
								</dd>
								<dd class="regTips"><span class="gray" id="customquested_info">如果启用了安全问题，需要填写正确的答案才能登录站点</span></dd>
							</dl>
							<dl class="cc">
								<dt>您的答案</dt>
								<dd><input type="text" name="answer" class="input" id="answered"></dd>
								<dd class="regTips"><span class="gray" id="answered_info">请输入答案</span></dd>
							</dl>
<!--
EOT;
}if($custominfo){
print <<<EOT
-->
							<dl class="cc">
                            <dt><b>选填信息</b></dt>
							<dd>&nbsp;</dd><dd class="regTips"></dd>
                            </dl>
<!--
EOT;
foreach($custominfo as $key=>$val){
if(substr($val[3],0,1)=='1'){print <<<EOT
-->
							<dl class="cc">
								<dt>$val[0]</dt>
								<dd><input class="input" type="text" size="20" name="customdata[$key]" value="" /> $val[1]</dd>
								<dd class="regTips"></dd>
							</dl>
<!--
EOT;
}}}if($db_gdcheck & 1){print <<<EOT
-->
							<dl class="cc">
								<dt>认证码<font color="red">*</font></dt>
								<dd>
									<input class="input" type="text" id="gdcode" name="gdcode" size="6" />
									<span onclick="try{opencode('menu_gd',this,'register_ckcode')}catch(e){}" style="cursor:pointer;margin-left:3px">看不清楚，换一张</span>
									<div id="menu_gd"></div><img src="ck.php?nowtime=$timestamp" align="absmiddle" onclick="try{opencode('menu_gd',this,'register_ckcode')}catch(e){}" style="cursor:pointer;" id="register_ckcode" alt="看不清楚，换一张" />
								</dd>
								<dd class="regTips"><span id="gdcode_info"></span></dd>
							</dl>
<!--
EOT;
}print <<<EOT
-->
							<dl class="cc">
								<dt>&nbsp;</dt>
								<dd>
									<div style="padding:0 0 1em 0"><input type="checkbox" size="20" name="rgpermit" value="1" id="registerclause"/>&nbsp;我已阅读并完全同意<a onclick="permit();" style="cursor:pointer" class="b">条款内容</a></div>
								</dd>
								<dd class="regTips"><span id="registerclause_info"></span></dd>
							</dl>

							<dl class="cc">
								<dt>&nbsp;</dt>
								<dd>
									<input class="btn" type="submit" value="提交注册" /><input class="bt" type="reset" value="重 置" />
								</dd>
								<dd class="regTips">
								</dd>
							</dl>
						</div>
						</form>
					</div>
				</div>
				<div class="y-bg3"></div>
				<div class="y-bg2"></div>
				<div class="y-bg"></div>
			</div>
		</div>
<script type="text/javascript" language="JavaScript" src="js/pw_register.js"></script>
<script type="text/javascript" language="JavaScript" src="js/passwordstrength.js"></script>
<script language="JavaScript">
var charset = '$db_charset';
var retminname	= parseInt('$regminname');
var regmaxname	= parseInt('$regmaxname');
var rglower		= parseInt('$rg_config[rg_rglower]');
var regminpwd 	= parseInt('$regminpwd');
var regmaxpwd 	= parseInt('$regmaxpwd');
var regnpdifferf= parseInt('$rg_config[rg_npdifferf]');
var regemail	= parseInt('$rg_config[rg_emailcheck]');
var regdetail	= parseInt('$rg_config[rg_regdetail]');

var inticlass 	= "Exp";
var rightclass	= "Correct";
var falseclass	= "Wrong";

var pwdcomplex	= '$rg_config[rg_pwdcomplex]';
var extracheck	= new Array();
var regInfo 	= new Array();

regInfo[0] 		= new Array(
						"恭喜您，该用户名还未被注册，您可以使用这个用户名注册！",
						"用户名长度错误！",
						"此用户名包含不可接受字符或被管理员屏蔽,请选择其它用户名",
						"为了避免站点用户名混乱,用户名中禁止使用大写字母,请使用小写字母",
						"该用户名已经被注册，请选用其他用户名。" ,
						"用户名不能为空！",
						"不能有空格，可以是中文，长度控制在 "+retminname+"-"+regmaxname+" 字节以内 " + (rglower?"区分大小写":"不区分大小写"));
var regname 	= new Element("regname",regInfo[0],"regname_info");

regInfo[1] 		= new Array(
						"填写正确。",
						"密码设置错误。密码中必须包含小写字母。",
						"密码设置错误。密码中必须包含大写字母。",
						"密码设置错误。密码中必须包含数字。",
						"密码设置错误。密码中必须包含符号。",
						"密码设置错误。密码长度过小。",
						"密码设置错误。密码过长。",
						"密码设置错误。密码不允许和用户名相同。",
						"密码设置错误。密码不允以下字符:\\ & ' \" ! / * , < > % # ?。",
						"不允许注册帐号与密码相同。",
                        getPwdRule());
var regpwd 		= new Element("regpwd",regInfo[1],"pwd_info");

regInfo[2] 		= new Array(
						"填写正确。",
						"两次输入的密码不一致。请再输入一次您上面输入的密码。",
						"请再输入一遍您上面填写的密码");
var regpwdrepeat= new Element("regpwdrepeat",regInfo[2],"pwdrepeat_info");

regInfo[3] 		= new Array(
						"填写正确。",
						"您的填写有误。",
						"该邮箱已被注册，请更换别邮箱。",
						"请填写真实并且最常用的邮箱。"+(regemail?"我们需要通过邮箱对您进行认证。":""),
						"邮箱不是系统指定的邮箱地址，不能注册",
						"请输入正确的邮箱地址");
var regemail 	= new Element("regemail",regInfo[3],"email_info");

if(parseInt("$db_gdcheck")&1){
	regInfo[4] 	= new Array(
						"填写正确。",
						"验证码不正确。",
						"登录已超时,请刷新验证码。",
						"请输入验证码。"	);
	var gdcode 	= new Element("regemail",regInfo[4],"gdcode_info");
}
if(getObj('regqkey')){
	regInfo[5] 	= new Array(
						"填写正确。",
						"验证答案错误。",
						"请输入答案:$db_answer[$qkey]"	);
	var qanswer = new Element("qanswer",regInfo[5],"qanswer_info");
}
if(parseInt("$inv_config[inv_open]")==1){
	regInfo[6] 	= new Array(
						"填写正确。",
						"邀请码不能为空。",
						"邀请码错误。",
						"本站开启邀请注册,请填写邀请码!"	);
	var invcode = new Element("invcode",regInfo[6],"invcode_info");
}

regInfo[7] 		= new Array(
						"已同意。",
						"请先确定已阅读并完全同意条款内容。");
var registerclause 	= new Element("registerclause",regInfo[7],"registerclause_info");

regInfo[8] 		= new Array(
						"填写正确。",
						"请输入自定义问题");
var customquested 	= new Element("customquested",regInfo[8],"customquested_info");

regInfo[9] 		= new Array(
						"填写正确。",
						"请输入答案");
var answered 	= new Element("answered",regInfo[9],"answered_info");


function permit() {
	//getObj("registerclause").disabled = 'disabled';//b445
	try {ajax.send('$db_registerfile?ajax=1&step=permit','',ajax.get);} catch(e){}
}
if (regdetail) {
	setTimeout('permit();',1000);
}
function getPwdRule(){
	var intiString 	= "";
	if(regminpwd){
		intiString 	+= "最小长度:"+regminpwd+" ";
	}
	if(regmaxpwd){
		intiString 	+= "最大长度:"+regmaxpwd+" ";
	}
	if(regnpdifferf){
		intiString	+= "密码不能与用户名相同。";
	}
	if(!pwdcomplex){
		return intiString;
	}
	var addString 	= "密码里必须包含以下字符类型:";
	var rule = pwdcomplex.split(',');
	for(var i=0;i<rule.length;i++){
		switch(Number(rule[i])){
			case 1:
				addString += "小写字母 ";
				break;
			case 2:
				addString += "大写字母 ";
				break;
			case 3:
				addString += "数字 ";
				break;
			case 4:
				addString += "符号 ";
				break;
			default:
				break;
		}
	}
	return intiString + addString;
}
<!--
EOT;
if(count($fields)){
print <<<EOT
-->
var keep = 20;
<!--
EOT;
foreach($fields as $field){
print <<<EOT
-->
<!--
EOT;
if($field[type]!='text'){
print <<<EOT
-->
getObj("$field[field]").onfocus 	= onFocus;
getObj("$field[field]").onblur 		= onBlur;
extracheck.push(getObj("$field[field]"));
<!--
EOT;
}print <<<EOT
-->
regInfo[keep] 	= new Array(
						"填写正确。",
						"本选项不能为空。",
						"$field[descrip]");
var $field[field] = new Element("$field[field]",regInfo[keep],"$field[field]"+"_info");
keep++;
<!--
EOT;
}}print <<<EOT
-->

function showcustomquest(qid){
	getObj("customquested").style.display = qid==-1 ? '' : 'none';
}
</script>
<!--
EOT;
}elseif($step=='finish'){
if($email && $rg_config['rg_emailcheck']){
print<<<EOT
-->
<div style="margin-bottom:8px;">
		<div id="breadCrumb" class="cc f16 b" style="color:$linkcolor">注册</div>
		<div class="y-bg"></div>
		<div class="y-bg2"></div>
		<div class="y-bg3"></div>
		<div class="y-bg4" style="line-height:30px;padding:30px 0;">
<table width="100%" cellspacing="0" cellpadding="0" align="center">
<tr align="center"><td>注册成功，请立即开通账户</td></tr>
<tr align="center"><td>亲爱的会员，您已经通过邮箱{$email}注册成为{$db_bbsname}大家庭中的一员了。</td></tr>
<tr align="center"><td>我们已经把激活邮件发送到了{$email}邮箱，快去激活吧！</td></tr>
<tr align="center"><td><input class="btn" type="button" value="去我的邮箱激活" onclick="window.location.href='$emailurl'"/>&nbsp;<a href="$db_registerfile?step=finish&email=$email&verify=$_GET[verify]&r=1" style="color:blue" target="_blank">再次发送激活邮件</a></td></tr>
<tr align="center"><td>小贴士:如果你没有收到激活邮件，可能邮件被误放入垃圾邮件中了；<br />你还可以选择<a href="$db_registerfile?step=finish&email=$email&verify=$_GET[verify]&r=1" style="color:blue" target="_blank">再次发送激活邮件</a>来接收激活邮件。</td></tr>
</table>
		</div>
		<div class="y-bg3"></div>
		<div class="y-bg2"></div>
		<div class="y-bg"></div>
</div>
<!--
EOT;
}else{
if(!$option){print<<<EOT
-->
<div style="margin-bottom:8px;">
		<div id="breadCrumb" class="cc f16 b" style="color:$linkcolor">注册</div>
<div>
		<div class="y-bg"></div>
		<div class="y-bg2"></div>
		<div class="y-bg3"></div>
		<div class="y-bg4 f16 b" style="line-height:2;padding:30px 0;">
		<form action="$db_registerfile?" method="post" name="register">
		<input type="hidden" name="verify" value="$verifyhash" />
		<input type="hidden" name="step" value="finish" />
		<input type="hidden" name="option" value="1" />
		<table width="100%" cellspacing="0" cellpadding="0" align="center">
			<tr align="center"><td>恭喜您！亲爱的会员，您已经注册成功。</td></tr>
			<tr align="center"><td><input class="btn" type="submit" value="现在去完善资料" />&nbsp;<a href="./$db_bfn" class="f12 fn">先去逛逛</a></td></tr>
		</table></form>
		</div>
		<div class="y-bg3"></div>
		<div class="y-bg2"></div>
		<div class="y-bg"></div>
</div>
</div>
<!--
EOT;
}elseif($option==1){print<<<EOT
-->
		<div style="margin-bottom:8px;">
			<div id="breadCrumb" class="cc f16 b" style="color:$linkcolor">完善资料</div>
			<div>
				<div class="y-bg"></div>
				<div class="y-bg2"></div>
				<div class="y-bg3"></div>
				<div class="y-bg4">
					<div class="p10 cc">
						<form action="$db_registerfile?" method="post">
						<input type="hidden" name="step" value="finish" />
						<input type="hidden" name="verify" value="$verifyhash" />
						<input type="hidden" name="option" value="2" />
						<div class="cc b p10 f14" style="padding-left:21%;">基本信息</div>
						<div class="cc p10 regItem">
							<dl class="cc">
								<dt>性别</dt>
								<dd>
									<input type="radio" value="1" name="regsex" />男
									<input type="radio" value="2" name="regsex" />女
									<input type="radio" value="0" name="regsex" checked/>保密
								</dd>
								<dd class="regTips"></dd>
							</dl>
							<dl class="cc">
								<dt>生日</dt>
								<dd>
									<select name="regbirthyear">
<!--
EOT;
if($rg_config['rg_timestart'] < $rg_config['rg_timeend'] && $rg_config['rg_timeend']){
for($i=$rg_config['rg_timestart']; $i<=$rg_config['rg_timeend']; $i++){print <<<EOT
-->
										<option value="$i">$i</option>
<!--
EOT;
}}elseif($rg_config['rg_timestart'] > $rg_config['rg_timeend'] && $rg_config['rg_timeend']){
for($i=$rg_config['rg_timestart']; $i>=$rg_config['rg_timeend'];$i--){print <<<EOT
-->
										<option value="$i">$i</option>
<!--
EOT;
}}print <<<EOT
-->
									</select> 年
									<select name="regbirthmonth">
<!--
EOT;
for($i=1;$i<=12;$i++){print <<<EOT
-->
										<option value="$i">$i</option>
<!--
EOT;
}print <<<EOT
	-->
									</select>月
									<select name="regbirthday">
<!--
EOT;
for($i=1;$i<=31;$i++){print <<<EOT
-->
										<option value="$i">$i</option>
<!--
EOT;
}print <<<EOT
-->
									</select>日</font>
								</dd>
								<dd class="regTips"></dd>
							</dl>
							<dl class="cc">
								<dt>来自</dt>
								<dd>
									<input class="input" type="text" size="20" maxlength="20" name="regfrom" />
								</dd>
								<dd class="regTips"></dd>
							</dl>
						</div>
						<div class="cc b p10 f14" style="padding-left:21%;">联系资料</div>
						<div class="cc p10 regItem">
							<dl class="cc">
								<dt>QQ</dt>
								<dd>
									<input class="input" type="text" size="20" maxlength="14" name="regoicq" value="" />
								</dd>
								<dd class="regTips"></dd>
							</dl>
							<dl class="cc">
								<dt>个人主页</dt>
								<dd>
									<input class="input" type="text" size="20" maxlength="75" name="reghomepage" value="" />
								</dd>
								<dd class="regTips"></dd>
							</dl>
							<dl class="cc">
								<dt>帖子签名</dt>
								<dd>
									<textarea cols="50" name="regsign" rows="4" id="sign"></textarea>
									<div style="padding:.5em 0;" id="signid"></div>
								</dd>
								<dd class="regTips"></dd>
							</dl>
							<dl class="cc">
								<dt>自我简介</dt>
								<dd>
									<textarea name="regintroduce" rows="4" cols="50" id="regintroduce"></textarea>
									<div style="padding:.5em 0;" id="regintroduceid"></div>
								</dd>
								<dd class="regTips"></dd>
							</dl>
							<dl class="cc">
								<dt>&nbsp;</dt>
								<dd>
									<input class="btn" type="submit" value="  下一步  " />
									<input class="bt"  type="submit" name="option" value="跳过" />
								</dd>
								<dd class="regTips"></dd>
							</dl>
						</div>
																			</form>
					</div>
				</div>
				<div class="y-bg3"></div>
				<div class="y-bg2"></div>
				<div class="y-bg"></div>
			</div>
		</div>
<script language="javascript" type="text/javascript">

var charset = '$db_charset';
var signnum = '$_G[signnum]';
var introducenum = 500;

initCheckTextNum('sign','signid',signnum);
initCheckTextNum('regintroduce','regintroduceid',introducenum);
</script>

<!--
EOT;
}elseif($option==2 || $_POST['option']){print<<<EOT
-->
		<div style="margin-bottom:8px;">
			<div id="breadCrumb" class="cc f16 b" style="color:$linkcolor">上传头像</div>
			<div>
				<div class="y-bg"></div>
				<div class="y-bg2"></div>
				<div class="y-bg3"></div>
				<div class="y-bg4">
					<div class="p10 cc">
						<form id="creator" name="creator" action="$db_registerfile?" method="post" enctype="multipart/form-data" onsubmit="return setFaceLen()">
						<input type="hidden" name="step" value="finish" />
						<input type="hidden" name="verify" value="$verifyhash" />
						<input type="hidden" name="option" value="3" />
						<div class="cc p10 regItem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0" class="set-table2">
								<tr class="vt">
									<td width="25%" align="center">
										<img src="$imgpath/face/none.gif" name="useravatars" />
									</td>
									<td>
										<div id="openchang" style="float:left;width:100%;margin-top:1%;">
											<div style="float:left;margin-right:1%;">
												<input type="radio" name="facetype" value="1" onclick="CkFaceType(this.value)">系统头像
											</div>
<!--
EOT;
if($_G[allowportait]){print <<<EOT
-->
											<div style="float:left;margin-right:1%;">
												<input type="radio" name="facetype" value="2" onclick="CkFaceType(this.value)">头像链接
											</div>
<!--
EOT;
}if($db_ifupload && $_G[upload]){print <<<EOT
-->
											<div style="float:left;">
												<input type="radio" name="facetype" value="3" onclick="CkFaceType(this.value)">头像上传
											</div>
<!--
EOT;
}print <<<EOT
-->
											<div class="c"></div>
											<div id="face1" style="float:left;width:100%;margin-top:1%;display:none;">
												<div id="iconbox">
													<div style="width:250px;padding:0 0 10px;">
														<a class="fr" onclick="showSystemIcon(2);" style="cursor:pointer">下一页</a><a onclick="showSystemIcon(0);" style="cursor:pointer">上一页</a>
													</div>
<style>
.face img{margin-right:3px;border:1px solid #dcdcdc;padding:3px;}
</style>
													<div style="width:272px;">
<!--
EOT;
foreach ($imgname_array as $key => $value) {print <<<EOT
-->
														<span onClick="showimage('$imgpath','$value')" class="fl face"><img src='$imgpath/face/$value' width="50" height="50"></span>
<!--
EOT;
}print <<<EOT
-->
													</div>
												</div>
												<input type="hidden" name="proicon" value="$iconfile" />
											</div>
											<div id="face2" style="float:left;width:100%;margin-top:1%;display:none;">
											<table><tr>
											<td>头像链接 <input name="httpurl[0]" id="httpurl_url" class="input" type="text" size="40" /> 必须以 http://开头</td></tr>
											<td>头像宽度 <input name="httpurl[1]" class="input" size="2" maxlength="3" /> 必须是 1 -- $db_imgwidth 之间的一个整数。</td></tr>
											<td>头像高度 <input name="httpurl[2]" class="input" size="2" maxlength="3" /> 必须是 1 -- $db_imgheight 之间的一个整数。<b>头像高度留空，则根据宽度自适应</b></td></tr>
											</table>
											<input type="hidden" id="httpurl_w" name="httpurl[3]" />
											<input type="hidden" id="httpurl_h" name="httpurl[4]" />
											</div>
											<div id="face3" style="float:left;width:100%;margin-top:1%;display:none;">
											<embed width="560" height="450" src="js/face.swf?$icon_encode_url" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"  type="application/x-shockwave-flash" />
											</div>
										</div>
									</td>
								</tr>
								<tr>
									<td></td>
									<td style="padding:10px;">
										<input class="bt" type="button" value="上一步" onclick="javascript:history.go(-1);" />
										<input class="btn" type="submit" id="register_success" value=" 完成 " />
										<a href="./$db_bfn">跳过</a>
									</td>
								</tr>
							</table>
						</div>
						</form>
					</div>
				</div>
				<div class="y-bg3"></div>
				<div class="y-bg2"></div>
				<div class="y-bg"></div>
			</div>
		</div>

<iframe id="hideframe" name="hideframe" width="0" height="0" marginwidth="0" frameborder="0" src="about:blank"></iframe>
<script language="JavaScript">
var display = '$display';
function CkFaceType(value){
	var facetype = document.getElementsByName('facetype');
	for(i=0;i<facetype.length;i++){
		if(facetype[i].value == value){
			facetype[i].checked = true;
			getObj('face' + value).style.display = '';
			if (value == '3') {
				getObj('register_success').style.display = 'none';
			} else {
				getObj('register_success').style.display = '';
			}
		} else {
			getObj('face' + facetype[i].value).style.display = 'none';
		}
	}
}
CkFaceType('1');

function setFaceLen() {
	var v = 0;
	var facetype = document.getElementsByName('facetype');
	for (i = 0; i < facetype.length; i++) {
		if (facetype[i].checked === true) {
			v = facetype[i].value;break
		}
	}
	if (v == 2) {
		var img = new Image();
		img.src = getObj('httpurl_url').value;
		getObj('httpurl_w').value = img.width;
		getObj('httpurl_h').value = img.height;
	}
	return true;
}
function showimage(imgpath,value){
	var path = imgpath + '/face/';
	facepath(path,value,false);
}
function facepath(iconurl,iconfile,showmsg,iconwidth,iconheight){
	if (showmsg) {
		if (showmsg == 'success') {
			ajax.time = setTimeout(function(){
				closep();
				showDialog('success','上传成功!',1);
			},1500);
			getObj('reupload').innerHTML = '<input class="input file" type="file" id="upload" name="upload" /><a class="abt" unselectable="on" onclick="UpLoadFace()">上传</a>';
		} else if (showmsg == 'undefined_action') {
			ajax.time = setTimeout(function(){
				closep();
				showDialog('error','非法操作');
			},1500);
			return false;
		} else {
			ajax.time = setTimeout(function(){
				closep();
				showDialog("error",showmsg);
			},1500);
			return false;
		}
	}
	document.images.useravatars.src = iconurl + iconfile + '?' + new Date().getTime();
	if (iconwidth>0) document.images.useravatars.width = iconwidth;
	if (iconheight>0) document.images.useravatars.height = iconheight;
	document.creator.proicon.value = iconfile;
	return false;
}
function showSystemIcon(page) {
	getObj('iconbox').innerHTML = '<div style="width:272px;"><div class="tac p10"><img src="'+imgpath+'/loading.gif" align="absmiddle" /> 正在加载数据...</div></div>';
	ajax.send('pw_ajax.php','action=showface&page='+page,getIcon);
}
function getIcon() {
	var iconlist = ajax.request.responseText;
	setTimeout(function(){getObj('iconbox').innerHTML = iconlist;},300);
}
function UpLoadFace(){
	if (getObj('upload').value != '') {
		var uploadform = getObj('creator');
		var oldaction = uploadform.action;
		var oldonSubmit = uploadform.onSubmit;
		uploadform.action = '$db_registerfile?step=finish&option=ajaxface';
		uploadform.onSubmit = '';
		uploadform.target = 'hideframe';
		uploadform.submit();
		uploadform.action = oldaction;
		uploadform.onSubmit = oldonSubmit;
		uploadform.target = '';
		read.obj = getObj('upload');
		read.guide();
		document.onmouseout = '';
	} else {
		showDialog("error","请选择要上传附件");
	}
}
</script>
<!--
EOT;
}}}elseif($step=='permit'){print<<<EOT
-->
<table width="480" cellspacing="1" cellpadding="5">
	<tr><th class="h" style="cursor:move" onmousedown="read.move(event);">条款内容</th></tr>
	<tr>
		<td>
			<div style="width:97%; height:220px; overflow:auto; border:1px solid #eee">
				$rg_config[rg_rgpermit]
			</div>
		</td>
	</tr>
</table>
<ul><li style="text-align:center;padding:4px 0;"><input type="button" class="btn" onclick="unpermit();" value="同 意" /></li></ul>
<script language="JavaScript">
function unpermit() {
	getObj("registerclause").disabled = '';
	getObj("registerclause").checked = 'checked';
	closep();
}
</script>
<!--
EOT;
}?>-->
