<style type="text/css">
<!--
.redword_err { position:relative; color:#FF6600; background-color:#FFFFFF; }
#form_err { position:absolute; top:-2px; left:0; width:260px; padding-left:10px; }
#show_err { position:absolute; top:5px; left:4px; z-index:80; }
.g1 { margin:0px 4px; height:1px; font-size:1px; background-color:#000000; overflow:hidden; }
.g2 { margin:0px 2px; height:1px; font-size:1px; background-color:#FFFFE1; border-left:2px #000000 solid; border-right:2px #000000 solid; overflow:hidden; }
.g3 { margin:0px 1px; height:2px; font-size:1px; background-color:#FFFFE1; border-left:1px #000000 solid; border-right:1px #000000 solid; overflow:hidden; }
.g4 { padding:0px 10px; background-color:#FFFFE1; border-left:1px #000000 solid; border-right:1px #000000 solid; }
.g4 { font-size:12px; color:#333300; text-align:left; }
.username { background-image:url(inc/images/login_bj.gif); background-position:5px 50%; background-repeat:no-repeat; }


-->
</style>
<script language="JavaScript" type="text/javascript">
<!--
function postChk(form){
  var un=form.username;
  if(!un.value.match(/^.{3,45}$/)){
    $('username_err').innerHTML=showErr('请正确填写帐号！可填用户名或注册邮箱');
    //un.focus();
    return false;
  }else{
    $('username_err').innerHTML='√';
  }
  var pn=form.password;
  if(pn.value.length>30 || pn.value.length<3){
    $('password_err').innerHTML=showErr('密码长度是3-30字符！');
	//pn.focus();
    return false;
  } else {
    $('password_err').innerHTML='√';
  }
  //addSubmitSafe();
  return true;
}

function postChk2(form){
  var un=form.username;
  if(un.value=='' || !un.value.match(/^.{3,45}$/)){
    $('username_err2').innerHTML=showErr('请正确填写用户名');
    //un.focus();
    return false;
  }else{
    $('username_err2').innerHTML='√';
  }
  var ml=form.email;
  if(ml.value=='' || !ml.value.match(/^[\w\.\-]+@[\w\-]+\.[\w\.]+$/)){
    $('email_err2').innerHTML=showErr('email必填！填：xxx@xxx.xxx(.xx) 格式');
	//$('email').focus();
    return false;
  } else {
    $('email_err2').innerHTML='√';
  }
  return true;
}

function showErr(text){
  return '\
<img src="inc/images/show_err.gif" name="show_err" width="7" height="13" id="show_err" />\
<div id="form_err">\
  <div class="g1"></div>\
  <div class="g2"></div>\
  <div class="g3"></div>\
  <div class="g4">'+text+'</div>\
  <div class="g3"></div>\
  <div class="g2"></div>\
  <div class="g1"></div>\
</div>';
}

function showL(v1, v2){
  try{
    $('list_title_'+v1).className='list_title_in';
    $('list_title_'+v2).className='';
  }catch(e){}
  try{
    $('loginform_'+v1).style.display='block';
    $('loginform_'+v2).style.display='none';
  }catch(e){}
}

-->
</script>
<div class="column"><img src="<?php echo $bar_face; ?>" /> <?php echo $bar_name; ?>，欢迎来自 <img src="inc/images/<?php echo $session[6]; ?>.png" /><?php echo (string)$session[6]=='162100'?$session[7]:''; ?> 的登录。您需要进行以下操作：</div>
<div class="list_title"><a class="list_title_in" id="list_title_tie" href="#" onClick="showL('tie', 'new');">绑定已有帐号</a> <a id="list_title_new" href="#new" onClick="showL('new', 'tie');">新建一个帐号</a></div>
<ul class="manager_menu">
<form action="member.php?post=login" method="post" onsubmit="return postChk(this);" id="loginform_tie" target="_self">
  <table width="100%" border="0" cellspacing="5" cellpadding="0">
    <tr>
      <td width="200" align="right">帐号：</td>
      <td align="left"><input name="username" id="username" type="text" onpropertychange="chkWord(this)" oninput="chkWord(this);" onblur="if(this.value.replace(/^\s+|\s+$/g,'')==''){this.className='large username';}" onfocus="this.className='large';" style="width:181px;" class="large username" maxlength="255" />
          <span class="redword_err" id="username_err"></span></td>
    </tr>
    <tr>
      <td width="200" align="right">密码：</td>
      <td align="left"><input name="password" id="password" type="password" onblur="postChk(this.form);" style="width:181px" class="large" maxlength="30" />
          <span class="redword_err" id="password_err"></span></td>
    </tr>
    <tr>
      <td width="200" align="right">&nbsp;</td>
      <td align="left"><button name="submit" type="submit" class="large" style="border:none;"><b>绑定</b></button></td>
    </tr>
  </table>
  <input name="act" type="hidden" value="tie" />
  <input name="location" id="location" type="hidden" value="<?php

$log = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : './';
echo !preg_match('/login_current\.php/i', $log) ? $log : './';
?>" />
  <input name="bar" type="hidden" value="<?php echo $bar; ?>" />
  <input name="key" type="hidden" value="<?php echo $key1.$key2; ?>" />
</form>
<form action="member.php?post=login" method="post" onsubmit="return postChk2(this);" id="loginform_new" style="display:none;" target="_self">
  <table width="100%" border="0" cellspacing="5" cellpadding="0">
    <tr>
      <td width="200" align="right">用户名：</td>
      <td align="left"><input name="username" type="text" onblur="postChk2(this.form);" style="width:181px;" class="large" maxlength="255" value="<?php echo $bar_name; ?>" />
          <span class="redword_err" id="username_err2"></span></td>
    </tr>
    <tr>
      <td width="200" align="right">邮箱：</td>
      <td align="left"><input name="email" type="text" onblur="postChk2(this.form);" style="width:181px" class="large" maxlength="200" />
          <span class="redword_err" id="email_err2"></span></td>
    </tr>
    <tr>
      <td width="200" align="right">&nbsp;</td>
      <td align="left"><button name="submit" type="submit" class="large" style="border:none;"><b>创建新用户</b></button></td>
    </tr>
  </table>
  <input name="act" type="hidden" value="new" />
  <input name="location" id="location" type="hidden" value="<?php

$log = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : './';
echo !preg_match('/login_current\.php/i', $log) ? $log : './';
?>" />
  <input name="bar" type="hidden" value="<?php echo $bar; ?>" />
  <input name="key" type="hidden" value="<?php echo $key1.$key2; ?>" />
  <input name="bar_name" type="hidden" value="<?php echo $bar_name; ?>" />
  <input name="bar_face" type="hidden" value="<?php echo $bar_face; ?>" />
</form>
</ul>


<script language="JavaScript" type="text/javascript">
<!--

if (location.href.match(/\#new$/i)){

  showL('new', 'tie');

}
-->
</script>
