﻿// JScript 文件
//  为了兼容ff,将原来取得span的innserText改为innerHTML oct 5th, 2007
////切换编辑
function switcheidtor(se_id)
{
    var sp_edit_panel=document.getElementById ("sp_edit_"+se_id);   
    var sp_title=document.getElementById ("sp_"+se_id);
    if (sp_edit_panel==null)
        return;
    if (sp_title==null)
        return;     
    if (sp_edit_panel.style.display=="none")
    {
        sp_edit_panel.style.display="block";    
        //alert(sp_title.innerHTML);
        //setinputwords(se_id,sp_title.innerText); 
        setinputwords(se_id,sp_title.innerHTML.replace('\n','').replace('\r','')); 
        sp_title.style.display="none";       
    }
    else
    {
        sp_edit_panel.style.display="none";
        sp_title.style.display="block";
    }
}
/////保存后更新原来的内容
function updatewords(se_id,words)
{
    var sp_title=document.getElementById ("sp_"+se_id);
    if (sp_title==null)
        return;
    //sp_title.innerText=words;
    sp_title.innerHTML=words;
}
/////取得文本框中的内容
function getinputwords(se_id)
{
    var words_input=document.getElementById ("input_"+se_id);
    //alert(words_input);
    if (words_input==null)
        return "";
    else
        return words_input.value;
}
////设置文本框中内容
function setinputwords(se_id,words)
{
    var words_input=document.getElementById ("input_"+se_id);
    if (words_input==null)
        return;
    words_input.value=words;
}
/////显示保存更新信息
function operating(se_id,operatingmessage)
{
    var sp_title=document.getElementById ("sp_"+se_id);
    //alert(sp_title);
    if (sp_title==null)
        return;    
    else
    {
        //sp_title.innerText=operatingmessage;
        sp_title.innerHTML=operatingmessage;
    }
}