convert to phonegap.js