﻿Namespace.create('Jampad');
//+
//- Jampad.TitledArea -//
Jampad.TitledArea = (function() {
    //- ctor -//
    function ctor(init) {
        if (init) {
            if (init.id) {
                this.id = init.id;
                //+
                this.topId = init.id + 'Top';
                this.middleId = init.id + 'Middle';
                this.bottomId = init.id + 'Bottom';
                //+
                this.topDOM = $(this.topId);
                this.middleDOM = $(this.middleId);
                this.bottomDOM = $(this.bottomId);
                //+
                this.collapsed = true;
                this.middleDOM.hide();
            }
            else {
                throw 'id is required.';
            }
            this.topDOM.setStyle({
                cursor: 'pointer'
            });
            this.topDOM.observe('click', function(evt) {
                this.collapsed = !this.collapsed;
                if (this.collapsed == true) {
                    this.middleDOM.hide();
                }
                else {
                    this.middleDOM.show();
                }
            } .bind(this));
        }
    }
    ctor.prototype = {
        //- myfunction -//
        myfunction: function(t) {
        }
    };
    //+
    return ctor;
})();