var varSite='http://vip.v.ifeng.com';
// 获取投票数
function getVideoCount(){
    var param = 'site=itv&docId='+ph.VideoInfo.videoID+'&docName='+encodeURIComponent(ph.VideoInfo.title)+'&docUrl='+encodeURIComponent(varSite + '/play.aspx?id='+ph.VideoInfo.videoID);
    var ajax = new net.ContentLoader('/interface/_getvideocount_.aspx','GET',param,onGetVideoCountCallback,onGetVideoCountError,null);
    ajax.loadXMLDoc();
}

function onGetVideoCountCallback(){
    var result = this.req.responseText;
    document.getElementById('spanVideoCount').innerHTML=result;
}

function onGetVideoCountError(){
    document.getElementById('spanVideoCount').innerHTML='0';
}

//投票
function addVideoCount()
{    
    var param = 'site=itv&docId='+ph.VideoInfo.videoID+'&docName='+encodeURIComponent(ph.VideoInfo.title)+'&docUrl='+encodeURIComponent(varSite+'/play.aspx?id='+ph.VideoInfo.videoID);
    var ajax = new net.ContentLoader('/interface/_addvideocount_.aspx','GET',param,onAddVideoCountCallback,onAddVideoCountError,null);
    ajax.loadXMLDoc();
    document.getElementById('aAddVideoCount').innerHTML ='<a href="http://vip.v.ifeng.com/top.aspx" target="_blank"  class="Awhite">查看</a>';
}
function onAddVideoCountCallback()
{
       var result = this.req.responseText;
       switch(result)
       {
        case "0":
            var varTemp = document.getElementById('spanVideoCount').innerHTML;
            document.getElementById('spanVideoCount').innerHTML = Number(varTemp)+1;
            document.getElementById('aAddVideoCount').innerHTML ='<a href="http://vip.v.ifeng.com/top.aspx" target="_blank"  class="Awhite">查看</a>';
            break;
        case "1":
            alert('服务器忙,请稍后重试');
            break;
        case "2":
            alert('参数错误');
            break;
        case "3":
            alert('未知错误');
            break;
        default:
            break;
       }
}
function onAddVideoCountError()
{
    alert('服务器忙,请稍后重试');
    return ;
}






