Phonegap Javascript