Replaced JQuery Media plugin with pure javascript implementation.