﻿function checklogin(i){
    returnString="";
    var PostInfo="FunctionName=checklogin";
    AJpost(PostInfo);
    if(returnString=='111')
    {
    alert('请先登陆');
    }else{
    window.open('trade.aspx?product='+i);
    }
}
function checkcoin(productid){
if(document.getElementById('Checkbox1').checked){
    returnString="";
    var PostInfo="FunctionName=checkcoin&productid="+productid+"&n="+document.getElementById('txtcount').value;
    AJpost(PostInfo);
    if(returnString=="succeed")
    {
        if(confirm("1积分币可支付1元,如果使用积分币支付,不足1元的部分将按1元计算。确认使用积分币支付吗?"))
        {
        document.getElementById("Hidden1").value='yes';
        }else{
        document.getElementById("CheckBox1").checked=false;
        document.getElementById("Hidden1").value="";
        }
    }
    if(returnString=="failing")
    {
        alert("您的积分币不足,无法使用积分币支付");
        document.getElementById("CheckBox1").checked=false;
    }
    if(returnString=="111")
    {
        alert("登陆超时,请重新登陆");
        setTimeout('closewindows()',1000);
    }}
}
function closewindows(){window.close();}
