This is a modified version of the cycle_image function in the misc.js file...  I only noticed later that there was some sort of jquery version of the cycle image function at the bottom of the file.  I've never used jquery before so instead of using time figuring it out, I just left it as is.  Feel free to replace it with jquery if you want.