function fc()
{
    if(!js_user_login)
    {need_login('fc()');
     return false;
    }
    if(trim(document.dpbbstheardForm.title.value).length<1) {
        alert("请填写标题");
        return false;
    }
    if(trim(document.dpbbstheardForm.title.value).length>100) {
        alert("标题长了点，100个字以内");
        return false;
    }
    if(trim(document.getElementById('context').value).length<1) {
        alert("内容少了点，描述的详细点，不然别人看不懂了:),至少1个字吧");
        return false;
    }
    document.dpbbstheardForm.keywords.value=getkeywords(trim(document.dpbbstheardForm.title.value)+trim(document.getElementById('context').value));
    $('subset').disabled=true;
    setTimeout("$('subset').disabled=false;",10000);
    var ShowDiv="<div class='ddmsg' id='ddmsg'>正在提交数据...</div>";
    DialogPopUpLoading(ShowDiv,180);
    document.dpbbstheardForm.submit();
}

function fcc()
{
 //if(!js_user_login){
 // need_login('fcc()');
 //return false;}
    if(trim(document.getElementById('context').value).length<1) {
        alert("内容少了点,至少也得留下1个字吧");
        return false;
    }
    $('subset').disabled=true;
    setTimeout("$('subset').disabled=false;",10000);
    document.dpbbstheardForm.submit();
}
function NoteQuote(id)
{
    var content=document.getElementById("context"+id).innerHTML;
    var authorName=document.getElementById("author"+id).innerHTML;
    var objTime=document.getElementById("time"+id).innerHTML;
    var strQuote;
  /*  if(content.indexOf('以下是引用')<0){
    content=content.replace(/<\s?img[^>]*>/gi,'');
    if(content.length>150)
    content=content.substring(0,150)+"...";
    }*/
    strQuote="<div style=\"border:#ccc double 1px;width:90%;padding:10px;font-size:13px;color:#555;\"><font style='font-weight:bold'>以下是引用&nbsp;"+authorName+"&nbsp;于"+objTime+"的发言:</font><br />"+content+"</div>";
   //tinyMCE.getInstanceById('context').getBody().innerHTML=strQuote;
   document.getElementById('Editor').focus();
   window.frames["Editor"].window.frames["HtmlEditor"].document.getElementsByTagName("BODY")[0].innerHTML=strQuote;
  // $('context').focus();
}
function hiddiv(data) {
    if(xmlHttp.readyState==4) {
        if(xmlHttp.status==200) {
        if(xmlHttp.responseText==1)
            $("hf"+data[0]).removeNode(true);
           $('ddmsg').innerHTML='操作完成！';setTimeout('DialogHide()',3000);
        }
        else{
        $('ddmsg').innerHTML='操作失败！';setTimeout('DialogHide()',3000);
        }
    }
}
function del(id) {
      var ShowDiv="<div class='ddmsg' id='ddmsg'>正在提交数据...</div>";
    DialogPopUpLoading(ShowDiv,180);
    asynSubmit("theard.do","method=del&id="+id,"post",hiddiv,[id]);
}
function istop(id)
{
      var ShowDiv="<div class='ddmsg' id='ddmsg'>正在提交数据...</div>";
    DialogPopUpLoading(ShowDiv,180);
    asynSubmit("theard.do","method=istop&id="+id,"post",searchresult);
}
function deltop(id)
{
    var ShowDiv="<div class='ddmsg' id='ddmsg'>正在提交数据...</div>";
    DialogPopUpLoading(ShowDiv,180);
    asynSubmit("theard.do","method=deltop&id="+id,"post",searchresult);
}

function fccc()
{
    if(trim(document.dpbbstheardForm.title.value).length<1) {
        alert("请填写标题");
        return false;
    }
    if(trim(document.dpbbstheardForm.title.value).length>100) {
        alert("标题长了点，100个字以内");
        return false;
    }
    if(trim(document.getElementById('context').value).length<1) {
        alert("内容少了点，描述的详细点，不然别人看不懂了:),至少1个字吧");
        return false;
    }
    document.dpbbstheardForm.keywords.value=getkeywords(trim(document.dpbbstheardForm.title.value)+trim(document.getElementById('context').value));
    $('subset').disabled=true;
    setTimeout("$('subset').disabled=false;",10000);
     var ShowDiv="<div class='ddmsg' id='ddmsg'>正在提交数据...</div>";
    DialogPopUpLoading(ShowDiv,180);
  document.dpbbstheardForm.submit();
}

function ShowImage(fileElm,img)
    { 
    img.innerHTML='';
var fileext=fileElm.value.substring(fileElm.value.lastIndexOf("."),fileElm.value.length);   
    fileext=fileext.toLowerCase();   
if ((fileext!='.jpg')&&(fileext!='.gif')&&(fileext!='.jpeg')&&(fileext!='.bmp'))   
       {   
        alert("对不起，系统仅支持标准格式的照片，请您调整格式后重新上传，谢谢 !"); 
        $('upfile0').innerHTML="<input onchange=\"javascript:ShowImage(this,$('prev_img'))\" name=\"file\" id=\"files\" type=\"file\" class=\"file\"  style=\'width:300px;\'/>";
        
        }
   else {
 
            var imgdiv = document.createElement("div");
            document.body.appendChild(imgdiv);
            imgdiv.style.width="100px";
            imgdiv.style.height = "100px";
//判断是否是IE
var isIE=window.attachEvent? true:false;
            if(isIE){
            imgdiv.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod = scale)";   
            imgdiv.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = fileElm.value;
        }
        else
imgdiv.innerHTML='<img width=100 height=100 src="'+fileElm.value+'"/>';
            
            img.appendChild(imgdiv); 
        }
    }
    
function upload() {
    if($('files').value.length<1) {
        alert("请选择上传图片!");
        return;
    }
    hideElement("savePopupContent");
    showElement('sb_saving');
    fileForm.submit();
}