<?php
if( !defined('ISDVBBS') ){
	header('HTTP/1.0 404 Not Found');
	exit;
}
_timeout(0);
?>
<!--<?php print <<<EOT
-->
<script language="JavaScript" type="text/javascript">
var __username_check=false;

function msgshow(str, which) {
	if(which == 'username') {
		if (str.indexOf('@@@') != -1){
			var arrStr = str.split('@@@');
			getObj('username_info').innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$lang['lang.str22']}";
			getObj('username_info').style.cssText = "color:#FF3300;";
			getObj('username_info').className = "regcheckno";
			__username_check=false;
		}else{
			getObj('username_info').innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$lang['lang.str21']}";
			getObj('username_info').style.cssText = "color:#339900;";
			getObj('username_info').className = "regcheckok";
			__username_check=true;
		}
	}
}

var arrName = ["username","password"];
var arrInfo = ["{$lang['login_msg_name']}","{$lang['login_msg_pass']}"];

function BlurCheck(divname){
	var sName = divname+"_info";
	if (!getObj(sName)) return
	with (getObj('theForm')) {
		var err = null;
		switch (divname) {
			case 'username':
				if(eval(divname+".value") == ''){
					getObj(sName).innerHTML = '{$lang['lang.str11']}';
					err = false;
				}else if(eval(divname+".value") != '' ){
					document.usernameform.username_c.value = eval(divname+".value");
					getObj(sName).innerHTML = '{$lang['lang.str10']}';
					document.usernameform.submit();		

				}
			break;
			case 'password':
				if(eval(divname+".value") == ''){
					getObj(sName).innerHTML = '{$lang['login_msg_pass']}';
					err = false;
				}
				else if(eval(divname+".value.length")  < 6 || eval(divname+".value.length") > 20) {
					getObj(sName).innerHTML = '{$lang['lang.str20']}';
					err = false;
				}else{
					 err = true;
				}
			break; 
		}
		if (err === false ) {
			getObj(sName).className = "regcheckOut";
		}else if (err === true ){
			getObj(sName).innerHTML = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
		}else if (err === null){
			getObj(sName).innerHTML = GetarrInfoText(divname);
			getObj(sName).className = "regcheckText";
		}
	}
	return err;
}
function formcheck() {
	var reCheck=true;

<!--
EOT;
echo ($fsetting['logingetcode']?'-->reCheck =validatecercode()<!--':'');
global $comeurl;
$comeurl=urlencode($comeurl);
print <<<EOT
-->
	for (var i = 0; i < arrName.length; i++) {	
		
		var re;
		if ( __username_check===false && arrName[i]=='username') re= BlurCheck(arrName[i]);
		else if (arrName[i]!='username') re= BlurCheck(arrName[i]);
		if (re === false || __username_check===false){
			reCheck = false;
		}
	}

	return reCheck;

}
</script>
<div class="mainbox">
<iframe id="checkframe" name="checkframe" width="0" height="0"></iframe>
<form name="usernameform" action="reg.php" method="post" target="checkframe">
<input type="hidden" name="username_c">
<input type="hidden" name="login_che" value="1">
<input type="hidden" name="action" value="usernamecheck">
</form>

<form name=theForm id=theForm action="login.php?action=chk&comeurl=$comeurl" method="post" style="margin:0;padding:0" onsubmit="return formcheck()">
<input type="hidden" name="username_check">

<div class="page_right" style="margin:0px 0px 0px 0px; width:270px; border:0px;">
	<div class="leftcolor" style=" background:#F4FCEE;"><br />
	<span class="font14 username">{$lang['tpl.str1']}</span>
	<span class="username"><br />{$lang['tpl.str2']}</span>
	<span><button onMousemove="button_move(this)" onMouseout="button_out(this)" onclick="javascript:self.location='reg.php'"> {$lang['tpl.str3']} </button></span><br /><br />
	</div>
</div>
<ul class="tableborder heightd page_left2">
  <h3 class="titlebig"> {$lang['logininputtitle']}</h3>
  <li><p class="font14">{$lang['inputname']}</p><input type="text" name="username" id="username"  tabindex="1"/>&nbsp;&nbsp;<span id="username_info"></span></li>
  <li>
	<p class="font14">{$lang['inputpass']}</p>
	<input type="password" name="password" id="password" tabindex=2 />&nbsp;&nbsp;<span id="password_info"></span>
  </li>
<!--
EOT;
	if ( $fsetting['logingetcode'] == 1 ){
		$getcodehtml=get_cercode(200,48,0,3);
print <<<EOT
-->
  <li style="height:60px; padding:10px auto; ">
	<p class="font14">{$lang['inputgetcode']}</p>{$getcodehtml}&nbsp;&nbsp;
  </li>
<!--
EOT;
	}
print <<<EOT
-->
  <li>
	<p class="font14">{$lang['inputdate']}</p>
	<select name="cookiedate" tabindex="4">
	  <option value="0">{$lang['cookiedate_1']}</option>
	  <option value="3600">{$lang['cookiedate_2']}</option>
	  <option value="86400" >{$lang['cookiedate_3']}</option>
	  <option value="2592000" selected>{$lang['cookiedate_4']}</option>
	  <option value="31536000">{$lang['cookiedate_5']}</option>
	</select>
  </li>
  <li>
	<p class="font14">{$lang['inputhidden']}</p>
	<input type="radio" class="checkbox" name="userhidden" value="2"  checked="checked" tabindex="5">{$lang['hidden_yes']}
	<input type="radio" class="checkbox" name="userhidden" value="1" tabindex="5">{$lang['hidden_no']}
  </li>
  <li>
	<p></p>
	<a href="lostpass.php" style="font-size:14px;">{$lang['forgetpass']}</a>
  </li>
  <li>
	<p></p>
	<button onMousemove="button_move(this)" onMouseout="button_out(this)"  type="submit" name="submit"  tabindex="6"> {$lang['tpl.htm.str']} </button>
  </li>
  <li></li>
</ul>
</div>
</form>
<SCRIPT LANGUAGE="JavaScript">
<!--
	initShowInfo();

//-->
</SCRIPT>
<!--
EOT;
?>-->
