﻿//vod js

function vodList(id) 
{
    $(".list020").attr("class", "list020_hide");
    $(".title_lit01").attr("class", "");
    $("#" + id+"_vod").attr("class", "list020");
    $("#" + id + "_nav").attr("class", "title_lit01");
    if (id == "favorite") {
        $("#sper_l").attr("class", "sper001");
        $("#sper_r").attr("class", "sper001_hide");
    }
    else if (id == "comment") {
        $("#sper_l").attr("class", "sper001_hide");
        $("#sper_r").attr("class", "sper001_hide");
    }
    else {
        $("#sper_l").attr("class", "sper001_hide");
        $("#sper_r").attr("class", "sper001");
    }
}


function replytext(c_index,uid,cid) {
    if (uid < 1) {
        alert("登录后才可以留言或回复,请先在顶部登录");
        return;
    }
    var line = $(".line_split");
    if ($("#reply_form").attr("id") != undefined) {
        $("#reply_form").remove();
    }
    var com_info = $(".com_content_info");
    for (var i = 0; i < line.length; i++) {
        if (i == c_index) {
            var replyform = "<form id='reply_form' action='' method='post'>"
                          + "<table cellpadding='0' cellspacing='0' style='width:390px; margin-top:5px'>"
                          + "<tr><td align='left' style='padding-left:2px'><input type='hidden' name='act' value='reply' /><input type='hidden' name='commenttext' value='" + com_info[i].innerText + "'/></td></tr>"
                          + "<tr><td align='left' style='padding-left:20px'><div><textarea name='reply_content' cols='35' rows='3' style='border:solid 1px #F5DFD3'></textarea></div></td></tr>"
                          + "<tr><td align='left' style='padding-left:20px; padding-top:5px'><input type='image' src='/images/vod/btn_submit.gif' />&nbsp;&nbsp;&nbsp;<input type='image' src='/images/vod/btn_cancel.gif' onclick='cancelreply()'/></td></tr>"
                          + "</table></form>";
            line[i].id = "line_end";
            $("#line_end").before(replyform);
            line[i].id = "";
        }
    }
}

function cancelreply() {
    if ($("#reply_form").attr("id") != undefined) {
        $("#reply_form").remove();
    }
    return false;
}