﻿
App.Default = function() {

    /* Private */

    /* Properties */

    var cmp = {};

    /* Defaults */


    /* Methods */

    var init = function() {

        /* Constructor */

        // Popups on chocolate choices
        TVI.event('#chocChoices .chocChoice', 'mouseover', function() {
            $(this).find('.toolTip').show();
        });
        TVI.event('#chocChoices .chocChoice', 'mouseout', function() {
            $(this).find('.toolTip').hide();
        });

        // Big target on choc choice checkboxes
        TVI.event('#chocChoices .chocChoice', 'click', function() {

            $('#chocChoices').find('INPUT').attr('checked', '');
            $('#chocChoices .chocChoice .checkBox').removeClass('checked');
            $(this).find('INPUT').attr('checked', 'checked');
            $(this).find('.checkBox').addClass('checked');

        });

        // Check boxes
        TVI.event('.TVI-customCheckBox .checkBox', 'click', function() {

            var checkBox = $(this).find('INPUT');
            var customCheckBox = $(this);

            if (customCheckBox.hasClass('checked')) {
                customCheckBox.removeClass('checked');
                checkBox.attr('checked', '');
            }
            else {
                customCheckBox.addClass('checked');
                checkBox.attr('checked', 'checked');
            }

        });


        // TEMP ************
        TVI.event('#chocChoices .chocChoice2', 'mouseover', function () {
            $(this).find('.toolTip').show();
        });
        TVI.event('#chocChoices .chocChoice2', 'mouseout', function () {
            $(this).find('.toolTip').hide();
        });

        TVI.event('#chocChoices .chocChoice2', 'click', function () {

            $('#chocChoices').find('INPUT').attr('checked', '');
            $('#chocChoices .chocChoice .checkBox').removeClass('checked');
            $(this).find('INPUT').attr('checked', 'checked');
            $(this).find('.checkBox').addClass('checked');

        });

        // ********************


    };





    /* Public */

    TVI.apply(cmp, {

        /* Properties */

        test: 'test',

        /* Methods */

        test: function() {

            /* Test function  */

        }

    });


    TVI.ready(init);


    return cmp;


} ();
