home *** CD-ROM | disk | FTP | other *** search
- //
- // Date Last Modified: Sunday, October 22, 2006
- //
- // Modified By: Mark Ritter (mritter)
- //
-
-
- function startInterval()
- {
- position="timers.js";
- whatfunc="startInterval()";
-
- if (Seconds<1)
- Seconds=1;
- startSecs=Seconds;
- if (Seconds>3600)
- Seconds=3600;
- if (Seconds>60)
- {
- m=parseInt(Seconds/60);
- Seconds=Seconds-(m*60);
- }
- else
- m=0;
-
- interval = window.setInterval("tTimer()",1000);
- }
-
-
- function stopInterval()
- {
- position="timers.js";
- whatfunc="stopInterval()";
-
- if (interval != "")
- {
- window.clearInterval(interval);
- interval="";
-
- // document.getElementById("TimerLayer").style.display = "none";
- document.getElementById("TimerLayer").style.visibility = "hidden";
- }
- }
-
-
- function tTimer()
- {
- position="timers.js";
- whatfunc="tTimer()";
-
- var txt="";
-
- if (Seconds==0)
- Seconds=1;
-
- txt = m+":"+ --Seconds;
-
- if (Seconds==0)
- {
- txt = m+":"+"0"+Seconds;
- m--;
- Seconds=60;
- }
-
- if (Seconds<10 && Seconds>-1)
- txt = m+":"+"0"+Seconds;
-
- document.getElementById("TimerDisplay").innerHTML=txt;
- passed++;
-
- document.getElementById("Timer_bar").style.width=Math.abs(TimerWidth-Math.floor((passed/startSecs)*TimerWidth))+"px";
-
- if (m==0 && Seconds<=StartBeepAtSecs)
- PlaySound(wpipath+"\\Themes\\"+Theme+"\\TimerSound.wav");
-
- if (Seconds==60 && m<0)
- {
- document.getElementById("TimerDisplay").innerHTML="0:00";
- document.getElementById("Timer_bar").width=0;
- Pause(0,250);
-
- stopInterval();
-
- checkInstall('timer');
- }
- }
-
-
- function PlaySound(soundfile)
- {
- document.getElementById("TimerSound").src="";
- document.getElementById("TimerSound").src=soundfile;
- }
-