ToD continued... in JavaScript