function ShowReply(_id)
{
    $(".ReplyInputBox").hide();  
    var code="<div style=\"padding:0 0 15px 15px;\"><div><textarea id=\"bbs_pl_re_content"+_id+"\" class=\"inp4\" style=\"height:100px;width:600px;line-height: 20px; padding-left: 6px; overflow-y: scroll;color:#666;background:url(/skin/public/InpBg.gif) no-repeat 0 0;border-color:#999;\"></textarea></div><div style=\"padding-top:8px;\"><input type=\"button\" value=\"回复Ta\" class=\"but3\" onclick=\"DoReply('"+_id+"');\" /></div></div>";
    $("#ReplyInputBox"+_id).html(code);
    $("#ReplyInputBox"+_id).show(500);    
}
function DoReply(_id)
{    
    function SubFun(result)
    {
        if(result=="success"){alert("回复成功！");window.location=location.href;}
        else if(result=="empty")alert("请输入回复的内容！");
        else if(result=="nologin")alert("请先登录！");
    }
   
    var _value=$("#bbs_pl_re_content"+_id).val();
    $.post("/bbs/theme.aspx?act=ajax&type=reply", {id:_id,value:_value},function(XMLHttpRequest){                                     
        SubFun(XMLHttpRequest);  
    }, "html");
}
function DoQuote(_obj,_id)
{
    var html=$(_obj).parent().parent().parent().html().toLowerCase();
    var _floor=html.substring(html.indexOf("楼")-10);
    _floor=_floor.substring(0,_floor.indexOf("楼"));
    _floor=_floor.replace("\'","").replace("\"","");
    _floor=_floor.substring(_floor.indexOf("=")+1);
    
    function SubFun(result)
    {
        if(result=="")return;
        
        var str="<div style=\"padding:8px 8px 3px 0;\"><div style=\"border:solid 1px #ffdda7;background:#fff3e1 url(/bbs/skin/quote_bg.gif) no-repeat right 15px;padding:3px 7px 6px 3px;\"><div style=\"font-weight:bold;padding-left:7px;\"><a href=\"#"+_floor+"\" style=\"font-size:12px;text-decoration:none;\" title=\"点击跳转到该楼\">引用"+_floor+"楼的回复：</a></div><div style=\"font-size:14px;line-height:2;color:#999;padding:2px 0 0 7px;\">"+result+"</div></div></div><p></p>";
        
        if(result.indexOf("引用")!=-1&&result.indexOf("楼的回复：")!=-1)
        {
        str=str.replace("padding-right:8px;padding-left:0px;padding-bottom:3px;padding-top:8px;","padding:4px 5px 2px 2px;").replace("#fff3e1 no-repeat right","#fff no-repeat right").replace("padding:8px 8px 3px 0;","padding:4px 5px 2px 2px;");
        }
        editor1.focus();
        editor1.resize('925px', '500px'); 
        editor1.html(str);                
        $("html,body").animate({scrollTop:$("#pl").offset().top}, 500);        
    }
    
    $.post("/bbs/theme.aspx?act=ajax&type=quote", {id:_id},function(XMLHttpRequest){                                     
         SubFun(XMLHttpRequest);  
    }, "html");                                   
}
//
function InitReplyQuote()
{
    $(".ReplyQuote").each(function(){
        if($(this).parent().html().toLowerCase().indexOf("<span>提示：</span>该回帖已被锁定！")==-1)
        {
            $(this).css({"display":"block"}); 
        }       
    });
}
function InitReplyPanelBox()
{
    $(".ReplyPanelBox").each(function(){
             
        $.post("/bbs/theme.aspx?act=ajax&type=getreply", {id:this.id.replace("ReplyPanelBox","")},function(XMLHttpRequest){                                     
            if(XMLHttpRequest!="")
            {               
                var _id=XMLHttpRequest.substring(0,XMLHttpRequest.indexOf(","));
                $("#ReplyPanelBox"+_id).html(XMLHttpRequest.substring(XMLHttpRequest.indexOf(",")+1)); 
                $("#ReplyPanelBox"+_id).show();
            }  
        }, "html");
        
    });
}
$(function(){
    InitReplyQuote();
    InitReplyPanelBox();
    $.getScript('/bbs/skin/PageTop_960.js',function(){    });
});