// JavaScript Document

function dealKeyPress1()
{
    if(event.keyCode == 13)
    {
    }
}

function subFOForm()
{
    if (!checkIsInteger(document.qpointForm.PayAmount.value))
    {
        alert("对不起，充值点数必须为整数");
        document.qpointForm.PayAmount.focus();
        return false;
    }

    if (document.qpointForm.PayAmount.value>2000 || document.qpointForm.PayAmount.value<=0)
    {
        window.alert("对不起，充值金额的范围是1至2000");
        document.qpointForm.PayAmount.focus();
        return false;
    }
    document.qpointForm.callback.value = "http://payportal.qq.com/cgi-bin/qpoint_entry_vnet.cgi"
        + "?ProvinceId=" + document.qpointForm.ProvinceId.value
        + "&PayAmount=" + document.qpointForm.PayAmount.value;
        //+ "&ProvideQQuin=88881272&ReProvideQQuin=88881272";
    return true;
}

function checkIsInteger(str)
{
    if(str == "")
        return false;
    if(/^(\-?)(\d+)$/g.test(str))
        return true;
    else
        return false;
}

function subQBForm()
{
    if (!checkIsInteger(document.orderForm.PayItem.value))
    {
        window.alert("对不起，充值金额必须为整数");
        return false;
    }

    if ("11" == document.orderForm.PayItem.value)
    {
        if (document.orderForm.PayItem.value>100
            || document.orderForm.PayItem.value<=0)
        {
            window.alert("对不起，充值金额的范围是1至100");
            return false;
        }
    }

    if (document.orderForm.PayItem.value>200
        || document.orderForm.PayItem.value<=0)
    {
        window.alert("对不起，充值金额的范围是1至200");
        return false;
    }

    var id = document.orderForm.PayChannelSubId.value;
    if (id == 2 || id == 11 || id == 12 || id == 14 || id == 18 || id == 19 || id == 20 || id == 23 || id == 35|| id == 1402)
    {
        document.orderForm.callback.value = "http://pay.qq.com/cgi-bin/pay_login.cgi";
        document.orderForm.PayChannel.value = "vnet";
    }
    else
    {
        document.orderForm.callback.value = "http://pay.qq.com/cgi-bin/cnc_save.cgi";
        document.orderForm.PayChannel.value = "cnc";
    }

    // alert(document.orderForm.callback.value);
    document.orderForm.callback.value += "?PayChannel=" + document.orderForm.PayChannel.value
        + "&PayChannelSubId=" + document.orderForm.PayChannelSubId.value
        + "&PayItem=" + document.orderForm.PayItem.value
        + "&entryURL=" + document.orderForm.entryURL.value;
        //+ "&QQuin=88881272&ReQQuin=88881272";

    return true;
}

//----------------输入框中回车键处理函数
function dealKeyPress()
{
    if(event.keyCode == 13)
    {
    }
}