{template 'member','header'}
<script language="javascript">
<?php
sajax_show_javascript();
?>
function checkselect(){
 if ($("idfso").value == ""){
 $("subok").disabled=true;
 }else{
 $("subok").disabled=false;
 }
}

function changeone(){
 $("Gamelist").disabled=false;
 $("subok").disabled=true;
 $("change").innerHTML = "";
 $("fsos").innerHTML = "请先选择游戏分区";
}

function checkserv(thisid) {
  x_checkserv(thisid,checkserv_cb);
  function checkserv_cb(z) {
  if (z=="true"){
  $("message").style.display="block"
  $("message").innerHTML = "<span class=font06 style='color:green;font-weight:bold'>分区连接成功，请选择角色。</span>";
  $("Gamelist").disabled=true;
  $("subok").disabled=false;
  $("change").innerHTML = "<a href='javascript:void(0);' onclick='changeone()'>重新选择</a>";
  listfso();
  }else{
  $("message").style.display="block"
  $("message").innerHTML = z;
  }
}
}

function listfso(){
	var serverid = $("Gamelist").value;
	x_listfso(serverid,listfso_cb);

function listfso_cb(z) {
	$("fsos").innerHTML = z;
}
}

function doSub(){
	var idserver = $("Gamelist").value;
	var idfso = $("idfso").value;
	var fsoname = $("fso_"+idfso).value;
	var truename = $("truename").value;
	var telephone = $("telephone").value;
	var qq = $("qq").value;
	x_doSub(idserver,idfso,fsoname,truename,telephone,qq,doSub_cb);

function doSub_cb(z) {
  if(z=="true")
  {
	$("message").style.display= 'none';
    OpenDiv()
	doView();
	}
	else
	{
	$("message").style.display="block";
	$("message").innerHTML = z;
	}
}
}

function doView(){
	//var serverid = $("serverid").value;
	x_doView(doView_cb);

function doView_cb(z) {
	$("viewinfo").innerHTML = z;
}
}
//-->
</script>

<DIV class=main>
<DIV class=main>
{template 'member','left_member'}
<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"></div>
<TABLE class=regform cellSpacing=0 cellPadding=0 width="80%" align=center border=0>
  <TBODY>
  <TR>
    <TH style="font-weight:bold;font-size:14px">选择游戏分区：</TH>
    <TD colSpan=2>
<select id="Gamelist" onchange="checkserv(this.value)">
<option>-- 请选择大区 --</option>
<!--{loop $gamelists $k $games}-->
<option value="{$games[id]}">-- {$games[servername]} --</option>
<!--{/loop}-->
</select> <span id=change></span>
  <TR>
    <TH style="font-weight:bold;font-size:14px">选择领取角色： </TH>
    <TD colSpan=2 id=fsos style="color:#ccc;font-size:14px;font-weight:bold">请先选择游戏分区</TD></TR>
	 </TD></TR>
</TBODY></TABLE>
{if !$truename || !$telephone || !$qq}
<div class="tipsboxC"><span class="fontH">由于您是第一次光临，请填写以下信息，以便在出现问题时及时处理，请您认真填写！</span></div>
<TABLE class=regform cellSpacing=0 cellPadding=0 width="80%" align=center border=0>
  <TBODY>
  <TR>
    <TH style="font-weight:bold;font-size:14px">真实姓名： </TH>
    <TD colSpan=2><INPUT class=inputA type="text" name="checkaddress[truename]" id="truename" value="{$truename}"> </TD></TR>
  <TR>
    <TH style="font-weight:bold;font-size:14px">联系电话： </TH>
    <TD colSpan=2><INPUT class=inputA type="text" name="checkaddress[telephone]" id="telephone" value="{$telephone}"> </TD></TR>
  <TR>
    <TH style="font-weight:bold;font-size:14px">QQ号码： </TH>
    <TD colSpan=2><INPUT class=inputA type="text" name="checkaddress[qq]" id="qq" value="{$qq}"> </TD></TR>
	  </TBODY></TABLE>
{else}
<div><input type="hidden" id="truename" value="{$truename}"><input type="hidden" id="telephone" value="{$telephone}"><input type="hidden" id="qq" value="{$qq}"></div>
{/if}
<TABLE class=regform cellSpacing=0 cellPadding=0 width="80%" align=center border=0>
  <TBODY>
  <TR>
    <TH></TH>
    <TD colSpan=2>
      <input id="subok" type="submit" onClick="doSub()" class="hsbtn" value="确认">
	  </TD></TR>
	  </TBODY></TABLE>

	  </DIV></DIV>
	  </DIV></DIV></DIV>
<script type="text/javascript">
//function $(){return document.getElementById?document.getElementById(arguments[0]):eval(arguments[0]);}
var OverH,OverW,ChangeDesc,ChangeH=60,ChangeW=100;
var Nw=10,Nh=10;
function OpenDiv(_Dw,_Dh) {
	_Dw =350;
	_Dh = 420;
	window.scrollTo(0, 0);
	OverH=_Dh;OverW=_Dw;ChangeDesc='';
	$("Loading").style.display='block';
	$("Loading_Bg").style.display='';
	var _H = document.documentElement.scrollHeight;
	_H = _H<document.documentElement.clientHeight ? document.documentElement.clientHeight : _H;
	$("Loading_Bg").style.width = document.documentElement.clientWidth+"px";
	$("Loading_Bg").style.height = document.documentElement.clientHeight+"px";
	if(_Dw>_Dh){
		ChangeH=Math.ceil((_Dh-10)/((_Dw-10)/50));
	}else if(_Dw<_Dh){
		ChangeW=Math.ceil((_Dw-10)/((_Dh-10)/50));
	}
	OpenNow();
}
function OpenNow() {
	if (Nw>OverW-ChangeW)ChangeW=8;
	if (Nh>OverH-ChangeH)ChangeH=8;
	Nw=Nw+ChangeW;Nh=Nh+ChangeH;
	if(OverW>Nw||OverH>Nh) {
		if(OverW>Nw) {
			$("Loading").style.width=Nw+100+"px";
			var _L=(document.documentElement.clientWidth-Nw)/2-30;if(_L<0)_L=0;
			$("Loading").style.left=_L+"px";
		}
		if(OverH>Nh) {
			$("Loading").style.height=Nh+"px";
			var _T=(document.documentElement.clientHeight-Nh)/2+0;if(_T<0)_T=0;
			$("Loading").style.top=_T+"px"
		}
		//window.setTimeout("OpenNow()",10);
                OpenNow();
	}else{
		Nw=10;Nh=10;ChangeH=50;ChangeW=50;
		$('divload').style.display='block';
		$("Loading").style.background='transparent';
		$("Loading").style.border='0px';
		$("Loading").style.filter='alpha(opacity=100)';
		$("Loading").style.opacity='1';
		$("Loading_Bg").style.filter='alpha(opacity=50)';
	}
}
function CloseLoad() {
	if(Nw!=10) return;
	$("Loading").style.display='none';
	$("Loading_Bg").style.display='none';
}


//-->
</script>
<div id="Loading_Bg"></div>
<div id="Loading">
	<div id='divload'>
<DIV class=mw> 
<DIV class=mw_box>
<DIV class=columnG><A href="javascript:void(0)" onclick="CloseLoad()"><IMG 
src="{HS_PATH}img/member/mw_close.gif"></A>信息确认</DIV>
<DIV class=mw_mbox id="viewinfo">
</DIV></DIV></DIV>
	</div>
</div>
{template 'member','footer'}