Personally, I don't like the punch starts even if Cancel is clicked on prompt window... if I click erroneously the user gets punched because I can't undo my action... that's not good for me, not intuitive ("cancel" usually means "cancel action"). I've changed "do_punch" to suit my needs: if (message != null) then punch else don't do anyting
I'll add also an alert box to confirm that punch was sent (no errors) because some browsers (eg. firefox by default) don't allow status bar text changing via javascript
Keep testing it... btw good idea