I am trying to program a counter into a website via JavaScript and have found exactly what I need here: http://www.w3schools.com/js/js_timing.asp
What I am trying to do
As far as I understand it, you need to call clearTimeout() function to reset the counter eg:
var t = setTimeout("alert('I am displayed after 3 seconds!')", 3000);
Later you can reset it like:
clearTimeout(t);