Cached jquery window

It turns out that $(window) is still used in some places in code. This small commit fixes them.