<!--<?php
!$webPageTitle && $webPageTitle = $db_bbsname;
$metaVersion = $wind_version;
$wind_repair && $metaVersion .= '(' . $wind_repair . ')';
if (!defined('AJAX')) {print <<<EOT
-->
<!doctype html>
<html>
<head>
<meta charset="$db_charset" />
<title>$webPageTitle - Powered by phpwind</title>
<meta name="generator" content="phpwind v{$metaVersion}" />
<meta name="description" content="$metaDescription" />
<meta name="keywords" content="$metaKeywords" />
<base id="headbase" href="$db_bbsurl/" />
<link rel="stylesheet" href="$imgpath/pw_core.css?{$GLOBALS['wind_repair']}" />
<!--
EOT;
@include Pcv($css_path);
print <<<EOT
-->
<link rel="stylesheet" href="$imgpath/register/register.css?{$GLOBALS['wind_repair']}" />
<script type="text/javascript" src="js/core/core.js"></script>
<script type="text/javascript" src="js/pw_ajax.js"></script>
</head>
<body>
<!--
EOT;
}if($step=='permit'){print <<<EOT
-->
<div style="width:480px;height:296px;">
	<iframe frameborder='0' style='position:absolute;top:0;width:100%;height:306px;filter:Alpha(opacity=0);_filter:Alpha(opacity=0);opacity:.0;'></iframe>
	<div style="position:absolute;width:480px;">
		<div class="popTop" style="cursor:move;" onMouseDown="read.move(event);">條款內容</div>
		<table width="100%">
			<tr>
				<td>
					<div style="width:460px; height:220px;overflow-x:hidden; overflow-y:scroll; border:1px solid #eee">$rg_config[rg_rgpermit]</div>
				</td>
			</tr>
		</table>
		<div class="popBottom"><span class="btn2"><span><button type="button" id="regbutton" onClick="unpermit();">同 意</button></span></span></div>
	</div>
</div>
<script type="text/javascript">


function unpermit() {
	getObj("registerclause").disabled = '';
	getObj("registerclause").checked = 'checked';
	closep();
	getObj("regname").focus();
}
onReady(function(){
	getObj('regbutton').focus();
})
</script>
<!--
EOT;
}else{print <<<EOT
-->
<div class="wrap">
<div id="header">
		<div class="head_top"></div>
		<div id="head" class="cc">
				<a href="$db_bbsurl/"><img src="$imgpath/$stylepath/logo.png" class="fl" title="phpwind" /></a>
		</div>
</div>
<div class="main-wrap">
<div id="main">
<!--
EOT;
if(!$step){print <<<EOT
-->
<div id="pw_content">
	<div class="p20">
		<div class="regTitle cc">
			<h5 class="s6">注冊</h5>
		</div>
		<div class="cc">
		<form action="$db_registerfile?" method="post" name="register">
		<input type="hidden" value="" 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';
var imgpath = '$imgpath';var verifyhash = '$verifyhash';var modeimg = '$pwModeImg';var modeBase = '$baseUrl';var winduid = '$winduid';var windid	= '$windid';var groupid	= '$groupid';var basename = '$basename';var temp_basename = '$temp_basename';
</script>
			<div class="regForm-wrap">
			<div class="regForm">
<!--
EOT;
if($db_sitemsg['reg']['0']){
print<<<EOT
-->
			<div class="blockquote" style="margin-top:-20px;">{$db_sitemsg[reg][array_rand($db_sitemsg[reg])]}</div>
<!--
EOT;
}print<<<EOT
-->
			<dl class="cc">
				<dt><label for="regname">用戶名<span class="s1">*</span></label></dt>
				<dd class="ip"><div><input type="text" required="required" name="regname" id="regname" value="" maxlength="$regmaxname" class="input" /></div></dd>
				<dd class="tp"><div id="regname_info"></div></dd>
			</dl>
			<dl class="cc">
				<dt><label for="regpwd">密&#160;&#160;碼<span class="s1">*</span></label></dt>
				<dd class="ip"><div><input type="password" maxlength="$regmaxpwd" name="regpwd" id="regpwd" class="input" onKeyUp="CreateRatePasswdReq(this,'$regminname');" required="required" /></div></dd>
				<dd class="tp"><div id="pwd_info"></div></dd>
			</dl>
			<div style="margin:-10px 0 5px 145px;height:20px;" class="cc">
				<table id="passwdBar" width="230" class="fl mr10" style="margin-top:7px;background:#e5e9eb;">
					<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>
				</table>
				<div id="passwdRating" class="fl" style="color:#999;">密碼強度</div>
			</div>
			<dl class="cc">
				<dt><label for="regpwdrepeat">確認密碼<span class="s1">*</span></label></dt>
				<dd class="ip"><div><input type="password" maxlength="75" class="input" name="regpwdrepeat" id="regpwdrepeat" required="required" /></div></dd>
				<dd class="tp"><div id="pwdrepeat_info"></div></dd>
			</dl>
<!-- 
EOT;
if($db_authstate && $db_authreg){print <<<EOT
-->
		<div class="cc regAdd_mode" style="display:$authStep_1"  id="mobileBox">
			<dl class="cc" style="height:auto;min-height:inherit;margin-bottom:5px;">
				<dt><label for="authmobile">手機號碼<span class="s1">*</span></label></dt>
				<dd class="ip"><div style="background:#fff;"><input type="text" maxlength="75" class="input" name="authmobile" id="authmobile" value="$mobile" /></div></dd>
				<dd class="tp"><span class="bt"><span><button type="button" id="btnGetVerify">獲取驗證碼</button></span></span></dd>
				<dd class="tp"><div class="wrong" id="mobileauth_info" style="display:none"></div></dd>
			</dl>
			<div style="padding-left:145px;" class="mb10 s6">此服務免費,驗證碼將以短信免費發送到您的手機</div>
		</div>
		<div class="cc regAdd_mode" style="display:$authStep_2" id="verifyBox">
			<div style="padding:0 0 5px 145px;" class="s6">
				驗證碼已發送到<span id="mobileNumber">$mobile</span><span id="modifyMobile"></span>，如果超過{$waitTime}秒未收到驗證碼，您可以免費重新獲取。
				<p>
					<span class="bt2" style="margin:5px 0;"><span><button type="button" id="timeRemainTips">
<!-- 
EOT;
if ($remainTime > 0) { print <<<EOT
-->
					<font color="red">{$remainTime}秒</font>後重獲驗證碼
<!--
EOT;
} else {print <<<EOT
-->
					重獲驗證碼
<!--
EOT;
}print <<<EOT
-->
					</button></span></span>
				</p>
			</div>
			<dl class="cc mb10" style="height:auto;min-height:inherit;">
				<dt><label for="authverify">手機驗證碼<span class="s1">*</span></label></dt>
				<dd class="ip"><div style="background:#fff;"><input type="text" maxlength="75" name="authverify" id="authverify" class="input" /></div></dd>
				<dd class="tp"><div class="correct" id="authTips" style="display:none"></div></dd>
			</dl>
		</div>
<!-- 
EOT;
}print <<<EOT
//TODO
-->
			<dl class="cc">
				<dt><label for="regemail">電子郵箱<span class="s1">*</span></label></dt>
				<dd class="ip"><div class=""><input type="email"  maxlength="75" name="regemail" value="" class="input" id="regemail" required="required" /></div>
				<!--p class="cc"><label><input type="checkbox" name="regemailtoall" value="1" style="width:auto;padding:0;margin:0;" /> 公開電子郵箱</label></p-->
				</dd>
				<dd class="tp"><div id="email_info">
<!--
EOT;
if($rg_config['rg_emailtype'] == '1' && $rg_config['rg_email']){print <<<EOT
-->
					<div style="padding:0;position:relative;margin:-5px 0 0 -16px;width:300px;">為避免無法收取站點郵件，請使用以下電子郵箱進行注冊:<span class="s2">{$rg_config[rg_email]}</span></div>
<!--
EOT;
}print<<<EOT
--></div>
		</dd>
	</dl>
<!--
EOT;
if($rg_config['rg_allowregister']==2){print <<<EOT
-->
			<dl>
				<dt><label for="invcode">邀請注冊碼<span class="s1">*</span></label></dt>
				<dd class="ip"><div><input class="input" type="text" value="$invcode" name="invcode" id="invcode" /></div></dd>
				<dd class="tp"><div id="invcode_info"></div>
				<span>
<!--
EOT;
if($inv_config['inv_onlinesell']){print <<<EOT
--><span id="buy_invitecode"><p class="p5"><a href="javascript:;" class="s4" onMouseDown="insertOnlineSell();">購買邀請碼</a></p></span>
<!--
EOT;
}print <<<EOT
--></span>
				</dd>
			</dl>
<!--
EOT;
}
if(($db_ckquestion & 1) && $db_question){
$qkey = array_rand($db_question);
$db_question[$qkey] = addcslashes($db_question[$qkey],'"');
if(!$question){
	if($db_imagequestion){
		$question = "<img id='ckquestion' src='ckquestion.php?q=".$qkey.'&t='.$timestamp."' height='21' style='margin:0 0 0 5px;'>";
		
	}else{
		$question = $qkey<0 ? getMachineQuestion_1() :  $db_question[$qkey];
	}
}
print <<<EOT
-->
			<dl>
				<dt><label for="regpwdrepeat">防惡意注冊<span class="s1">*</span></label></dt>
				<dd class="ip"><div><input class="input" type="text" name="qanswer" id="qanswer" /><input type="hidden" id="regqkey" name="qkey" value="$qkey" /></div></dd>
				<dd class="tp"><div id="qanswer_info"></div></dd>							

			</dl>
<!--
EOT;
}if($rg_config['rg_ifcheck']){print <<<EOT
-->
			<dl class="cc">
				<dt>注冊原因<span class="s1">*</span></dt>
				<dd class="ip">
					<textarea name="regreason" style="width:222px;margin-bottom:10px;" class="textareaA"></textarea>
				</dd>
				<dd class="tp"></dd>
			</dl>
<!--
EOT;
}if($customfield){
	echo $customfieldService->getRegisterTemplate();
}print <<<EOT
-->
<!--
EOT;
if($db_ifsafecv){print <<<EOT
-->
			<dl>
				<dt>安全問題</dt>
				<dd class="ip">
					<select name="question" id="safequestion" onChange="showcustomquest(this.value)" style="width:230px">
						<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>
				</dd>
				<dd class="tp"><div id="customquested_info"><!--如果啟用了安全問題，需要填寫正確的答案才能登錄站點--></div></dd>
			</dl>
			<dl id="customquested" style="display:none">
				<dt>自定義問題</dt>
				<dd class="ip"><div><input class="input" type="text" name="customquest"></div></dd>
				<dd class="tp">&nbsp;</dd>
			</dl>
			<dl>
				<dt>您的答案</dt>
				<dd class="ip"><div><input type="text" name="answer" class="input" id="answered"></div></dd>
				<dd class="tp"><div id="answered_info"></div></dd>
			</dl>
<!--
EOT;
}if($custominfo){
print <<<EOT
-->
<!--
EOT;
foreach($custominfo as $key=>$val){
if(substr($val[3],0,1)=='1'){print <<<EOT
-->
				<dl>
					<dt>$val[0]</dt>
					<dd class="ip"><div><input class="input" type="text" name="customdata[$key]" value="" /></div></dd>
					<dd class="tp"><div class="ignore">$val[1]</div></dd>
				</dl>
<!--
EOT;
}}}if($db_gdcheck & 1){
$checkCode = L::loadClass('checkcode', 'site');
$checkCodeString = $checkCode->getCheckCodeTemplate();
print <<<EOT
-->

				<dl class="cc mb10">
						<dt><label for="gdcode">驗證碼<span class="s1">*</span></label></dt>
						<dd class="ip ck">
							<div><input id="gdcode" class="input" name="gdcode" value="" /></div>
							<span id="menu_gd" style="display:none;"></span>
$checkCodeString
						</dd>
						<dd class="tp"><div id="gdcode_info"></div></dd>
				</dl>
<!--
EOT;
}print <<<EOT
-->
				<dl style="min-height:25px;" class="cc">
					<dt>&nbsp;</dt>
					<dd class="mr10"><label><input type="checkbox" name="rgpermit" value="1" id="registerclause" />&nbsp;我已閱讀並完全同意 </label><a onClick="permit();" style="cursor:pointer" class="b s4">條款內容</a></dd>
					<dd class="tp"><div id="registerclause_info"></div></dd>
				</dl>
				<dl>
					<dt>&nbsp;</dt>
					<dd>
						<span class="btn"><span><button type="submit" onClick="checkAll(event);">提交注冊</button></span></span>
					</dd>
					<dd class="regTips">
					</dd>
				</dl>
			</div>
			</div>
			<div class="regLogin">
				<div style="padding-left:20px;">
					<p class="f14 mb5">已經擁有帳號？</p>
					<p style="padding-bottom:50px;"><span class="bt"><span><button type="button" onClick="location.href='login.php#breadCrumb';">馬上登錄</button></span></span>
					<!--p>使用合作網站帳號登錄︰</p-->
				</div>
<!--
EOT;
/* platform weibo app --start */
L::loadClass('WeiboLoginViewHelper', 'sns/weibotoplatform/viewhelper', false);
$weiboLoginService = L::loadClass('WeiboLoginService', 'sns/weibotoplatform/service');
$loginWays = $weiboLoginService->getLoginWays();
if ($loginWays) {
print <<<EOT
-->
				<link rel="stylesheet" href="u/images/expand/weibologin.css" />
				<div style="padding-left:20px;">
					<p class="f14 mb5">使用合作網站帳號登錄︰</p>
					<ul class="waysList cc">
<!--
EOT;
	foreach ($loginWays as $loginWay) {
			$windowOpenScript = WeiboLoginViewHelper_WindowOpenScript($loginWay['type']);
print <<<EOT
-->
			<li style="float:none;width:140px;"><a class="s4" title="使用{$loginWay['accountTitle']}登錄" href="javascript:;" onClick="$windowOpenScript"><img src="{$loginWay['loginLogo']}" />{$loginWay['accountTitle']}</a></li>
<!--
EOT;
	}
print <<<EOT
-->
					</ul>
				</div>
<!--
EOT;
}
/* platform weibo app --end */

print <<<EOT
-->
			</div>
		</form>
		</div>
	</div>
</div>
<script type="text/javascript" src="js/pw_register.js"></script>
<script type="text/javascript" src="js/passwordstrength.js"></script>
<script type="text/javascript">
var charset = '$db_charset';
var retminname	= parseInt('$regminname');
var regmaxname	= parseInt('$regmaxname');
var rglower		= parseInt('$rg_config[rg_rglower]');
var regminpwd 	= parseInt('$rg_regminpwd');
var regmaxpwd 	= parseInt('$rg_regmaxpwd');
var regnpdifferf= parseInt('$rg_config[rg_npdifferf]');
var regemail	= parseInt('$rg_config[rg_emailcheck]');
var regdetail	= parseInt('$rg_config[rg_regdetail]');

var inticlass 	= "ignore";
var rightclass	= "correct";
var falseclass	= "wrong";

var pwdcomplex	= '$rg_config[rg_pwdcomplex]';
//var extracheck	= new Array();//調整到pw_register.js
var checkboxArray = new Array();
var radioArray = new Array();
var regInfo 	= new Array();
var regSelects  = 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')){
	if(parseInt("$showq")>0 && parseInt("$qkey")>0){
		regInfo[5] 	= new Array(
						" ",
						"驗證答案錯誤",
						"問題:$question （答案︰$db_answer[$qkey]）");
	}
	else{
		regInfo[5] 	= new Array(
						" ",
						"驗證答案錯誤",
						"問題:$question");
	}
	var qanswer = new Element("qanswer",regInfo[5],"qanswer_info");
}
if(parseInt("$rg_config[rg_allowregister]")==2){
	var buy_invitecode = IsElement('buy_invitecode') ? getObj('buy_invitecode').innerHTML : '';
	regInfo[6] 	= new Array(
						" ",
						"邀請碼不能為空",
						"邀請碼錯誤",
						"本站開啟邀請注冊,請填寫邀請碼" + buy_invitecode);
	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){}
}

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($customfield){
$registerScripts = $customfieldService->getRegisterScripts();
}
print <<<EOT
-->
$registerScripts
function showcustomquest(qid) {
	getObj("customquested").style.display = qid==-1 ? '' : 'none';
}
function insertOnlineSell() {
	
	var menu_editor = getObj("menu_editor");
	//menu_editor.innerHTML = '';
	read.open('menu_editor','','2');
}
onReady(function(){
	if (regdetail) {
		setTimeout('permit();',1000);
	} else {
		getObj('registerclause').checked="checked";
		setTimeout(function(){
			getObj('regname').focus();
		}, 500);
	}
});
</script>
<!-- 
EOT;
if ($db_authstate && $db_authreg) {print <<<EOT
-->
<script type="text/javascript">
var waitTime = parseInt('$waitTime');
var timeRemain = parseInt('$remainTime');
var authStep = parseInt('$authStep');
var authInfo = new Array("",
	"與服務器通信失敗,請稍候再試",
	"手機號碼輸入有誤",
	"該手機號碼已經綁定實名認證",
	"你今天獲取驗證碼次數已達到上限",
	"驗證碼輸入有誤",
	"您的帳戶尚未綁定手機認證",
	"手機驗證碼不能為空",
	"您的手機號碼已被列入黑名單"
);

/*手機實名認證*/
var url		= location.href;
var intval	= null;

var btnGetVerify = getObj('btnGetVerify');
btnGetVerify.onclick = function(){/*獲取驗證碼事件*/
	var mobile = getObj('authmobile');
	var mobileTips = getObj('mobileauth_info');
	if(!/^1\d{10}$/.test(mobile.value)){
		mobileTips.innerHTML = authInfo[2];
		mobileTips.style.display = '';
		mobile.onfocus = function(){mobileTips.style.display = 'none';}
	}else{
		btnGetVerify.disabled = true;
		verify(mobile.value);
	}
	return false;
}

getObj('authverify').onblur = function(){
	if(getObj('authverify').value != ''){
		//檢查驗證碼
		var data 	= "action=auth&step=2&mobile="+getObj('authmobile').value+"&authverify="+getObj('authverify').value;
		ajax.send(url,data,function(){
		var response = parseInt(ajax.request.responseText);
			if (response > 0){
				getObj('authTips').innerHTML = authInfo[response];
				getObj('authTips').className = 'wrong';
			}else{
				/*成功獲取驗證碼*/
				getObj('authTips').innerHTML = '';
				getObj('authTips').className = 'correct';
			}
		});
	}else{
		getObj('authTips').innerHTML = authInfo[7];
		getObj('authTips').className = 'wrong';
		getObj('authTips').onfocus = function(){getObj('authTips').style.display = 'none';}
	}
	getObj('authTips').style.display = '';
}

var setCheckTime = function() {
	timeRemain -= 1;
	if (timeRemain > 0) {
		getObj("timeRemainTips").innerHTML = '<font color="red">'+timeRemain+'秒</font>後重獲驗證碼';
		getObj("modifyMobile").innerHTML = '';
		getObj("timeRemainTips").disabled = true;
	} else {
		clearInterval(intval);
		intval = null;
		timeRemain = waitTime;
		getObj("timeRemainTips").disabled = false;
		getObj("timeRemainTips").innerHTML = '重獲驗證碼';
		//if(true){//修改手機號碼
			getObj("modifyMobile").innerHTML = '（<a href="javascript://" class="s4" >修改號碼</a>）';
			getObj("modifyMobile").onclick = function(){
				getObj("modifyMobile").innerHTML = '';
				getObj('mobileBox').style.display = '';
				getObj('verifyBox').style.display = 'none';
				getObj('btnGetVerify').disabled = false;
				return false;
			}
		//}
		getObj("timeRemainTips").onclick=function(){
			if (timeRemain == waitTime || timeRemain == 0) {
				verify(getObj('authmobile').value);
			}
		};
	}
}

function verify(mobileNumber){
	var data 	= "action=auth&step=1&mobile="+mobileNumber;
	getObj('mobileauth_info').style.display = 'none';
	ajax.send(url,data,function(){
		var response = parseInt(ajax.request.responseText);
		if (response > 0){
			getObj("timeRemainTips").disabled = false;
			btnGetVerify.disabled = false;
			getObj('mobileauth_info').innerHTML = authInfo[response];
			getObj('mobileauth_info').style.display = '';
		} else {
			/*成功獲取驗證碼*/
			getObj('verifyBox').style.display = '';
			getObj('mobileBox').style.display = 'none';
			getObj('mobileNumber').innerHTML = mobileNumber;
			if(intval == null) intval = setInterval(setCheckTime,1000);
		}
	});
}
if (authStep == 2) {
	intval = setInterval(setCheckTime,1000);
}
//end
</script>
<!-- 
EOT;
}print <<<EOT
-->
<!--
EOT;
}elseif($step=='finish'){
if(S::getGP('vip') == 'activating'){
$jumpurl = "$db_registerfile?step=finish&varify=$verifyhash";
print<<<EOT
-->
<div id="pw_content">
	<div class="p20">
		<div class="regTitle cc">
			<h5 class="s6">郵件激活</h5>
		</div>
		<div class="cc">
			<div class="regCorrect">
<form action="$loginurl" method="post" name="activate">
<input type="hidden" value="$verifyhash" name="verify"/>
<input type="hidden" value="$jumpurl" name="jumpurl"/>
				<p class="f14 mb10">親愛的會員，您郵件激活成功。</p>
				<p><span class="btn" style="margin:0 25px 0 0;"><span><button type="submit">立即登錄</button></span></span><a href="./$db_bfn" class="s4">先去逛逛</a></p>
</form>
			</div>
		</div>
	</div>
</div>
<!--
EOT;
}elseif($rg_config['rg_emailcheck'] && !$winduid) {
print<<<EOT
-->
<div id="pw_content">
	<div class="p20">
		<div class="regTitle cc">
			<h5 class="s6">注冊</h5>
		</div>
        <div class="cc">
<!--
EOT;
if($newemail && $_GET[verify] && $r==2){
list(,$emailurl) = explode('@',$newemail);
$emailurl = 'http://mail.'.$emailurl;
print <<<EOT
-->
			<div class="regIgnore">
			<p class="f14 mb10">郵箱修改成功，系統已經向您填寫的<a href='$emailurl'>{$newemail}</a>的郵箱發送激活郵件，點擊郵件中的鏈接即可完成激活。</p>
				<p class="f14">如果沒有收到激活郵件，您可以<a onClick="read.open('postbatch',this,2);" class="b s4 cp" target="_blank">更改郵箱</a>，或者<a href="$db_registerfile?step=finish&email=$newemail&verify=$_GET[verify]&r=1" class="b s4">重發激活郵件</a></p>
			</div>
<!--
EOT;
}elseif(($email || $newemail) && $r==3){
$email = $email ? $email : $newemail;
print <<<EOT
-->
			<div class="regIgnore">
			<p class="f14 mb10">系統已經重新向您填寫的<a href='$emailurl'>{$email}</a>的郵箱發送激活郵件，點擊郵件中的鏈接即可完成激活。</p>
				<p class="f14">如果沒有收到激活郵件，您可以<a onClick="read.open('postbatch',this,2);" class="b s4 cp" target="_blank">更改郵箱</a>，或者<a href="$db_registerfile?step=finish&email=$email&verify=$_GET[verify]&r=1" class="b s4">重發激活郵件</a></p>
			</div>

<!--
EOT;
}elseif($email && $rg_config['rg_emailcheck'] && $_GET[verify]){
print<<<EOT
-->
			<div class="regCorrect">
				<p class="f14 mb10">恭喜您注冊成功，系統已經向您填寫的<a href='$emailurl'>{$email}</a>的郵箱發送激活郵件，點擊郵件中的鏈接即可完成激活。</p>
				<p class="f14">如果沒有收到激活郵件，您可以<a onClick="read.open('postbatch',this,2);" class="b s4 cp" target="_blank">更改郵箱</a>，或者<a href="$db_registerfile?step=finish&email=$email&verify=$_GET[verify]&r=1" class="b s4">重發激活郵件</a></p>
			</div>
<!--
EOT;
}elseif($email && $rg_config['rg_emailcheck']) {
print<<<EOT
-->
			<div class="regIgnore">
				<p class="f14 mb10">對不起您尚未進行郵箱激活，請先前往您填寫的<a href='$emailurl'>{$email}</a>郵箱，點擊郵件中的鏈接即可完成激活</p>
				<p class="f14">如果沒有收到激活郵件，您可以<a onClick="read.open('postbatch',this,2);" class="b s4 cp" target="_blank">更改郵箱</a>，或者<a href="$db_registerfile?step=finish&email=$email&verify=$_GET[verify]&r=1" class="b s4">重發激活郵件</a></p>
			</div>              
<!--
EOT;
}
$email = $email ? $email : $newemail;
print<<<EOT
-->          
		</div>
	</div>
</div>
<!-- //start post管理彈出 -->
<div id="postbatch"  style="display:none">
<div class="popout"><table border="0" cellspacing="0" cellpadding="0"><tbody><tr><td class="bgcorner1"></td><td class="pobg1"></td><td class="bgcorner2"></td></tr><tr><td class="pobg4"></td><td><div class="popoutContent">
	<div class="popTop" style="cursor:move;" onmousedown = "read.move(event);">
		<a href="javascript:void(0)" class="adel" onClick="closep()">關閉</a>
		更改郵箱
	</div>
	<div class="p15 cc">
    	<form action="$db_registerfile?step=finish" method="post" name="reregister">
     	<input type="hidden" name="email" value="$email" />
        <input type="hidden" name="verify" value="$verifyhash" />
			<p class="mb10">說明︰發送新的驗證郵件後，上一封郵件自動失效</p>
    	<p><input class="input input_wa mr5" type="text" name="newemail" maxlength="75px" value="$email" /><span class="btn2"><span><button type="submit">發送激活郵件</button></span></span></p>
    	</form>
    </div>
</div></td><td class="pobg2"></td></tr><tr><td class="bgcorner4"></td><td class="pobg3"></td><td class="bgcorner3"></td></tr></tbody></table></div>
</div>
 <!-- //end reply管理彈出 -->
<!--
EOT;
}elseif($rg_config['rg_regguide']) {
if ($option == 1) {
print<<<EOT
-->
<div id="pw_content">
	<div class="p20">
		<div class="regTitle cc">
			<ol class="steps pr fr">
				<li class="current"><em>1</em>設置頭像</li>
				<li><em>2</em>完善資料</li>
				<li><em>3</em>關注感興趣的人</li>
			</ol>
			<h5 class="s6">恭喜您完成注冊，完善以下信息讓您的社區旅途更豐富！</h5>
		</div>
		<div class="cc">
			<div class="regForm-wrap">
				<div class="regForm">
					<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="1" />
						<input type="hidden" name="isupload" value="1" />
					<dl class="cc">
						<dt><img src="$imgpath/face/none.gif" name="useravatars" class="img" /></dt>
						<dd>
							<div id="openchang">
<!--
EOT;
if(!($db_ifupload && $_G[upload])){
$defaultCheckFirst = 'checked="checked"';
}
print <<<EOT
-->
								<label class="mr20" for="facetype1"><input type="radio" id="facetype1" name="facetype" $defaultCheckFirst value="1" onClick="CkFaceType(this.value)">系統頭像</label>
<!--
EOT;
if($_G[allowportait]){print <<<EOT
-->
								<label class="mr20" for="facetype2"><input type="radio" id="facetype2" name="facetype" value="2" onClick="CkFaceType(this.value)">頭像鏈接</label>
<!--
EOT;
}if($db_ifupload && $_G[upload]){print <<<EOT
-->
								<label class="mr20" for="facetype3"><input type="radio" id="facetype3" name="facetype" checked="checked" value="3" onClick="CkFaceType(this.value)">頭像上傳</label>
<!--
EOT;
}print <<<EOT
-->
								<div class="c mb10"></div>
								<div id="face1">
									<div id="iconbox">
<!--
EOT;
if ($num > 10) {print <<<EOT
-->
										<div class="mb10">
											<a onClick="showSystemIcon(2);" href="javascript:;">下一頁</a>
										</div>
<!--
EOT;
}print <<<EOT
-->
										<div class="profileFace">
											<ul class="cc">
<!--
EOT;
foreach ($imgname_array as $key => $value) {print <<<EOT
-->
												<li onClick="showimage('$imgpath','$value')"><img src='$imgpath/face/$value' width="50" height="50" class="img"></li>
<!--
EOT;
}print <<<EOT
-->
											</ul>
										</div>
									</div>
									<input type="hidden" name="proicon" value="" />
								</div>
								<div id="face2" style="display:none;">
									<div>
										<p class="mb10"><span class="mr20">頭像鏈接</span><input name="httpurl[0]" id="httpurl_url" value="$httpurl" class="input input_wb mr10" type="text" /> 必須以 http://開頭</p>
									</div>
								<input type="hidden" id="httpurl_w" name="httpurl[3]" />
								<input type="hidden" id="httpurl_h" name="httpurl[4]" />
								</div>
								<div id="face3" style="display:none;">
<!--
EOT;
if($db_bbsifopen != 1){print <<<EOT
-->
<div class="blockquote3">
抱歉，站點正處于內部開放狀態，只有在完全開放狀態下，才能使用頭像上傳功能。<br />
<span class="gray">（站點狀態的後台設置路徑︰全局 &#187; 站點設置）</span>
</div>
<!--
EOT;
}else{print <<<EOT
-->
									<div style="overflow:hidden;">
									<div style="margin-left:-20px;margin-top:-8px;">
									<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase=" http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="500" height="405" id="FlashVars" align="middle">
										<param name="movie" value="js/face.swf" />
										<param name="FlashVars" value="$icon_encode_url" />
										<param name="allowScriptAccess" value="always" />
                    <param name="wmode" value="transparent" />
										<embed  width="500" height="405" src="js/face.swf" flashvars="$icon_encode_url" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"  type="application/x-shockwave-flash" />
									</object>
									</div>
									</div>
<!--
EOT;
}print <<<EOT
-->
								</div>
							</div>
						</dd>
					</dl>
					<dl style="padding-top:10px;_padding-top:0;">
						<dt>&nbsp;</dt>
						<dd>
							<span class="btn" id="register_success"><span><button type="submit">提交</button></span></span>
							<span class="bt"><span><button onClick="javascript:location.replace('$skipUrl')" type="button">跳過</button></span></span>
						</dd>
					</dl>
					</form>
				</div>

			</div>
		</div>
	</div>
</div>
<iframe id="hideframe" name="hideframe" width="0" height="0" marginwidth="0" frameborder="0" src="about:blank"></iframe>
<script>
var display = '$display';
var imgpath = '$imgpath';
var defaultCheckType = '$defaultCheckFirst';

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';
		}
	}
}
if (defaultCheckType) {
	CkFaceType('1');
} else {
	CkFaceType('3');
}

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&from=reg&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","請選擇要上傳附件");
	}
}
var facetype = '$facetype';
if (facetype) {
	CkFaceType('$facetype');
}
//window.history.forward();
</script>
<!--
EOT;
} elseif ($option == 2) {
	$registerScripts = $customfieldService->getRegisterScripts(2);
print<<<EOT
-->
<div id="pw_content">
	<div class="p20">
		<div class="regTitle cc">
			<ol class="steps pr fr">
				<li><em>1</em>設置頭像</li>
				<li class="current"><em>2</em>完善資料</li>
				<li><em>3</em>關注感興趣的人</li>
			</ol>
			<h5 class="s6">恭喜您完成注冊，完善以下信息讓您的社區旅途更豐富！</h5>
		</div>
		<div class="cc">
			<div class="regForm-wrap">
			<div class="regForm">
			<form action="$db_registerfile?" method="post" name="register">
				<input type="hidden" name="step" value="finish" />
				<input type="hidden" name="verify" value="$verifyhash" />
				<input type="hidden" name="option" value="2" />
				<input type="hidden" name="notskip" value="1" />
<!--
EOT;
echo $complementTemplate;
print<<<EOT
-->
				<dl style="padding-top:10px;_padding-top:0;">
					<dt>&nbsp;</dt>
					<dd>
						<span class="btn"><span><button type="button" onClick="checkAll(event);">提交</button></span></span>
						<span class="bt"><span><button onClick="javascript:location.replace('$skipUrl')" type="button">跳過</button></span></span>
					</dd>
				</dl>
			</form>
			</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript" src="js/pw_register.js"></script>
<script type="text/javascript">
var imgpath = '$imgpath';
//var extracheck	= new Array();//調整到pw_register.js
var checkboxArray = new Array();
var radioArray = new Array();
var regInfo 	= new Array();
var inticlass 	= "ignore";
var rightclass	= "correct";
var falseclass	= "wrong";
$registerScripts
window.history.forward();
</script>
<!--
EOT;
} elseif ($option == 3) {
print<<<EOT
-->
<div id="pw_content">
	<div class="p20">
		<div class="regTitle cc">
			<ol class="steps pr fr">
				<li><em>1</em>設置頭像</li>
				<li><em>2</em>完善資料</li>
				<li class="current"><em>3</em>好友推薦</li>
			</ol>
			<h5 class="s6">恭喜您完成注冊，完善以下信息讓您的社區旅途更豐富！</h5>
		</div>
		<div class="cc">
			<div class="regForm-wrap">
				<form id="creator" name="creator" action="$db_registerfile?" method="post" enctype="multipart/form-data">
				<input type="hidden" name="step" value="finish" />
				<input type="hidden" name="verify" value="$verifyhash" />
				<input type="hidden" name="option" value="3" />
				<input type="hidden" name="attention" value="1" />
				<div style="padding-top:0;padding-left:50px;">

<!--
EOT;
if ($rg_config['rg_recommendnames']) {
print<<<EOT
-->
					<h2 class="s6">社區達人</h2>
					<ul class="cc recommend">
<!--
EOT;
foreach ($members as $user) {
print<<<EOT
-->
						<li><input name="uids[]" type="checkbox" value="{$user[uid]}" checked><a href="u.php?uid=$user[uid]" target="_blank"><img src="{$user[face]}" class="face"></a><a href="u.php?uid=$user[uid]" target="_blank">{$user[username]}</a>
<!--
EOT;
if(checkOnline($user['thisvisit'])){
$gender = getDefaultGender($user['gender']);
print <<<EOT
-->
						<span class="{$gender}_ol mr5" title="在線" alt="在線">在線</span>
<!--
EOT;
}print <<<EOT
-->
						</li>
<!--
EOT;
} print<<<EOT
-->
					</ul>
<!--
EOT;
} if ($mayKnownUsers) {print<<<EOT
-->
					<h2 class="s6">可能認識的人</h2>
					<ul class="cc recommend">
<!--
EOT;
foreach ($mayKnownUsers as $user) {
print<<<EOT
-->
						<li><input name="uids[]" type="checkbox" value="{$user[uid]}" checked><a href="u.php?uid=$user[uid]" target="_blank"><img src="{$user[face]}" class="face"></a><a href="u.php?uid=$user[uid]" target="_blank">{$user[username]}</a>
<!--
EOT;
if(checkOnline($user['thisvisit'])){
$gender = getDefaultGender($user['gender']);
print <<<EOT
-->
						<span class="{$gender}_ol mr5" title="在線" alt="在線">在線</span>
<!--
EOT;
}print <<<EOT
-->
						</li>
<!--
EOT;
} print<<<EOT
-->
					</ul>
<!--
EOT;
} print<<<EOT
-->
					</ul>
<!--
EOT;
if (!$rg_config['rg_recommendnames'] && !$mayKnownUsers) {
print<<<EOT
-->
					<div class="regIgnore">
						<p class="f14 mb10">對不起，還沒有您可能感興趣的人，請聯系站長通過後台配置！</p>
					</div>
<!--
EOT;
} print<<<EOT
-->
					<div style="padding-left:24px;"><span class="btn"><span><button type="submit">關注已選用戶</button></span></span><span class="bt"><span><button onClick="javascript:location.replace('$skipUrl')" type="button">跳過</button></span></span></div>
				</div>
			  </form>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
window.history.forward();
</script>
<!--
EOT;
} elseif ($option == 4) {
print<<<EOT
-->
<div id="pw_content">
	<div class="p20">
		<div class="regTitle cc">
			<h5 class="s6">恭喜您完成注冊，趕緊去開始豐富的社區旅途吧！</h5>
		</div>
		<div class="cc">
			<div class="regForm-wrap">
				<div  style="padding-left:40px;">
<!--
EOT;
if ($rg_recommendcontent) {
print<<<EOT
-->
					<h2 class="s6">精彩推薦</h2>
					<div class="mb20">
						$rg_recommendcontent
					</div>
<!--
EOT;
} if ($latestImageThreads) {print<<<EOT
-->
					<h2 class="s6">可能感興趣的內容</h2>
					<ul class="cc regList_img">
<!--
EOT;
foreach ($latestImageThreads as $thread) {
print<<<EOT
-->
						<li><a href="read.php?tid=$thread[tid]"><img src="$thread[thumb]" onerror="this.src='images/defaultactive.jpg'" width="100" height="100">$thread[subject]</a></li>
<!--
EOT;
}print<<<EOT
-->
					</ul>
<!--
EOT;
}
$indexurl = $db_bbsurl.'/'.$db_bfn;
print<<<EOT
-->
					<div class="tac"><span class="bt2"><span><button type="button" onClick="location.href='$indexurl';">返回首頁</button></span></span><span class="bt2"><span><button type="button" onClick="location.href='u.php?verify=$verifyhash';">前往個人中心</button></span></span></div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
window.history.forward();
</script>
<!--
EOT;
}} else{
$indexurl = $db_bbsurl.'/'.$db_bfn;
print<<<EOT
-->
<div id="pw_content">
	<div class="p20">
		<div class="regTitle cc">
			<h5 class="s6">注冊成功</h5>
		</div>
		<div class="cc">
			<div class="regCorrect">
				<p class="f14 mb10">恭喜您注冊成功，現在就開始精彩的旅程吧...</p>
				<p><span style="margin-right:25px;"><a class="s4" href="$indexurl">返回首頁</a></span><a href="u.php?verify=$verifyhash" class="s4">前往個人中心</a></p>
			</div>
		</div>
	</div>
</div>     
<!--
EOT;
}} print<<<EOT
-->
</div></div><!--.main-wrap,#main End-->

