﻿$().ready(function() {
    
})
function radClick() {
    var actid = $("#Log :radio:checked").val();
    if (actid == 1) {
        $("#UserL").attr("style", "display:block");
        $("#ModL").attr("style", "display:none");
    } else if (actid == 2) {
        $("#ModL").attr("style", "display:block");
        $("#UserL").attr("style", "display:none");
    }
}

function AddPoll() {
    var cid = $("#hcid").val();
    $.ajax({
        type: "POST",
        url: "../ajax/addPoll.ashx",
        data: "cid=" + cid,
        success: function(result) {
            if (result == 0) {
                location.href = "c_" + cid + "";
                return true;
            } else if (result == 1) {
                alert("投票失败，请重新投票！");
            }
            else if (result == 2) {
                alert("您今天已经对此作品投票过，不能再投票！请明日再投！");
            }
            else if (result == 3) {
                alert("您还未登录，请登录后再投票！");
                location.href = "/";
            }
        }
    });
}

function MobCity() {
    $("#MPic").attr("style", "display:none");
    $("#Mob").attr("style", "display:block");
}

function SendMobile() {
    var mob = $("#txtMob").val();
    var cod = $("#ValidateCode").val();
    $.ajax({
        type: "POST",
        url: "../ajax/SendMobile.ashx",
        data: "mob=" + mob + "&code=" + cod,
        success: function(result) {
            if (result == 0) {
                alert("发送成功！");
                $("#Mob").attr("style", "display:none");
                $("#MPic").attr("style", "display:block");
            } else if (result == 1) {
                alert("发送失败！");
            }
            else if (result == 2) {
                reloadcode();
                alert("验证码错误，请重新输入！");
            }
        }
    });
}


