http://madspiders.com/testcounter.htm
It is right now set to add .00006944 dollars every second which is about $6.00 a day. Pretty boring though because it only clicks off a cent every 2.5 minutes.
PHP Code:
<html>
<head>
<script type="text/javascript">
function startTime()
{
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
var ms=today.getTime();
//var moneySavedPerSecond = 5.47;/*in dollars*/
var moneySavedPerSecond = .00006944;/*in dollars*/
var startDate = 1301802459944;/*In milliseconds from Jan 1, 1970*/
var startSavings = 1000.00;
//var totalSaved=Math.round(((ms-startDate)/1000)*moneySavedPerSecond+startSavings);
var totalSaved=((ms-startDate)/1000)*moneySavedPerSecond+startSavings;
// add a zero in front of numbers<10
m=checkTime(m);
s=checkTime(s);
totalString = formatNumber(totalSaved,2,',','.','$','','','');
//totalString = addCommas(totalString); //calls the addCommas function and returns the value with the commas
document.getElementById('txt').innerHTML="Our customers have saved "+totalString+" with us.";
t=setTimeout('startTime()',100);//time in milliseconds for the total to be updated
}
// number formatting function
// copyright Stephen Chapman 24th March 2006, 10th February 2007
// permission to use this function is granted provided
// that this copyright notice is retained intact
// from http://ntt.cc/2008/04/25/6-very-basic-but-very-useful-javascript-number-format-functions-for-web-developers.html
function formatNumber(num,dec,thou,pnt,curr1,curr2,n1,n2)
{
var x = Math.round(num * Math.pow(10,dec));
if (x >= 0) n1=n2='';
var y = (''+Math.abs(x)).split('');
var z = y.length - dec;
if (z<0) z--;
for(var i = z; i < 0; i++)
y.unshift('0');
y.splice(z, 0, pnt);
if(y[0] == pnt) y.unshift('0');
while (z > 3)
{
z-=3;
y.splice(z,0,thou);
}
var r = curr1+n1+y.join('')+n2+curr2;
return r;
}
function checkTime(i)
{
if (i<10)
{
i="0" + i;
}
return i;
}
function addCommas(nStr) //function from http://www.mredkj.com/javascript/nfbasic.html
{
nStr += '';
x = nStr.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(d+)(d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
}
return x1 + x2;
}
</script>
</head>
<body onload="startTime()">
<div id="txt">If you can read this something went wrong.</div>
</body>
</html>