codice:
<html> 
<head> 
<title>div movie</title> 
<script> 
delta=150; 
myleft1=start1=230; 
var tm;
function test1(){ 
clearTimeout(tm);
if (myleft1>start1||myleft1==start1) {movediv1_off();} 
else {movediv1_on();} 
} 
function movediv1_on(){ 
//document.getElementById('mylink1').style.left=-150 
if (myleft1<start1||myleft1==start1) { 
	tm=setTimeout('movediv1_on()',1); 
	document.getElementById('NW').style.left=myleft1; 
	myleft1+=1.5;} 
} 
function movediv1_off(){ 
if (myleft1>(start1-delta)) { 
	tm=setTimeout('movediv1_off()',1); 
	document.getElementById('NW').style.left=myleft1; 
	myleft1-=1.5;} 
else { 
	//document.getElementById 'mylink1').style.left=270; 
} 
} 
</script> 
<style> 
#NW { 
position: absolute; 
height: 156; 
width: 212; 
top: 150; 
left: 230; 
background-image : url('_MYBASE_NW.GIF') 
} 
</style> 
</head> 

<body> 
<div id="NW" onclick="javascript: test1();">Clicca qui</div> 
</body> 
</html>
devi complicare un pochino la logica ed i controlli se vuoi l'inversione del moto anche quando va verso destra

ciao