Helper to manage media queries in javascript.