Use javascript instead of css hack