added onmediaquery JS to handle events depending on screen size