Also, you should use Popcorn's script loading stuff vs. doing this manually.  You aren't doing any checks on *when* this gets loaded, so you might have timing errors.