Comments here and down below on the matching else explaining what's going on.   If I hadn't ready manage.js first, I'd be completely confused at this point.