Attendence manager in jquery and phonegap