function jsPreSMSContent(){

};
jsPreSMSContent.PageStatus=null;

$(function(){
    App.SetNullHref(0);
    $("#htxtSMSContent").ikeEditor({ width: $(document.documentElement).width()-90, height: 180, HiddentToolBar: true, ValueMode: 'Text' });
    $("#htxtSMSContent").focus();
    App.SetNullHref(1);
    setTimeout("jsPreSMSContent.LoadPageInfo()",100);

});

/*加载页面数据*/
jsPreSMSContent.LoadPageInfo=function(){
    
     jsPreSMSContent.PageStatus=App.query("pageStatus");
     if(jsPreSMSContent.PageStatus=="edit"){
        $("#hideID").val(App.query("curID"));
        var strContent=unescape(jsCommonLogic.selColumnData("SMSTXT","T_SMSPHRASE","WHERE ID="+App.query("curID")));
        $("#htxtSMSContent").value(strContent);
        strContent=null;
    }
    
    CollectGarbage();
};

/*保存*/
jsPreSMSContent.SaveInfo=function(){
    var result=-1;    
    var strContent=$("#htxtSMSContent").value();
    if(strContent!=""){
        var entity = jsEntity.CreateEntityByTableName_access("T_SMSPHRASE");
        entity.Fields.USERID=1;
        entity.Fields.SMSTXT=escape(strContent);    
        if(jsPreSMSContent.PageStatus=="edit"){
            entity.Fields.ID=$("#hideID").val();
            result=entity.Update(entity);
        }
        else{       
            result=entity.Insert(entity);
        }            
        if(result){
            ShowWindow.opener.execScript(App.query("formIdx"),App.query("action"));
            alert("保存成功！");
            ShowWindow.close();
        }
        else{
            alert("保存没有成功！");
        }
        DBReader.DisposeEntity(entity);
    }else{
        alert("内容不能为空！");
    }
    strContent=null;     
    CollectGarbage();
};

/*关闭*/
jsPreSMSContent.CloseWindow=function(){
    ShowWindow.close();
}