Respond to media queries in Javascript