<!--<?php
if (empty($winduid)) {print <<<EOT
-->
<!--
EOT;
if($groupid=='guest'){
$arr_logintypename = array('用户名','UID','电子邮箱');
$loginJumpUrl = "http://{$pwServer['HTTP_HOST']}{$REQUEST_URI}";
if (basename($REQUEST_URI,".php") == 'login') {
	$loginJumpUrl = "{$db_bbsurl}/index.php";
}
print <<<EOT
-->
<form action="login.php" name="login_FORM" method="post" onsubmit="return checkLogin();">
<input type="hidden" name="jumpurl" value="$loginJumpUrl" />
<input type="hidden" name="step" value="2" />
<dl class="login fr mr5">
	<dd class="tal mb10">
		<div class="fl input mr5" style="width:128px;padding:2px 0 2px 3px;"><input class="fl gray" onfocus="navCheckinput(this);" onblur="navCheckinput(this);" style="width:111px;border:0;padding:0;line-height:16px;height:16px;" name="pwuser" id="nav_pwuser" value="输入用户名" tabindex="1" />
<!--
EOT;
if (count($_LoginInfo['logintype']) >1) {print <<<EOT
-->
			<a href="javascript:;" title="切换登录方式" class="select_arrow fl" onclick="showLoginType();">下拉</a>
			<div class="fl">
			<div class="pw_menu" id="login_type_list" style="position:absolute;display:none;margin:18px 0 0 -80px;">
				<ul class="menuList tal" style="width:76px;">
<!--
EOT;
foreach($_LoginInfo['logintype'] as $v){print <<<EOT
-->
					<li><a href="javascript:;" onclick="selectLoginType('$v','$arr_logintypename[$v]')">$arr_logintypename[$v]</a></li>
<!--
EOT;
}print <<<EOT
-->
				</ul>
			</div>
			</div>
<!--
EOT;
}print <<<EOT
-->
		</div>
		<label style="width:65px;" class="fl s6"><input name="cktime" type="checkbox" title="记住登陆状态" value="31536000"/>记住</label>
		<a href="sendpwd.php" class="s6" tabindex="9">找回密码</a>
	</dd>
	<dd class="tal">
<!--
EOT;
if($db_ifsafecv || ($db_gdcheck & 2) || $_LoginInfo['qcheck']){print <<<EOT
-->
	<div class="fl">
	<div id="nav_logintab" class="popout" style="position:absolute;z-index:2;margin:21px 0 0 -154px;display:none;"><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:260px;padding:10px 5px;">
				<table width="100%" style="table-layout:fixed;">
<!--
EOT;
if($db_gdcheck & 2){
$gdSize = explode("\t",$db_gdsize);
print <<<EOT
-->
					<tr>
						<td width="70">认证码</td>
						<td>
							<input class="input mr10" type="text" id="inputgdcode" name="gdcode" size="7" tabindex="3" onfocus="showgd('header_ckcode');" /><span class="cp" onclick="this.previousSibling.focus();">点此显示验证码</span>
							<div id="header_ckcode" style="display:none;">
<script type="text/javascript" language="JavaScript" src="js/pw_authcode.js"></script>
<script>
var flashWidth = "$gdSize[0]";
var flashHeight = "$gdSize[1]";
var gdtype = $db_gdtype;
showGdCode();
</script>
							</div>
						</td>
					</tr>
<!--
EOT;
}if($db_ifsafecv){print <<<EOT
-->
					<tr>
						<td width="70">安全问题</td>
						<td><p class="mb5"><select name="question" onchange="showcustomquest_h(this.value)" tabindex="4" style="width:156px;">
							<option value="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">自定义问题</option></select></p>
							<input id="othercustomquest" style="display:none" name="customquest" class="input input_wa" size="17" />
							</td>
						</tr>
						<tr>
							<td>您的答案</td>
							<td><input name="answer" class="input input_wa" tabindex="5" /></td>
						</tr>
<!--
EOT;
}if($_LoginInfo['qcheck'] && $db_question){
if($db_imagequestion){
	$question = "<img src='ckquestion.php?q=".$_LoginInfo['qkey']."&t=".$timestamp."'>";
}else{
	$question = $_LoginInfo['qkey']<0 ? getMachineQuestion_1() :  $db_question[$_LoginInfo['qkey']];
}
$q_a = $question.($_LoginInfo['showq'] && $_LoginInfo['qkey']>0?" <br />答案:".$db_answer[$_LoginInfo['qkey']] : '');
print <<<EOT
-->
						<tr>
							<td width="70">验证问答</td>
							<td>{$q_a}<br />
								<p><input class="input input_wa" name="qanswer" tabindex="6" /></p>
								<input type="hidden" name="qkey" value="{$_LoginInfo['qkey']}" /></td>
						</tr>
<!--
EOT;
}print <<<EOT
-->
				</table>
		</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
-->
		<input class="input mr5 fl" style="width:128px;padding:2px 0 2px 3px;" type="password" name="pwpwd" onfocus="if(IsElement('nav_logintab')) getObj('nav_logintab').style.display='';this.value='';if(getObj('header_ckcode') && getObj('header_ckcode').style.display=='none') getObj('inputgdcode').value='';var o_nav_logintab = IsElement('nav_logintab') ? getObj('nav_logintab') : ''; PW_popEvent(o_nav_logintab);" id="showpwd" tabindex="2" />
		<span class="fl" style="width:63px;"><span class="bt2"><span><button name="head_login" type="submit" style="width:60px;" tabindex="7">登录</button></span></span></span><span class="btn2"><span><button type="button" onClick="location.href='$regurl#breadCrumb';" style="width:60px;" tabindex="8">注册</button></span></span>
<!--
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
-->
	</dd>
</dl>
</form>
<script language="JavaScript">
var default_login_type = '$value';
var default_input_value = '输入' + '$arr_logintypename[$value]';

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_h(qid){
	getObj('othercustomquest').style.display = qid==-1 ? '' : 'none';
}

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 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';
}

changeDefaultInputValue(default_input_value);
//login redirect
function checkLogin(){
	var username = getObj('nav_pwuser').value;
	if((!username || username.indexOf('输入')===0) && !getObj('showpwd').value){
		document.location.href="login.php";
		return false;
	}
	return true;
}
</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"><i><img src="$_LoginInfo[faceurl]" alt="$windid" /></i></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">|</span><script language="JavaScript">
var td_userinfomore = {
	pz : 21,
	open : function() {
		$('td_userinfomore').className = 'current';
		if (typeof userBinding == 'object') {
			userBinding.append();
		}
	},
	close : function () {
		$('td_userinfomore').className = '';
	}
}
</script><span id="td_message" class="pd5 link_down"><!--
EOT;
$tmpMsgNum = 0;
($winddb['newpm']>0 && $_G['maxmsg']>=0) && $tmpMsgNum += $winddb['newpm'];
$winddb['newreferto']>0 && $tmpMsgNum += $winddb['newreferto'];
$winddb['newcomment']>0 && $tmpMsgNum += $winddb['newcomment'];
$winddb['newfans']>0 && $tmpMsgNum += $winddb['newfans'];
$tmpMsgCue = ($tmpMsgNum>0) ? "<span class=\"s2\">($tmpMsgNum)</span>" : '';
print <<<EOT
--><a href="message.php">消息{$tmpMsgCue}</a><!--
EOT;
if ($winddb['newreferto']>0 || $winddb['newfans']>0 || $winddb['newcomment']) {
$db_menuinit .= ",'td_message' : 'menu_message'";
print <<<EOT
--><script language="JavaScript">var td_message = {pz : 21}</script><!--
EOT;
}print <<<EOT
--></span><span id="td_profile" class="pd5"><a href="profile.php?action=modify" target="_blank" class="link_down"><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="s2 mr20">$winddb[money] $db_moneyunit</a>{$db_rvrcname}：<a href="userpay.php" class="s2 mr20">$userrvrc $db_rvrcunit</a>身份：<a href="profile.php?action=permission
" class="s2">{$gp_grouptitle}</a></p>
                        </dd>
                    </dl>
<!--
EOT;
}print <<<EOT
-->

<!--
EOT;
if (getstatus($winddb['userstatus'],12)) {print <<<EOT
-->
<base id="headbase" href="$db_bbsurl/" />
<script language="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" alt="隐身" />隐身<!--
EOT;
} else {print <<<EOT
--><img src="$imgpath/online.png" align="absmiddle" alt="在线" />在线<!--
EOT;
}print <<<EOT
--></span>
<script language="JavaScript">
function changeState() {
	var msg = ajax.request.responseText;
	if (msg == 1){
		getObj('online_state').innerHTML = '<img src="$imgpath/stealth.png" align="absmiddle" alt="隐身" />隐身';
	}else{
		getObj('online_state').innerHTML = '<img src="$imgpath/online.png" align="absmiddle" alt="在线" />在线';
	}
}
</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;
if ($winddb['newreferto']>0 || $winddb['newfans']>0 || $winddb['newcomment']) {print <<<EOT
-->
<div id="menu_message" class="pw_menu" style="display:none;">
	<h6 style="left:-1px;right:auto;"><a href="message.php" class="link_down" >消息{$tmpMsgCue}</a></h6>
	<ul class="menuList tal">
<!--
EOT;
if ($winddb['newpm']>0 && $_G['maxmsg']) {print <<<EOT
-->
		<li><a href="message.php">新消息：<span class="s2">$winddb[newpm]</span></a></li>
<!--
EOT;
}if ($winddb['newfans']>0) {print <<<EOT
-->
		<li><a href="u.php?a=friend&type=attentioned">新关注：<span class="s2">$winddb[newfans]</span></a></li>
<!--
EOT;
}if ($winddb['newreferto']>0 || $winddb['newcomment']>0) {
$tmpNum = $winddb['newreferto'] + $winddb['newcomment'];
$tmpAction = ($winddb['newcomment'] > $winddb['newreferto']) ? 'receive' : 'refer';
print <<<EOT
-->
		<li><a href="apps.php?q=weibo&do=$tmpAction">提到我：<span class="s2">$tmpNum</span></a></li>
<!--
EOT;
}print <<<EOT
-->
	</ul>
</div>
<!--
EOT;
}}?>