<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<title>{$seo['title']}</title>
<meta name="Keywords" content="{$seo['keywords']}">
<meta name="Description" content="{$seo['description']}">
<link href="templates/{$CFG[tplname]}/style/user.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/validator/validator.min.js"></script>
<link href="js/validator/validator.css" type="text/css" rel="stylesheet" />
</head>
<body>
<!--{template header}-->
<div class="wrapper">
	<!-- 主体 -->
    <!--{template member_left}-->
    <div class="col_main">
<form action="member.php?act=credit_money" method="post" name=form>
	 <!--{template member_topmenu}-->
		<div class="post_li">
          <ul>
            <li><h3>积分数</h3><strong class="f14 fe43">{$userinfo['credit']}</strong></li>
            <li><h3>帐户余额</h3><strong class="f14 fe43">￥{$userinfo['money']}</strong></li>
            <li><h3>兑现比例</h3>1积分兑换{$CFG['usercreditnum']}元</strong></li>
            <li><h3>兑现数量</h3><input id="amount" name="amount" type="text" size="10" class="inputs" value="{$amount}" onKeyUp="changeValue()" /></li>
            <li><h3>可兑现金额</h3><strong class="f14 fe43" id="amounts">0</strong></li>
		    <li><div class="clearfix h_10"></div><h3>&nbsp;</h3><input type="submit" name="submit" class="btn_1" value="兑现" id="submit" /></li>
          </ul>
        </div>　
	
	</form>
  
    <!--{template member_right}-->
    </div>
	<!-- 主体 结束 -->
    </div>
	<!--{template footer}-->
<script>
         var input1pre;
         function changeValue() {
             var val1 = document.getElementById('amount').value;
			 var val2 = document.getElementById('amounts').innerText;
             if(typeof input1pre != 'undefined') {
                 val2 = val2.substring(0, val2.lastIndexOf(input1pre));
             }
				document.getElementById('amounts').innerText = '￥'+(val1*{$CFG['usercreditnum']}).toFixed(2); 
		 }
</script>
<script type="text/javascript">
$.validator("amount")
.setFocusMsg("请填写要兑现的积分数")
.setRequired("请填写要兑现的积分数")
.setRegexp(/^\d+(?=\d+$|$)/, "积分格式错误", false)
.setServerCharset("UTF-8")
.setStrlenType("symbol");
</script>
</body>
</html>
