﻿function News_Favorite(bnid,lsusername)
{//收藏文章,收藏者名称和文章编号
    if(!Blog_Public.check_loginajax().value)
    {
        if(confirm("您尚未登录,只有登录后才能使用该功能,点击[确定]进行登录,点击[取消]返回首页！"))
        {
            location.href="http://user.cnfund.cn";
        }
    }
    else
    {
        if(bnid=="0")
        {
            alert("请选择要收藏的文章,否则无法收藏文章!");
            return;
        }
        var lv_re=Blog_Public.News_Stow(bnid,lsusername).value;
        if(lv_re==0)
        {
            alert("文章收藏失败,请返回重试!");
            return;
        }
        else if(lv_re==-1)
        {
            alert("您已经收藏了该文章不能重复收藏!");
            return;
        }
        else
        {
            alert("文章收藏成功!");
            document.getElementById("Favoriteid").innerHTML=lv_re;
        }
    }
}
function News_Favorites(bnid,lsusername)
{//收藏文章,收藏者名称和文章编号
    if(!Blog_Public.check_loginajax().value)
    {
        if(confirm("您尚未登录,只有登录后才能使用该功能,点击[确定]进行登录,点击[取消]返回首页！"))
        {
            location.href="http://user.cnfund.cn";
        }
    }
    else
    {
        if(bnid=="0")
        {
            alert("请选择要收藏的文章,否则无法收藏文章!");
            return;
        }
        var lv_re=Blog_Public.News_Stow(bnid,lsusername).value;
        if(lv_re==0)
        {
            alert("文章收藏失败,请返回重试!");
            return;
        }
        else if(lv_re==-1)
        {
            alert("您已经收藏了该文章不能重复收藏!");
            return;
        }
        else
        {
            alert("文章收藏成功!");
            document.getElementById("Favoriteid"+bnid).innerHTML=lv_re;
        }
    }
}
function addcomment(bnid)
{//添加评论
    var lv_text=document.getElementById("ctl00_ContentPlaceHolder1_T_Text").value;
    var lv_nzm=document.getElementById("ctl00_ContentPlaceHolder1_T_NZM").value;
    if(lv_text=="")
    {
        alert("请输入评论内容！");
        return;
    }
    if(lv_nzm=="")
    {
        alert("请输入验证码！");
        return;
    }
    var lv_re=Blog_Public.AddComment(bnid,lv_text,lv_nzm).value;
    alert(lv_re);
    window.location.reload();
}
function delNewsComment(bnid)
{//删除新闻评论
    var lv_re=Blog_Public.DelNewsComment(bnid).value;
    alert(lv_re);
    window.location.reload();
}

function News_AegisCounts(bnid)
{//更新支持数
    if(!Blog_Public.check_loginajax().value)
    {
        if(confirm("您尚未登录,只有登录后才能使用该功能,点击[确定]进行登录,点击[取消]返回首页！"))
        {
            location.href="http://user.cnfund.cn";
        }
    }
    else
    {
        if(bnid=="0")
        {
            alert("请选择要支持的文章,否则无法支持该文章!");
            return;
        }
        var lv_re=Blog_Public.News_AegisCount(bnid).value;
        if(lv_re==0)
        {
            alert("文章支持失败,请返回重试!");
            return;
        }
        else
        {
            alert("文章支持成功!");
            document.getElementById("AegisCountid").innerHTML=lv_re;
        }
    }
}

function News_ArgueCounts(bnid)
{//更新反对数
    if(!Blog_Public.check_loginajax().value)
    {
        if(confirm("您尚未登录,只有登录后才能使用该功能,点击[确定]进行登录,点击[取消]返回首页！"))
        {
            location.href="http://user.cnfund.cn";
        }
    }
    else
    {
        if(bnid=="0")
        {
            alert("请选择要反对的文章,否则无法反对该文章!");
            return;
        }
        var lv_re=Blog_Public.News_ArgueCount(bnid).value;
        if(lv_re==0)
        {
            alert("文章反对失败,请返回重试!");
            return;
        }
        else
        {
            alert("文章反对成功!");
            document.getElementById("ArgueCountid").innerHTML=lv_re;
        }
    }
}
function News_AegisCountss(bnid)
{//更新支持数
    if(!Blog_Public.check_loginajax().value)
    {
        if(confirm("您尚未登录,只有登录后才能使用该功能,点击[确定]进行登录,点击[取消]返回首页！"))
        {
            location.href="http://user.cnfund.cn";
        }
    }
    else
    {
        if(bnid=="0")
        {
            alert("请选择要支持的文章,否则无法支持该文章!");
            return;
        }
        var lv_re=Blog_Public.News_AegisCount(bnid).value;
        if(lv_re==0)
        {
            alert("文章支持失败,请返回重试!");
            return;
        }
        else
        {
            alert("文章支持成功!");
            document.getElementById("AegisCountid"+bnid).innerHTML=lv_re;
        }
    }
}

function News_ArgueCountss(bnid)
{//更新反对数
    if(!Blog_Public.check_loginajax().value)
    {
        if(confirm("您尚未登录,只有登录后才能使用该功能,点击[确定]进行登录,点击[取消]返回首页！"))
        {
            location.href="http://user.cnfund.cn";
        }
    }
    else
    {
        if(bnid=="0")
        {
            alert("请选择要反对的文章,否则无法反对该文章!");
            return;
        }
        var lv_re=Blog_Public.News_ArgueCount(bnid).value;
        if(lv_re==0)
        {
            alert("文章反对失败,请返回重试!");
            return;
        }
        else
        {
            alert("文章反对成功!");
            document.getElementById("ArgueCountid"+bnid).innerHTML=lv_re;
        }
    }
}