<!--<?php 
if($groupid=='guest'){
$arr_logintypename = array('用戶名','UID','電子郵箱');
print <<<EOT
-->
<form action="$db_bbsurl/login.php" name="login_FORM" method="post" onsubmit="return headerAjaxLogin.login(document.login_FORM);">
<input type="hidden" name="jumpurl" value="{$pwServer['HTTP_REFERER']}" />
<input type="hidden" name="step" value="2" />
<input type="hidden" name="cktime" value="31536000" />
<input type="hidden" name="ajax" value="1" />
<div class="header_login fr">
<table style="table-layout:fixed;">
	<tr>
		<td width="145">
<!--
EOT;
if (count($_LoginInfo['logintype']) >1) {print <<<EOT
-->
		<span class="fl"><a href="javascript:;" hidefocus="true" title="切換登錄方式" class="select_arrow" onclick="showLoginType();">下拉</a></span>
		<div class="fl">
			<div class="pw_menu" id="login_type_list" style="position:absolute;display:none;margin:20px 0 0 0;">
				<ul class="menuList tal" style="width:134px;">
<!--
EOT;
foreach($_LoginInfo['logintype'] as $v){print <<<EOT
-->
					<li><a href="javascript:;" onclick="selectLoginType('$v','$arr_logintypename[$v]')" hidefocus="true">$arr_logintypename[$v]</a></li>
<!--
EOT;
}print <<<EOT
-->
				</ul>
			</div>
			</div>
<!--
EOT;
}print <<<EOT
-->
			<div class="login_row mb5"><label for="nav_pwuser" class="login_label">用戶名</label><input type="text" class="input fl gray" onfocus="navCheckinput(this);" onblur="navCheckinput(this);" name="pwuser" id="nav_pwuser" value="輸入用戶名"></div>
			<div class="login_row"><label for="showpwd" class="login_label">密　碼</label><input type="password" name="pwpwd" id="showpwd" class="input fl"></div>
		</td>
		<td width="75">
			<div class="login_checkbox" title="下次自動登錄"><input type="checkbox" id="head_checkbox" name="cktime" value="31536000"><label for="head_checkbox">記住登錄</label></div>
			<span class="bt2 fl"><span><button type="submit" name="head_login" style="width:70px;">登錄</button></span></span>
		</td>
		<td width="70">
			<a href="sendpwd.php" class="login_forget" rel="nofollow">找回密碼</a>
			<span class="btn2 fl"><span><button type="button" style="width:70px;" onClick="location.href='$db_bbsurl/$regurl#breadCrumb';">注冊</button></span></span>
		</td>
	</tr>
</table>
</div>





<!--
EOT;
if (count($_LoginInfo['logintype'])>=1) {
$value = $_LoginInfo['logintype'][0];
empty($value) && $value = 0;
print <<<EOT
-->
<input type="hidden" name="lgt" id="nav_lgt" value="$value">
<!--
EOT;
} else {
print <<<EOT
-->
<input type="hidden" name="lgt" id="nav_lgt" value="0">
<!--
EOT;
}
print <<<EOT
-->
</form>
<!--
EOT;
/* platform weibo app --start */
L::loadClass('WeiboLoginViewHelper', 'sns/weibotoplatform/viewhelper', false);
$weiboLoginService = L::loadClass('WeiboLoginService', 'sns/weibotoplatform/service');
$loginWays = $weiboLoginService->getLoginWays();
if ($loginWays) {
	$firstWay = array_shift($loginWays);
	$windowOpenScript = WeiboLoginViewHelper_WindowOpenScript($firstWay['type']);
print <<<EOT
-->
<link rel="stylesheet" href="u/images/expand/weibologin.css" />
<div class="loginWays fr" style="position: relative;" onmouseover="showlogin(this)" onmouseout="hidelogin(this)">
	<span id="weibo_login" class="firstWay cp">
		<a href="javascript:;" onclick="$windowOpenScript"><img src="{$firstWay['loginLogo']}" alt="使用{$firstWay['accountTitle']}登錄">{$firstWay['accountTitle']}登錄</a>
		<span class="icon-down"></span>
	</span>
	<span class="text">內容互通，快速登錄</span>

<!--
EOT;
	if ($loginWays) {
print <<<EOT
-->
<div id="menu_weibo_login" class="pw_menu" style="display: none;position: absolute; top:24px; left:0px;z-index:10;">
    <ul class="menuList" style="width:118px;">
<!--
EOT;
		foreach ($loginWays as $restWay) {
			$windowOpenScript = WeiboLoginViewHelper_WindowOpenScript($restWay['type']);
print <<<EOT
-->
        <li><a title="使用{$restWay['accountTitle']}登錄" href="javascript:;" onclick="$windowOpenScript"><img src="{$restWay['loginLogo']}" />{$restWay['accountTitle']}登錄</a></li>
<!--
EOT;
		}
print <<<EOT
-->
    </ul>
</div>
<!--
EOT;
	}
print <<<EOT
-->
</div>
<script type="text/javascript">

function showlogin(obj){
	if (getObj('menu_weibo_login')) getObj('menu_weibo_login').style.display=''
}
function hidelogin(obj){
	if (getObj('menu_weibo_login')) getObj('menu_weibo_login').style.display='none'
}
</script>
<!--
EOT;
}
/* platform weibo app --end */

print <<<EOT
-->

<script type="text/javascript">
var default_login_type = '$value';
var default_input_value = '輸入' + '$arr_logintypename[$value]';

function check_user(obj){
	if(obj.value=="用戶名"){
		obj.value='';
	}else if(obj.value==""){
		obj.value='用戶名';
	}
}

function check_password(obj,type){
	if(type=='onfocus'){
		obj.style.display='none';
		getObj('relpwd').style.display='';
		getObj('relpwd').focus();
	}else{
		if(obj.value==''){
			obj.style.display='none';
			getObj('showpwd').style.display='';
		}
	}
}

function navCheckinput(obj){
	if (obj.className.indexOf('gray')!=-1) {
		obj.value = '';
		obj.className = obj.className.replace('gray', 'black');
	} else if (obj.value=='') {
		obj.value = obj.defaultValue = default_input_value;
		if (obj.className.indexOf('black') == -1) {
			obj.className += ' gray';
		} else {
			obj.className = obj.className.replace('black', 'gray');
		}
	}
}

function showLoginType(){
	if(getObj('login_type_list').style.display=='none'){
		getObj('login_type_list').style.display = '';
	} else {
		getObj('login_type_list').style.display = 'none';
	}
	if (IsElement('nav_logintab')){
		getObj('nav_logintab').style.display = 'none';
	}
}

function showcustomquest(qid){
	getObj('othercustomquest').style.display = qid==-1 ? '' : 'none';
}

function changeDefaultInputValue(text){
	getObj('nav_pwuser').value = text;
	getObj('nav_lgt').value = default_login_type;
}

function selectLoginType(type,text){
	var nav_pwuser = getObj('nav_pwuser');
	nav_pwuser.value = '輸入'+text;
	if (nav_pwuser.className.indexOf('black') != -1) {
		nav_pwuser.className = nav_pwuser.className.replace('black', 'gray');
	}
	getObj('nav_lgt').value = type;
	getObj('login_type_list').style.display = 'none';
}

var headerAjaxLogin = {
	'username' : '',
	'pwd' : '',
	'login' : function(obj) {
		var _this = this;
		var username = obj.pwuser.value;
		if ((!username || username.indexOf('輸入')===0) && !obj.pwpwd.value) {
			document.location.href="login.php";
			return false;
		}
		obj.head_login.disabled = true;
		_this.username = obj.pwuser.value;
		_this.pwd = obj.pwpwd.value;
		_this.submitBasicInfo(obj);
		return false;
	},
	
	'submitBasicInfo' : function(obj) {
		var url = 'login.php';
		if(getObj("headbase")){
			var baseUrl=getObj("headbase").href;
			var dm=document.domain;
			var old_dm=/^http:\/\/(([\w-]+\.)+[\w-]+)\//.exec(baseUrl)[1];
			if(old_dm!=dm){
				getObj("headbase").setAttribute("href",baseUrl.replace(old_dm,dm));
			}
		}
		ajax.send(url, obj, function() {
			var rText = ajax.request.responseText.split('\t');
			if (rText[0] == 'error') {
				showDlg('error', rText[1], 2);
				obj.head_login.disabled = false;
			} else if (rText[0] == 'success') {
				document.location.href = rText[1];
			} else {
				ajax.get('', '1','',1);
				var dd=document.documentElement;
				var cw=dd.clientWidth;
				var sh=dd.scrollHeight;
				var div=document.createElement("div");
				div.setAttribute("id","headerTmpMask");
				div.style.position="absolute";
				div.style.width=cw+"px";
				div.style.height=sh+"px";
				div.style.left=0;
				div.style.top=0;
				div.style.backgroundColor="#333";
				div.style.opacity="0.5";
				div.style.filter="alpha(opacity=50)";
				div.style.zIndex=1000;
				document.body.appendChild(div);
			}
		});
		return false;
	},
	
	'submitCheckInfo' : function(obj) {
		var _this = this;
		var url = 'login.php';
		var ifChangeGdcode = true;
		obj.pwuser.value = _this.username;
		obj.pwpwd.value = _this.pwd;
		ajax.send(url, obj, function() {
			var rText = ajax.request.responseText.split('\t');
			if (rText[0] == 'error') {
				if (rText[1] == 'gdcodeerror') {
					getObj('headrajaxlogintip').innerHTML = '驗證碼不正確或已過期';
				} else if (rText[1] == 'ckquestionerror') {
					getObj('headrajaxlogintip').innerHTML = '請輸入正確的驗證問題答案';
				} else if (rText[1] == 'safequestionerror') {
					getObj('headrajaxlogintip').innerHTML = '安全問題錯誤,您還可以嘗試 ' + rText[2] + ' 次';
				}
				getObj('headrajaxlogintip').style.display = '';
			} else if (rText[0] == 'success') {
				location.href = rText[1];
				ifChangeGdcode = false;
			} else {
				getObj('headrajaxlogintip').innerHTML = rText[0];
				getObj('headrajaxlogintip').style.display = '';
			}
			if (ifChangeGdcode && getObj('changeGdCode')) getObj('changeGdCode').onclick();
		});
		return false;
	},
	
	'close' : function(obj) {
		document.login_FORM.head_login.disabled = false;
		closep();
		if(getObj("headerTmpMask")){
			var mask=getObj("headerTmpMask");
			mask.parentNode.removeChild(mask);
		}
	}
};
</script>
<!--
EOT;
} else {
$db_menuinit .= ",'td_userinfomore' : 'menu_userinfomore','td_profile' : 'menu_profile'";
print <<<EOT
-->
<dl class="login fr">
  	 <dt class="fr"><a href="u.php" hidefocus="true" class="img_50"><img alt="$windid" src="$_LoginInfo[faceurl]" /></a></dt>
       	<dd class="fr">
         	<p class="l_info mb5"><span id="td_userinfomore" style="padding:0 5px;"><a href="u.php" class="b link_down"><span>$windid</span></a></span><span class="mr5"></span><a href="$loginouturl" class="mr5">退出</a><span class="gray mr5">|</span>
<script type="text/javascript">
var td_userinfomore = {
	pz : 21,
	open : function() {
		getObj('td_userinfomore').className = 'current';
		if (typeof userBinding == 'object') {
			userBinding.append();
		}
	},
	close : function () {
		getObj('td_userinfomore').className = '';
	}
}
</script>
<a href="message.php" class="mr5">消息{$tmpMsgNums}</a><span id="td_profile" class="pd5"><a id="td_profile" class="link_down" href="profile.php?action=modify" target="_blank"><span>設置</span></a></span><!--
EOT;
if(CkInArray($windid,$manager) || $SYSTEM['allowadmincp']){
print <<<EOT
--><span class="gray mr5">|</span><a href="$db_adminfile" target="_blank">系統設置</a>
<!--
EOT;
}
print <<<EOT
--></p>
			<p>{$db_moneyname}︰<a href="userpay.php" class="mr10">$winddb[money] $db_moneyunit</a>{$db_rvrcname}︰<a href="userpay.php" class="mr10">$userrvrc $db_rvrcunit</a>身份︰<a href="profile.php?action=permission
">{$gp_grouptitle}</a></p>
		</dd>
	</dl>
<!--
EOT;
}
print <<<EOT
-->
<!--
EOT;
if (getstatus($winddb['userstatus'],12)) {print <<<EOT
-->
<script type="text/javascript" src="js/userbinding.js"></script>
<!--
EOT;
}if ($winduid){print<<<EOT
-->
<div id="menu_userinfomore" class="cc pw_menu" style="display:none;">
	<h6 style="left:-1px;right:auto;"><a href="u.php" class="b link_down"><span>$windid</span></a></h6>
	<div>
		<ul class="menu-half cc" style="width:26em;">
<!--
EOT;
if ($gp_gptype == 'member') {print <<<EOT
-->
		<li>等級: $gp_grouptitle</li>
<!--
EOT;
} else {print <<<EOT
-->
		<li>身份: $gp_grouptitle</li>
<!--
EOT;
}if ($_G['allowhide']) {print <<<EOT
-->
		<li>狀態:
<span style="cursor:pointer;" onclick="ajax.send('pw_ajax.php?action=changestate','',changeState)" id="online_state">
<!--
EOT;
if (GetCookie('hideid') == 1) {print <<<EOT
--><img src="$imgpath/stealth.png" align="absmiddle" />隱身
<!--
EOT;
} else {print <<<EOT
--><img src="$imgpath/online.png" align="absmiddle" />在線
<!--
EOT;
}print <<<EOT
--></span>
<script type="text/javascript">
function changeState() {
	var msg = ajax.request.responseText;
	if (msg == 1){
		getObj('online_state').innerHTML = '<img src="$imgpath/stealth.png" align="absmiddle" />隱身';
	}else{
		getObj('online_state').innerHTML = '<img src="$imgpath/online.png" align="absmiddle" />在線';
	}
}
</script>
			</li>
<!--
EOT;
}print <<<EOT
-->
			<li>帖子: $winddb[postnum]</li>
			<li>今日: $winddb[todaypost]</li>
			<li>$db_rvrcname: $userrvrc $db_rvrcunit</li>
			<li>$db_moneyname: $winddb[money] $db_moneyunit</li>
			<li>$db_creditname: $winddb[credit] $db_creditunit</li>
			<li>最後登錄: <span class="f10">{$_LoginInfo['lastlodate']}</span></li>
			<li style="width:90%">登錄IP: <span class="f10">$onlineip</span></li>
		</ul>
		<div class="userbindingMenu"></div>
	</div>
</div>
<div id="menu_profile" class="pw_menu" style="display:none">
	<h6><a href="profile.php?action=modify" class="link_down"><span>設置</span></a></h6>
    <ul style="width:50px;" class="menuList">
        <li><a href="profile.php?action=modify" target="_blank">帳號</a></li>
<!--
EOT;
if ($db_authstate) {print <<<EOT
-->
		<li><a href="profile.php?action=auth" target="_blank">認證</a></li>
<!--
EOT;
}print <<<EOT
-->
        <li><a href="profile.php?action=privacy" target="_blank">隱私</a></li>
        <li><a href="userpay.php" target="_blank">積分</a></li>
        <li><a href="profile.php?action=permission" target="_blank">權限</a></li>
    </ul>
</div>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
if ($ifChannelEdit && !$ifactive) {
print <<<EOT
-->
	<div class="pw_diy" id="J_channelManage">
		<div id="pw_divTop"></div>
		<p><a href="index.php?m=area&alias={$alias}&adminview=1">模塊管理</a></p>
	</div>
<!--
EOT;
}
print <<<EOT
-->
<script type="text/javascript">var verifyhash = '$verifyhash', av_alias = '$alias', av_url = '$channelInfo[url]';</script>
<!--
EOT;
$hasNewMessage = $winddb['newpm'] || $winddb['newreferto'] || $winddb['newnotice'] || $winddb['newrequest'] || $winddb['newfans'];
$tmpMsgNum = 0;
($winddb['newpm']>0 && $_G['maxmsg']>=0) && $tmpMsgNum += $winddb['newpm'];
$winddb['newreferto']>0 && $tmpMsgNum += $winddb['newreferto'];
$winddb['newnotice']>0 && $tmpMsgNum += $winddb['newnotice'];
$winddb['newcomment']>0 && $tmpMsgNum += $winddb['newcomment'];
$winddb['newfans']>0 && $tmpMsgNum += $winddb['newfans'];
$tmpMsgNums = $tmpMsgNum > 0 ? '('.$tmpMsgNum.')' : '';
if($winduid && $hasNewMessage && (!GetCookie('clearm_'.$winduid) || GetCookie('clearm_'.$winduid) < $tmpMsgNum)){print <<<EOT
-->
<div id="pw_all_tip" style="display:none;" data-msg='[{"num":{$winddb['newpm']},"name":"站內信","url":"message.php?type=sms"},{"num":{$winddb['newreferto']},"name":"提到我","url":"apps.php?q=weibo&do=refer"},{"num":{$winddb['newnotice']},"name":"新通知","url":"message.php?type=notice"},{"num":{$winddb['newfans']},"name":"新關注","url":"u.php?a=friend&type=attentioned"},{"num":{$winddb['newrequest']},"name":"新請求","url":"message.php?type=request"}]'>
<table><tr><td>
<div class="pw_all_tip">
	<a href="javascript:void(0)" class="adel" id="pw_all_tclose" data-num="{$tmpMsgNum}">關閉</a>
<!--
EOT;
	if($winddb['newpm']){print <<<EOT
-->
	<p>{$winddb['newpm']}條新站內信，<a href="message.php?type=sms">查看站內信</a></p>
<!--
EOT;
}if($winddb['newreferto']){print <<<EOT
-->
	<p>{$winddb['newreferto']}條信息提到我，<a href="apps.php?q=weibo&do=refer">查看@我</a></p>
<!--
EOT;
}if($winddb['newnotice']){print <<<EOT
-->
	<p>{$winddb['newnotice']}個新通知，<a href="message.php?type=notice">查看新通知</a></p>
<!--
EOT;
}if($winddb['newfans']){print <<<EOT
-->
	<p>{$winddb['newfans']}個新關注，<a href="u.php?a=friend&type=attentioned">查看新關注</a></p>
<!--
EOT;
}if($winddb['newrequest']){print <<<EOT
-->
	<p>{$winddb['newrequest']}個新請求，<a href="message.php?type=request">查看新請求</a></p>
<!--
EOT;
}print <<<EOT
-->
</div></td></tr></table></div>
<!--
EOT;
}
print <<<EOT
-->
<!--
EOT;
?>-->