Try like this:
var X1=0,Y1=0,X2=0,Y2=0, iDistance=0
function Clicked()
{
if (X1)
{
X2=window.event.clientX
Y2=window.event.clientY
}
else
{
X1=window.event.clientX
Y1=window.event.clientY
}
If (X2)
{
iDistance=sqrt(square(X1-X2)+square(Y1-Y2))
X1=X2
Y1=Y2
document.write("iDistance")
}
}
Call Clicked() from the mouseclick event of your page. This will calculate distance between click1 and click2, then, when you click a 3rd time, between 2nd and 3rd, etc. Something like this anyway.