{template 'member','header'}
<script language="javascript">
<?php
sajax_show_javascript();
?>
function changeone(){
 document.getElementById("idserver").disabled=false;
 document.getElementById("change").innerHTML = "";
}
function checkserv(thisid) {
  x_checkserv(thisid,checkserv_cb);
  function checkserv_cb(z) {
  if (z=="true"){
  document.getElementById("message").style.display="block"
  document.getElementById("message").innerHTML = "<span class=font06 style='color:green'>分区连接成功</span>";
  document.getElementById("idserver").disabled=true;
  document.getElementById("change").innerHTML = "<a href='javascript:void(0);' onclick='changeone()'>重新选择</a>";
  }else{
  document.getElementById("message").style.display="block"
  document.getElementById("message").innerHTML = z;
  }
}
}

function doSub(){
	var c = document.getElementById("message");
	var id = document.getElementById("idserver").value;
	var opwd = document.getElementById("opwd").value;
	var npwd = document.getElementById("npwd").value;
	var rpwd = document.getElementById("rpwd").value;
	c.style.display="block";
	c.innerHTML = "<span class='font06'>正在修改,请稍后...</span>";
	x_doSub(id,opwd,npwd,rpwd,doSub_cb);

function doSub_cb(z) {
  if(z=="true")
  {
    c.innerHTML = "<span class='font06'>修改成功！</span>";
	alert("恭喜您,游戏密码修改成功，请以新密码登陆该分区！");
	window.location.href="<?=HS_PATH?>game/index.php";
	}
	else
	{
	document.getElementById("message").innerHTML = z;
	}
}
}
//-->
</script>

<DIV class=main>
<DIV class=main>
{template 'game','left'}
<DIV class="ad_rbarB boxC">
<DIV class=columnC><SPAN class="l_tit f_l">修改游戏密码</SPAN></DIV>
<DIV class=mainboxD>
<div class="tipsboxC" id="message" style="display: none"><span class="font06"></span></div>
<TABLE class=regform cellSpacing=0 cellPadding=0 width="80%" align=center 
border=0>
  <TBODY>
  <TR>
    <TH>游戏分区： </TH>
    <TD colSpan=2>
	<SELECT name="idserver" id="idserver" onchange="checkserv(this.value)">
	<OPTION value="">-- 请选择 --</OPTION>
	{loop $servers $value}
	<OPTION value="{$value[id]}">{$value[servername]}</OPTION>
	{/loop}
	</SELECT> <span id=change></span>
	</TD></TR>
  <TR>
    <TH>旧密码： </TH>
    <TD colSpan=2><INPUT class=inputA id=opwd type=password> </TD></TR>
  <TR>
    <TH>新密码： </TH>
    <TD colSpan=2><INPUT class=inputA id=npwd type=password> </TD></TR>
  <TR>
    <TH>确认新密码： </TH>
    <TD colSpan=2><INPUT class=inputA id=rpwd type=password> </TD></TR>
  <TR>
    <TH>&nbsp; </TH>
    <TD colSpan=2>
      <input type="submit" onClick="doSub()" class="hsbtn" value="修改">
	  </TD></TR>
	  </TBODY></TABLE>
	  <div class="tipsboxC"><span class="fontH" style="font-weight:bold">修改游戏密码需要输入原来的旧密码，如果忘记密码请点下面的《重置游戏密码》提交相应的资料信息！你如果想修改官网的密码请点击顶上的导航条《会员管理》进行修改！</span></div>
	  </DIV></DIV>
	  </DIV></DIV></DIV>
{template 'member','footer'}