Change image in mouse in and out event
<HTML> <HEAD> <SCRIPT language="JavaScript"> if (document.images){ var pic1_init= new Image(); pic1_init.src="home.gif"; var pic1_new= new Image(); pic1_new.src="home1.gif"; } function change_it(the_name){ if (document.images){ document.images[the_name].src= eval(the_name+"_new.src"); } } function change_back(the_name) { if (document.images) { document.images[the_name].src= eval(the_name+"_init.src"); } } </SCRIPT> </HEAD> <BODY> <A HREF="#" onMouseOver="change_it('pic1')" onMouseOut="change_back('pic1')"> <IMG SRC="home.gif" name="pic1" id="pic1"> </A> </BODY> </HTML>