///<reference path="dialog.js" />
///<reference path="jquery-1.3.2-vsdoc.js" />




var FCKWRAPPER = function() {
    //### private section ###\
    var FCKInstanceId = null;
    var FCKInstance = null;

    function CheckInstance() {
        if (FCKInstance == null || FCKInstance == undefined) {
            throw "fckeditor not found!";
        }
    }
    function SetInstance() {

        FCKInstance = window.parent.FCKeditorAPI.GetInstance(FCKInstanceId);
        CheckInstance();
    }
    return {
        //### public section ###

        SetInstanceId: function(id) {
            FCKInstanceId = id;
        },
        GetContent: function() {
            SetInstance();
            return FCKInstance.GetHTML();
        },
        IsDirty: function()
        {
            SetInstance();
            return FCKInstance.IsDirty();
        },
        ResetIsDirty: function()
        {
            SetInstance();
            return FCKInstance.ResetIsDirty();
        },
        InsertHtml: function(html) {

            SetInstance();
            FCKInstance.InsertHtml(html);
        },
        InsertLink: function(text, href, target) {

            SetInstance();
            FCKInstance.Commands.LoadedCommands.CMSLink.InsertLink(text, href, target);
        }

    };
} ();