/* ----------------------------------------------------------------------------
 * Easy!Appointments - Open Source Web Scheduler
 *
 * @package     EasyAppointments
 * @author      A.Tselegidis <alextselegidis@gmail.com>
 * @copyright   Copyright (c) 2013 - 2018, Alex Tselegidis
 * @license     http://opensource.org/licenses/GPL-3.0 - GPLv3
 * @link        http://easyappointments.org
 * @since       v1.0.0
 * ---------------------------------------------------------------------------- */

window.BackendCompany = window.BackendCompany || {};

/**
 * Backend Services
 *
 * This namespace handles the js functionality of the backend services page.
 *
 * @module BackendServices
 */
(function (exports) {

    'use strict';

    /**
     * Contains the basic record methods for the page.
     *
     * @type {companyhelper}
     */
    var helper;

    var companyhelper = new CompanyHelper();

    /**
     * Default initialize method of the page.
     *
     * @param {Boolean} bindEventHandlers Optional (true), determines whether to bind the  default event handlers.
     */
    exports.initialize = function (bindEventHandlers) {
        bindEventHandlers = bindEventHandlers || true;
        //console.log(GlobalVariables.globalservice);

        // Fill available service categories listbox.
        // Instantiate helper object (service helper by default).
        helper = companyhelper;
        helper.resetForm();
        helper.filter('');

        if (bindEventHandlers) {
            _bindEventHandlers();
        }
    };

    /**
     * Binds the default event handlers of the backend services page.
     *
     * Do not use this method if you include the "BackendServices" namespace on another page.
     */
    function _bindEventHandlers() {
        /**
         * Event: Page Tab Button "Click"
         *
         * Changes the displayed tab.
         */

        companyhelper.bindEventHandlers();
    }


})(window.BackendCompany);
