<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000066">
there are a number of ways of doing this and make it look a lot cleaner
your problem could be that replaceWith replaces the whole element. Once
you *replace* img#imp_plus001 that ID isn't there anymore so next time
function runs it isn't found and no image change.
<a class="moz-txt-link-freetext" href="http://docs.jquery.com/Manipulation/replaceWith">
http://docs.jquery.com/Manipulation/replaceWith</a>If you don't have firebug it would be well worth installing it and
looking at the html it produces after this replacement. None of the
original element is left
Not sure why you going to trouble of rewriting the html each time. You
already utlized attr("src") and easily could have switched that each
time for cleaner look but even that looks ugly in your if conditions.