Some Javascript Changes,

Now will run different code on desktop/vs phoneGap