Fix javascript for browsers that do not handle matchMedia queries