add jquery and more clearly implement the on-duty / off-duty JS