JavaScript tiered broker selector