View Single Post
Old 05-12-2011, 07:21 PM  
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,058
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 
Math.round(num Math.pow(10,dec));  
  if (
>= 0n1=n2='';   
  var 
= (''+Math.abs(x)).split('');  
  var 
y.length dec;   
    
  if (
z<0z--;   
  for(var 
z0i++)  
     
y.unshift('0');   
  
y.splice(z0pnt);  
  if(
y[0] == pnty.unshift('0');   
  while (
3)  
  {  
       
z-=3;  
       
y.splice(z,0,thou);  
  }   
  var 
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 += ''
nStr.split('.'); 
x1 x[0]; 
x2 x.length '.' 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> 
__________________
All cookies cleared!
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote