Вроде как слепил. Для начала обычный таймер
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
body { background-color:#ffcc33; margin:0px; }
div { color:#0033cc; font:bold 12pt Tahoma; margin:15px; }
</style>
<script type="text/javascript">
var Timer = (function() {
var now, tm, offset = 0, i = 0;
return function() {
switch(arguments[0]) {
case true:
if(offset === 0) {
now = new Date();
offset = now.getTimezoneOffset() * 60000;
}
else {
return ;
}
break;
case false:
if(offset !== 0) {
clearTimeout(arguments.callee);
i = tm.getTime() - offset;
offset = 0;
}
}
if(offset !== 0) {
tm = new Date((new Date()).getTime() - now.getTime() + offset + i);
document.getElementsByTagName('div')[0].innerHTML = tm.toLocaleTimeString();
setTimeout(arguments.callee, 500);
}
}
})();
</script>
</head>
<body>
<input type="button" onclick="Timer(true)" value="Start">
<input type="button" onclick="Timer(false);" value="Pause">
<div>Div HTML</div>
</body>
</html>