to use media queries in javascript (http://adactio.com/journal/5429/)