﻿
App.Default = function() {

    /* Private */

    /* Properties */

    var cmp = {};





    /* Methods */

    var init = function() {

        /* Constructor */
                
        TVI.event('#accordian .accordianButton', 'click', function(e) {
        
            TVI.logComment('clicked');
            
            var thisItem = $(this).parents('.item:first');
        
            // Check top see if they clicked the open item
            if (thisItem.hasClass('open')) { return false; }
            

            // Get a reference to the clicked and open elements
            var openItem = thisItem.parent().find('.open');
            

            openItem.animate({ width: "50px" }, 200);
            openItem.removeClass('open');
            thisItem.animate({ width: "680px" }, 200, function() {
                thisItem.addClass('open');
            });
            
            //get categoryID from meta
            var categoryID = TVI.meta(thisItem).categoryID;
            
            $('.categoryContent').hide();
            $('#category' + categoryID).fadeIn('fast');
            

        });
        
        
        App.menu('home');

    };





    /* Public */

    TVI.apply(cmp, {

        /* Properties */

        test: 'test',

        /* Methods */

        test: function() {

            /* Test function  */

        }

    });


    TVI.ready(init);


    return cmp;


} ();
