﻿var Website = {
    run: function () {
        resizeSite();
        initTopBar();

        /**/
        $('.input-field').each(function () {
            addInputBehaviour($(this));
        });

        /**/
        var filmNavigator = $('.film-navigator');
        if (filmNavigator.length) {
            if ($("#youtube-player-container").length && $('.types .youtube').length) {
                $("#youtube-player-container").tubeplayer({
                    width: 624,
                    height: 382,
                    allowFullScreen: "true",
                    playerID: "youtube-player",
                    preferredQuality: "default"
                });
            }
            initButtonsFilmNavigator();
            initFilmNavigator();
        }



        /*TABS*/
        $('.tab-wrapper').each(function () {
            initTabs($(this));
        });

        var activity = $('.activity');
        if (activity.length) {
            getYoutubePosts();
        }




        /**/
        var hpGallery = $('.hpTypeFilme .gallery');
        if (hpGallery.length) {
            initHpGallery();
        }

        /**/
        var filmGallery = $('.film-detail-gallery');
        if (filmGallery.length) {
            initFilmGallery();
        }

        /*SUPPORT*/
        var accordion = $('.accordion');
        if (accordion.length) {
            initAccordion();
        }
        var support = $('.support');
        if (support.length) {
            $('.support-line-block').each(function (index) {
                $(this).bind('click', showAccordion);
            });
        }


        /**/
        var type3 = $('.hpTypeP3');
        if (type3.length) {
            $('.hpTypeP3').each(function (index) {
                verticalCenter($(this));
            });
        }

        var hp = $('.homepage.hp');
        if (hp.length) {
            $('.top-text h3 a').css('color', '#000');
        }

    }
};

$(document).ready(function () {
    Website.run();
});
