"Scroll Smoothly" tutorial: http://www.sitepoint.com/article/scr...ly-javascript/

I have discovered a small problem when trying to use the script. If I make an internal link like this...

<a href="#scroll">Scroll to top</a>

then I have no problem getting the script to work. However when making an internal link like this...

<a href="#scroll"><img alt="" height="25" src="arrow.gif" width="25" /></a>

the script fails, and I'm not getting the smooth scroll effect. I wonder why? I'm noway a good JavaScript coder, but most likely it's the ss_fixAllLinks() function, which fails to read the second link properly. Any help much appreciated.