Added isDevice function to detect.js.