<!--{assign var='menuid' value=''}-->
<!--{assign var='usercpmod' value='yes'}-->
<!--{include file="<!--{$tplpath}-->cp/<!--{$tplpre}-->block_head.tpl"}-->
<body>
<!--{include file="<!--{$tplpath}--><!--{$tplpre}-->block_menu.tpl"}-->

<div id="page-index" class="page">
  <div class="zx">

	<!--{include file="<!--{$tplpath}--><!--{$tplpre}-->block_search.tpl"}-->
	<!--{include file="<!--{$tplpath}-->cp/<!--{$tplpre}-->block_menu.tpl"}-->

    <div class="zright">
      <div class="topmenu"> 
	    <a href="<!--{$ucfile}-->?c=vip">购买服务</a>
		<a href="<!--{$ucfile}-->?c=payment">在线充值</a>
		<a href="<!--{$ucfile}-->?c=card" class='now'>充值卡充值</a>
		<a href="<!--{$ucfile}-->?c=buysms">购买短信</a>
	  </div>
      <div class="tb1 hy">

        <div class="htitle">
		  您当前所在会员组：<!--{$u.levelimg}--> <b><!--{$g.groupname}--></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--{if $g.groupid>1}-->（有效期到 <!--{$u.vipenddate_t}-->）<!--{/if}-->
			&nbsp;&nbsp;剩余可用<!--{$lang.money}-->：<b><font color='green'><!--{$u.money}--></font></b>
		</div>
		  
		  <!--{if $a eq 'run'}-->
		  <form name="pay_form" id="pay_form" action="<!--{$urlpath}-->usercp.php?c=card" method="post">
		  <input type='hidden' name='a' id='a' value='pay' />
		  <input type='hidden' name='type' id='type' value="1" />
		  <table cellpadding='5' cellspacing='5' border='0' class='tab'>
		    <tr>
			  <td class='hback_b' width='25%'>选择充值类型 <span class="f_red">*</span></td>
			  <td>
			  <select name='id' id='id' onchange="tab(this.options[this.options.selectedIndex].value);">
			  <option value='1' selected>为自己充值</option>
			  <option value='2'>为他人充值</option>
			  </select>
			  <span id="did" class="f_red"></span>
			  </td>
			</tr>
			<tr>
			  <td class='hback_b'>充值卡号 <span class="f_red">*</span></td>
			  <td class="hback">
			  <input type="text" name="cardnum" id="cardnum" class="input-txt" maxlength="50" /> <font color='#999999'>(请输入有效充值卡号)</font> <span id="dcardnum" class="f_red"></span>
			  </td>
            </tr>
			<!--{if $config.cardtype==2}-->
			<tr>
			  <td class='hback_b'>充值卡密码 <span class="f_red">*</span></td>
			  <td class="hback">
			  <input type="text" name="cardpwd" id="cardpwd" class="input-100" maxlength="20" /> <font color='#999999'>(请输入对应的卡密码)</font> <span id="dcardpwd" class="f_red"></span>
			  </td>
            </tr>
			<!--{/if}-->
			<tr id='tips_username' style="display:none;">
			  <td class='hback_b'>对方用户名 <span class="f_red">*</span></td>
			  <td class="hback">
			  <input type="text" name="username" id="username" class="input-100" maxlength="20" /> <font color='#999999'>(请输入对方用户名)</font> <span id="dusername" class="f_red"></span>
			  </td>
            </tr>
			<tr>
			  <td class='hback_none'></td>
			  <td class='hback_none'>
			  <a href="###" class="btn_b2 btn" onclick="return checkform();"><span>确认充值</span></a>	
			  </td>
			</tr>
		  </table>
		  </form>

		  <!--{/if}-->

      </div>
    </div>
    <div style="clear:both;"></div>
  </div>
  <div style="clear:both;"></div>
</div>
<!--{include file="<!--{$tplpath}--><!--{$tplpre}-->block_footer.tpl"}-->
</body>
</html>
<script language="javascript">

//显示隐藏
function tab(tabid) {
	if (tabid == 2) {
		$('#tips_username').show();
		$('#type').val('2');
	}
	else {
		$('#tips_username').hide();
		$('#type').val('1');
	}
}

//提交
function checkform() {
	var t = '';
	var v = '';

	t = 'cardnum';
	v = $('#'+t).val();
	if(v == '') {
		dmsg('请输入有效充值卡号', t);
		$('#'+t).focus();
		return false;
	}
    
	<!--{if $config.cardtype=='2'}-->
		t = 'cardpwd';
		v = $('#'+t).val();
		if(v == '') {
			dmsg('请输入充值卡密码', t);
			$('#'+t).focus();
			return false;
		}
	<!--{/if}-->

	if ($('#type').val() == '2') {
		t = 'username';
		v = $('#'+t).val();
		if(v == '') {
			dmsg('请输入对方用户名', t);
			$('#'+t).focus();
			return false;
		}
	}
	
	$('#pay_form').submit();
	return true;
}
</script>