Mobile detection and redirection in javascript