Phonegap code / Front-end