var PT = PT || {};

PT.entity = {};

PT.entity.clone = function (event, options) {
    SDNA.loading(options.target);
    Window.pop (
        options.url,
        {
            width : 600,
            close : function () {
                SDNA.loaded(options.target);
            }
        }
    );
};

PT.entity.clone.click = function (event) {
    event.preventDefault();
    SDNA.Event.trigger(
        'clone_entity',
        {
            url : $j(this).attr('href'),
            target : this
        }
    );
};

PT.entity.bind = function () {
    $j('a.clone').live('click.clone', PT.entity.clone.click);
};

SDNA.Event.create('clone_entity', PT.entity.clone);