</div>

</body></html>
<!--
EOT;
} if ($step != 'permit') {print <<<EOT
-->
<div id="menu_editor" style="display:none;">
<div class="popout"><table border="0" cellspacing="0" cellpadding="0"><tbody><tr><td class="bgcorner1"></td><td class="pobg1"></td><td class="bgcorner2"></td></tr><tr><td class="pobg4"></td><td>
<div class="popoutContent">
	<div style="width:400px;">
		<div class="popTop" onMouseDown="read.move(event);" style=" cursor:move;"><span class="adel cp" onClick="closep();">關閉</span>購買邀請碼</div>
			<form action="$db_registerfile?" method="post">
			<input type="hidden" name="action" value="pay" />
			<input type="hidden" name="step" value="3" />
			<div class="p10"><div class="ignoreTip" style="border-left:0;border-right:0;">購買一個邀請碼需要$inv_config[inv_price]元，有效期$inv_config[inv_days]天，請及時注冊</div></div>
<!--
EOT;
if(!empty($_POST['step'])){print <<<EOT
-->
			<div class="p10" style="padding-top:0;"><div class="rightTip">提示︰您輸入的電子郵箱中 ($email) 已經有一個生成訂單，您確定現在支付？<input type="hidden" name="submit" value="1" /></div></div>
<!--
EOT;
}print <<<EOT
-->
			<table width="100%" class="vt">
				<tr>
					<td style="padding-left:20px;">購買的個數</td>
					<td><input class="input input_wa" type="text" name="invnum" value="$num" /></td>
				</tr>
				<tr>
					<td style="padding-left:20px;">接收邀請碼的電子郵箱</td>
					<td><input class="input input_wa mb5" type="text" name="email" value="$email" /><p>我們會將邀請碼發送到這個電子郵箱</p></td>
				</tr>
			</table>
			<div class="popBottom"><span class="btn2"><span><button type="submit">確認購買</button></span></span></div>
			</form>
	</div>
</div>
</td><td class="pobg2"></td></tr><tr><td class="bgcorner4"></td><td class="pobg3"></td><td class="bgcorner3"></td></tr></tbody></table></div>
</div>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
?>-->