Changing class of linked image if it has been visited using jQuery
===

I have a series of linked rollover images using jQuery. Once the link has been clicked I would like the rollover images to change their class from 'rollover' to 'rollover2' so that I get a different set of images. Here is the jQuery for the rollover images:

    $(document).ready(function() {
    $("img.rollover").hover( 
    function() { this.src = this.src.replace("_off", "_on"); 
    }, 
    function() { this.src = this.src.replace("_on", "_off"); 
    });
    $("img.rollover2").hover( 
    function() { this.src = this.src.replace("_off2", "_on2"); 
    }, 
    function() { this.src = this.src.replace("_on2", "_off2"); 
    });
    });

Here is the code for the linked images:

    <a href="Mod1/index.html" target="_blank">
    <img src="images/watch_off.png" class="rollover" />
    </a>

The initial rollover works great, but I was trying to use the visited links plugin from [here][1] to trigger the change in the class name of any linked images to 'rollover2':

    <script src="js/jquery.visited.js"  type="text/javascript"></script>
    <script type="text/javascript">
    $('#links a').visited(function () {
      // hides the li element
      $(this).img.removeClass("rollover");
      $(this).img.addClass("rollover2");
    });
    </script>

This doesn't seem to work. Might any of you be able to help me out with this?

  [1]: http://remysharp.com/2008/02/25/visited-plugin/