Fix JS warnings when $ is not available

The construction ($ || addHorizonLoadEvent) complains when $ is not
defined. Using (window.$ || window.addHorizonLoadEvent) instead solves
this problem.

Change-Id: Ied5db7398f6ca1d25906c84d5e40a4bae6c01f39