Where's the infinite loop in these scripts?

Please use code tags, as outlined in the stickied post at the top of each forum. Please re-copy from the source and paste into the code tags, so that the formatting isn’t lost.