current.toggle = function () { this.expanded = !this.expanded; if (this.expanded) { if (this.type == 'collection') directory.loadNav('item', this); else { directory.loadNav('community', this); directory.loadNav('collection', this); } } }