Some math to make a custom slideshow work - how do I write it so that jquery understands?

Some math to make a custom slideshow work - how do I write it so that jquery understands?

Hi,

so i have a slideshow (that you can see here) at the moment when you mouseover any link it moves the slideshow on 1 picture.

This is the code that does that 

  1. $(options.button).bind('mouseover',this,function(event){
  2. event.data.rotate(1); //moves 1 picture to the right
  3. return false;
  4. });
Each of the links has a class of a number (current 1 - 6 but  could be more eventually). I'm trying to work out how i can tell jquery to remember the class of the link last mouseovered, get the class of the current link being mouseovered, subtract the class of the last link from the class of the current link, and then use that value in place of '1' on the code snippet above.

Even just a nudge in the right direction would be greatly appreciated!

Thank you :)