define('package/quiqqer/tour/load', [
    'Ajax',
    'package/quiqqer/tour/bin/Tours',
    'utils/Panels',
    'qui/QUI',
    'Locale',
    'css!' + URL_OPT_DIR + 'quiqqer/tour/bin/load.css'
], function (Ajax, Panel, Utils, QUI, QUILocale) {
    "use strict";

    new Element('div', {
        'class': 'tour-modal-bg'
    }).inject(document.body);


    return function () {
        if (document.getElement('[data-name="tourHelper"]')) {
            return;
        }
        var TourManager = new Element('div', {
            'class': 'TourManager',
            html   : '<span class="fa fa-question-circle-o" data-name ="tourHelper" aria-hidden="true" title="'+QUILocale.get('quiqqer/tour', 'help.button.title')+'"></span>' +
            '<div class="closeTour"><span class="fa fa-close" aria-hidden="true"></span></div>',
            events : {
                click: function () {
                    Utils.openPanelInTasks(new Panel());
                }
            }
        });

        TourManager.inject(document.body);

        TourManager.getElement('.closeTour').addEvent('click', function () {
            TourManager.destroy();

            QUI.Storage.set('ShowTourQuestionMark', 0);
        });
    };
});

