I want to add an animated image in auto complete.

I want to add an animated image in auto complete.

I am using jquery ui to make an auto complete . 
i am using a gif image while searching when user enter a letter .
Image working while search but i want to remove image when user select . where i put my remove class to remove that animated image . 
Full code is given below , 
any suggestion 


<link rel="stylesheet" href="css/stylesheet.css" type="text/css" />
<script src="js/user.js"></script>
<script src="themes/jqery-themes.js"></script>
<style>
.image{ background-image:url(images/animation_processing.gif); background-repeat:no-repeat; }
</style>
<script>
$(function(){
var auto = [
"C",
"C++",
"JAVA",
"PHP",
"COBOL"
];
$("#tags").autocomplete({
source:auto,
search : function(){$("#tags").addClass('image')},
});
});
</script>

<div><input  id="tags" style="border:solid; height:400px; width:300px" /></div>