changed to use mobileinit instead of document.ready