﻿
App.faq = function () {

    /* Private */

    /* Properties */

    var cmp = {};



    /* Defaults */

    TVI.debug = true;


    /* Methods */

    var init = function () {

        //FAQ
        // Open/close correct FAQ
        $('.faq .question').click(function () {

            // If open, close and remove 'open' class, If not open, open and add 'open' class
            if ($(this).parent().hasClass('open')) {
                $(this).parent().removeClass('open').find('.answer').slideUp();
            } else {
                // Close all others
                $('.faq .answer').slideUp();
                $('.faq').removeClass('open');

                $(this).parent().addClass('open').find('.answer').slideDown();
            }

            return false;
        });


    };


    /* Public */

    TVI.apply(cmp, {

        /* Properties */

        test: 'test',

        /* Methods */

        test: function () {

            /* Test function  */

        }

    });


    TVI.ready(init);


    return cmp;


} ();
