Having trouble clearing my setTimeout
<pre><code>var timer;
var object;
var thing;
var digit="0";

//this function fires when a single click occurs

function one(event){
   timer = setTimeout("AddDigit(object)",500);
   object = event;
}

//The AddDigit function keeps firing right after my double click function 
function AddDigit(x){
   object=x;
   if (eval(digit) == 0){ digit = object; }
   else{ digit = digit + object; }

   document.calculator.display.value = object;

}
// This function is supposed to stop the AddDigit function from firing...

document.ondblclick = function(button){
   clearTimeout(timer);

   thing=button.target;
   thing.setAttribute("class","duction");
}
</code></pre>
