﻿/**
 * Namespace the application
 * @namespace SB
 */
if (!SBAN) var SBAN = {};
else if (SBAN && typeof (SBAN) != "object") throw new Error("SBAN is not an Object type");

/**
 * Constructs Main objects
 * @class Main - is a Singleton
 * @constructor
 * @namespace SB
 */

SBAN.Main = (function ($) {

    // PRIVATE ATTRIBUTES. ONLY PRIVELEGED METHODS MAY VIEW/EDIT/INVOKE
    var _that = {};

    // PRIVATE MEMBERS. ONLY PRIVELEGED METHODS MAY VIEW/EDIT/INVOKE.

    //RETURN OBJECT LITERAL.
    return {
        // PUBLIC ATTRIBUTES ANYONE MAY READ/WRITE.
        NAME: "Application initialize module",
        VERSION: 1.0,

        // PUBLIC MEMBERS ANYONE MAY READ/WRITE. (MAY BE OVERRIDEN).
        // PUBLIC METHOD THAT INITIALIZES MAIN APP.
        init: function () {
            // this.disableCache();
            this.initFacebookSide();

            this.initVideoAlone(); // INIT MODULE VIDEO STANDALONE
            this.initRemoveSliderSideBar();

        },

        initFacebookSide: function () {
            SBAN.sbangolaFacebookPosts('superbockangola');
        },

        // MODULE VIDEO PLAYER STANDALONE
        initVideoAlone: function () {
            if (!$('.modVideoAlone').length) return false;

            $('.modVideoAlone').each(function () {
                var el = $(this);
                SB.UI.modVideoAlone(el);
            });

        },

        initRemoveSliderSideBar: function () {

            if ($('#containerSidebar').hasClass('removeSliderSideBar')) {
                contentImages = $('#wowslider-images').clone();
                $('#wowslider-container').remove();
                $('.contentImagesSideBar').append(contentImages);
                $('.contentImagesSideBar').children().attr('id', 'noslider-images')
                $('#noslider-images').find('a img').css({'display': 'block', 'margin-bottom':'20px'});
                $('#noslider-images').find('a img').attr('id', '');
            }
        }








    };
} (jQuery));                                                                                                     // THE PARENS HERE CAUSE THE ANONYMOUS FUNCTION TO EXECUTE AND RETURN.

// ON DOM READY INIT APPLICATION.
jQuery(document).ready(function () {

    //THE APP MAIN MODULE CODE HAS ALREADY EXECUTED, SO WE CAN ACCESS THE INIT METHOD IMMEDIATELY.
    SBAN.Main.init();

    //    if ($('.facebookConnectSuperAngola').has('display', 'block')) {
    //        console.log('tem ul');
    //        $("#scrollbar1 .viewport").css('height', 0);
    //    }
    //    else {
    //        console.log('nao tem conteudo');
    //        $("#scrollbar1 .viewport").css('height', '303px');
    //    }
});

