[ PHPXref.com ] [ Generated: Sun Jul 20 19:05:01 2008 ] [ OneOrZero 1.6.3 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/supporter/ -> timer.js (source)

   1  var timeSpent = 0;
   2  
   3  function timer()
   4  {
   5      setTimeout('timer()', 1000);
   6      if(!document.forms['form1']) return;    //Form doesn't exist

   7      if(!document.forms['form1'].elements['pause']) return;    //Form improperly loaded

   8      if(document.forms['form1'].elements['pause'].checked) return;    //Paused

   9      
  10      timeSpent++;
  11      
  12      var seconds = timeSpent%60;
  13      if(seconds < 10) seconds = "0" + seconds.toString();
  14      var minutes = (timeSpent-seconds)/60;
  15      document.forms['form1'].elements['timespent'].value = minutes + ":" + seconds;
  16  }
  17  
  18  window.onload = timer;


[ Powered by PHPXref - Served by Debian GNU/Linux ]