﻿// JScript 文件

function vote(obj)
{
    if(GetCookie(obj.alt) != null)
    {
    
        alert("请不要重复投票！");
        return;
    }

    $.ajax({
        type: "GET",
        url: "ajax.aspx",
        data: "do=voteArtical&aid=" + obj.alt,
        dataType: "text",
        success: function(html){
            showSelect(html, obj.alt);
        },
        error: function(html){
            alert("服务器没有响应，请刷新页面重试！");
        }
    });

}

function showSelect(responseHtml, articalID)
{
    $("#ctl00_ContentPlaceHolder1_VoteCountLabel").html(responseHtml);
    
    SetCookie(articalID,"1");
}



function voteVedio(obj)
{
    if(GetCookie(obj.alt) != null)
    {
    
        alert("请不要重复投票！");
        return;
    }

    $.ajax({
        type: "GET",
        url: "ajax.aspx",
        data: "do=voteVedio&vid=" + obj.alt,
        dataType: "text",
        success: function(html){
            voteVedioSuccess(html, obj.alt);
        },
        error: function(html){
            alert("服务器没有响应，请刷新页面重试！");
        }
    });
}


function voteVedioSuccess(responseHtml, vedioID)
{
    $("#ctl00_ContentPlaceHolder1_lblVoteCount").html(responseHtml);
    
    SetCookie(vedioID,"1");
}