window.pfClientWidgetIcons = function (core) {
    this.self = this;
    this.core = core;

    /* large icons */

    this.iconLargeUnrotate = function (cont, photo, cb) {
        return this.createDivIcon(
            cont
          , 'поворот против часовой'
          , 'large_unrotate'
          , cb
        );
    }

    this.iconLargeRotate = function (cont, photo, cb) {
        return this.createDivIcon(
            cont
          , 'поворот по часовой'
          , 'large_rotate'
          , cb
        );
    }

    this.iconLargeFull = function (cont, photo) {
        return this.createDivIcon(
            cont
          , 'полный размер'
          , 'large_fullsize'
        );
    }
    this.iconLargeDelete = function (cont, photo, cb) {
        return this.createDivIcon(
            cont
          , 'удалить фото'
          , 'large_delete'
          , cb
        );
    }
    this.iconLargeNext = function (cont) {
        var main = this.core.main;

        var href        = this.core.create('a', cont);
        href.title      = 'следующее фото';
        href.href       = '#next';
        href.onclick    = function () {main.widget.widgetPhotos.showNextLargePhoto()};
        this.core.write(href, 'следующее >>');

        return href;

        return this.createDivIcon(
            cont
          , 'следующее фото'
          , 'large_next'
          , function () {main.widget.widgetPhotos.showNextLargePhoto()}
        );
    }

    this.iconLargePrev = function (cont) {
        var main = this.core.main;

        var href        = this.core.create('a', cont);
        href.title      = 'предыдущее фото';
        href.href       = '#prev';
        href.onclick    = function () {main.widget.widgetPhotos.showPrevLargePhoto()};
        this.core.write(href, '<< предыдущее');

        return href;

        return this.createDivIcon(
            cont
          , 'предыдущее фото'
          , 'large_previous'
          , function () {main.widget.widgetPhotos.showPrevLargePhoto()}
        );
    }


    this.iconLargeCard = function (cont, photo) {
        return this.createDivIcon(
            cont
          , 'отправить как открытку'
          , 'large_card'
        );
    }

    this.iconLargeTakeLink = function (cont, photo, onclick) {
        return this.createDivIcon(
            cont
          , 'получить ссылку'
          , 'large_takelink'
          , onclick
        );
    }

    this.iconLargeSendLink = function (cont, photo) {
        return this.createDivIcon(
            cont
          , 'отправить ссылку'
          , 'large_sendlink'
        );
    }

    /* small icons */

    this.iconEdit = function (cont, photo, onclick) {
        return this.createDivIcon(
            cont
          , 'Переименовать'
          , 'std_icon_small icon_edit'
          , onclick
        );
    }

    this.iconDelete = function (cont, photo, onclick) {
        return this.createDivIcon(
            cont
          , 'Удалить'
          , 'std_icon_small icon_del'
          , onclick
        );
    }

    this.iconLeft10 = function (cont, photo, onclick) {
        return this.createDivIcon(
            cont
          , 'На 10 позиций к началу'
          , 'std_icon_small icon_left10'
          , onclick
        );
    }

    this.iconLeft = function (cont, photo, onclick) {
        return this.createDivIcon(
            cont
          , 'На 1 позицию к началу'
          , 'std_icon_small icon_left'
          , onclick
        );
    }

    this.iconRight10 = function (cont, photo, onclick) {
        return this.createDivIcon(
            cont
          , 'На 10 позиций к концу'
          , 'std_icon_small icon_right10'
          , onclick
        );
    }

    this.iconRight = function (cont, photo, onclick) {
        return this.createDivIcon(
            cont
          , 'На 1 позицию к концу'
          , 'std_icon_small icon_right'
          , onclick
        );
    }

    this.createDivIcon = function (cont, title, className, onclick) {
        if (onclick == undefined || onclick == null) {
            onclick = function () { alert("В разработке"); }; 
        }

        var icon        = this.core.create('div', cont, 'divicon '+className);
        icon.onclick    = onclick;
        icon.title      = title;
        return icon;
    }
}
