Javascript Mobile Detection

Found on StackOverflow http://stackoverflow.com/questions/3514784/what-is-the-best-way-to-detect-a-handheld-device-in-jquery#answer-3540295

Seems to work pretty well. Have not tested on all devices but does work for all Android and iOS devices I tested