
(function(){

    // shorthand
    var SB = Shadowbox;
    var SL = SB.lib;

    /**
     * Constructor. This class is used to display inline HTML.
     *
     * @param   {String}    id      The id to use for this content
     * @param   {Object}    obj     The content object
     * @public
     */
    Shadowbox.html = function(id, obj){
        this.id = id;
        this.obj = obj;

        // height defaults to 300
        this.height = this.obj.height ? parseInt(this.obj.height, 10) : 300;

        // width defaults to 500
        this.width = this.obj.width ? parseInt(this.obj.width, 10) : 500;
    };

    Shadowbox.html.prototype = {

        /**
         * Returns an object containing the markup for this content, suitable
         * to pass to Shadowbox.lib.createHTML().
         *
         * @param   {Object}    dims    The current Shadowbox dimensions
         * @return  {Object}            The markup for this content item
         * @public
         */
        markup: function(dims){
            return {
                tag:    'div',
                id:     this.id,
                cls:    'html', // give special class to enable scrolling
                html:   this.obj.content
            };
        },

        /**
         * Removes this content from the document.
         *
         * @return  void
         * @public
         */
        remove: function(){
            var el = SL.get(this.id);
            if(el) SL.remove(el);
        }

    };

})();

