//
//
//
//


var theTimerMode=1;
var pausedTime=0;

//	TIMER MODE

function timerMode() {
	if(theTimerMode==1) {
		theTimerMode=0;
		} else {
			theTimerMode=1;
			advanceClock(pausedTime);
			}
	}

//	ADVANCE CLOCK

function advanceClock(time) {
	if(theTimerMode==1) {	
		if(time>59) { theMinutes=parseInt(time/60);} else {theMinutes=0;}
		if(theMinutes<10) {theMinutes="0"+theMinutes;}
	
		theSeconds=time%60;
		if(theSeconds<10) {theSeconds="0"+theSeconds;}
		theTimeString=theMinutes+":"+theSeconds
		document.forms[0].timer.value=theTimeString;
		if(time<3600) { runningTime(time); }
		pausedTime=time;
		}
	}
	
//	RUNNING TIME
	
function runningTime(timeIn) {
	timeOut=parseInt(timeIn);
	timeOut=timeOut+1;
	eval("setTimeout(\'advanceClock("+timeOut+")\',1000)");
	}
