Javascript code to "ajaxify" a form and give ajaxy feedback, also on timeouts. Works in Firefox, Chrome, IE7/8/9.
The backend PHP script sleeps for 2 seconds, so you can cause a timeout by setting the timeout value to 1000 milliseconds.