<?php defined('IN_HS') or exit('Access Denied'); ?>
<?php include template('member','header'); ?>

<script language="javascript">
<?php
sajax_show_javascript();
?>
function changeone(){
 document.getElementById("Gamelist").disabled=false;
 //document.getElementById("subok").disabled=true;
 document.getElementById("change").innerHTML = "";
 document.getElementById("fsos").innerHTML = "请先选择游戏分区";
 document.getElementById("fsoinfo").style.display="none";
}

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;font-weight:bold'>分区连接成功，请选择角色。</span>";
  document.getElementById("Gamelist").disabled=true;
  document.getElementById("change").innerHTML = "<a href='javascript:void(0);' onclick='changeone()'>重新选择</a>";
  listfso();
  }else{
  document.getElementById("message").style.display="block"
  document.getElementById("message").innerHTML = z;
  }
}
}

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

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

function doView(){
var idserver = document.getElementById("Gamelist").value;
var value = document.getElementById("idfso").value;
x_doView(idserver,value,doView_cb);

function doView_cb(z) {
document.getElementById("fsoinfo").innerHTML = z;
document.getElementById("fsoinfo").style.display="block";
}
}

function doSub(){
var idserver = document.getElementById("Gamelist").value;
var idfso = document.getElementById("idfso").value;
var tonum = document.getElementById("tonum").value;
var tocheck = document.getElementById("tocheck").value;
OpenDiv();
x_doSub(idserver,idfso,tonum,tocheck,doSub_cb);

function doSub_cb(z) {
document.getElementById("lotteryover").innerHTML = z;
}
}

function waiting()
{
 document.getElementById("param").style.display="none";
 document.getElementById("fsoinfo").style.display="none";
 document.getElementById("message").style.display="none";
 document.getElementById("part_one").style.display="block";
 window.setTimeout("OpenDiv()",3000);
}
//-->
</script>

<DIV class=main>
<DIV class=main>

<?php include 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"><span class="fontH" style="font-weight:bold">在线时间可以兑换： <span style="font-weight:bold;color:#f00">经验值、声望，</span> 当前兑换条件和比例如下：<br>
1、换取经验值最低等级：<em style="font-weight:bold;color:#f00"><?php echo $MOD['explevel'];?></em>  级。每60分钟可换取经验值<em style="font-weight:bold;color:#f00"><?php if($MOD[timeexp] < '100000000') { ?><em style="font-weight:bold;color:#f00"><?= $MOD[timeexp]/10000 ?></em> 万<?php } else { ?><em style="font-weight:bold;color:#f00"><?= $MOD[timeexp]/100000000 ?></em> 亿<?php } ?></em> 点。<br>
2、换取声望最低等级：<em style="font-weight:bold;color:#f00"><?php echo $MOD['creditlevel'];?></em>  级。每60分钟可换取声望<em style="font-weight:bold;color:#f00"><?php echo $MOD['timecredit'];?></em> 点。<br>
3、为防止功能被恶意利用，请保证该帐号下所有角色退出 <em style="font-weight:bold;color:#f00">3分钟</em> 后进行操作！<br>

</span></div>
<div class="tipsboxC" id="message" style="display:none"></div>
<div id="part_one" align=center style="display:none;width:100%;margin-top:80px;color:#555;font-size:14px;font-weight:bold;"><img src="/admin/skin/images/ajax_loader.gif"></div>
<TABLE class=regform cellSpacing=0 cellPadding=0 width="80%" align=center border=0 id="param">
  <TBODY>
  <TR>
    <TH style="font-weight:bold;font-size:14px">游戏分区：</TH>
    <TD colSpan=2>
<select id="Gamelist" onchange="checkserv(this.value)">
<option>-- 请选择大区 --</option>

<?php if(is_array($gamelists)) foreach($gamelists AS $k => $games) { ?>
<option value="<?php echo $games['id'];?>">-- <?php echo $games['servername'];?> --</option>

<?php } ?>

</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>

<div id="fsoinfo" style="display:none">

</div>


  </DIV></DIV>
  </DIV></DIV></DIV>
<script type="text/javascript">
//function $(){return document.getElementById?document.getElementById(arguments[0]):eval(arguments[0]);}
$("part_one").style.display="none";
var OverH,OverW,ChangeDesc,ChangeH=60,ChangeW=100;
var Nw=10,Nh=10;
function OpenDiv(_Dw,_Dh) {
_Dw =350;
_Dh = 310;
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="doView();CloseLoad();"><IMG 
src="<?php echo HS_PATH;?>img/member/mw_close.gif"></A></DIV>
<DIV class=mw_mbox>
<H4 style="color:blue;">执行结果：</H4>
<div id="lotteryover">

</div>
</DIV></DIV></DIV>
</div>
</div>


<?php include template('member','footer'); ?>
