Rewrite of MarkTime using JavaScript for PhoneGap/Cordova