$(function () {
    function GetBuyMoney () {
        regexp = /^[0-9]+$/;
        if (!regexp.test($("#BuyTime").val())) {
            alert("续费时长必须为数字");
            return false;
        }
        var BuyType = $("#BuyType").val();
        var UpdateMoney = 0;
        if (BuyType == 1) {//月付
            $("#PayMoney").html($("#u_MonPrice").html() * $("#BuyTime").val());
        } else if (BuyType == 2) {//季付
            $("#PayMoney").html($("#u_ThPrice").html() * $("#BuyTime").val());
        } else if (BuyType == 3) {//半年付
            $("#PayMoney").html($("#u_HfPrice").html() * $("#BuyTime").val());
        } else if (BuyType == 4) {//年付
            $("#PayMoney").html($("#u_YearPrice").html() * $("#BuyTime").val());
        }
    }
    GetBuyMoney();
    $("#BuyTime").keyup(function(){GetBuyMoney();});
    $("#BuyType").change(function () { GetBuyMoney(); });
    
});