Task = Class.create( {
initialize: function ( manager ) {
this.divs = [];
this.manager = manager;
},
add_div: function ( div ) {
this.divs.push( div );
},
show: function() {
this.divs.each( function ( div ) {
div.show();
} );
this.is_active = true;
},
hide: function() {
this.divs.each( function ( div ) {
div.hide();
} );
this.is_active = false;
},
select: function() {
this.manager.select( this );
}
} );
TaskManager = Class.create( {
new_task: function() {
return new Task( this );
},
select: function( task ) {
if ( this.current_task )
this.current_task.hide();
this.current_task = task;
task.show();
}
} );

