As Om3n said, you have to alter the code to suit your needs / situation. Don't come here expecting a pre-packaged solution that requires no thinking, debugging and trouble-shooting.
Well. At least I won lunch. Good philosophy, see good in bad, I like!