window.setTimeout('getSecs()',1)

function person_in() {
   enter=new Date();
}
function person_out() {
   exit=new Date();
   time_dif=(exit.getTime()-enter.getTime())/1000;
   time_dif=Math.round(time_dif);
   alert ("You've only been here for: " + time_dif + " seconds!")
}
		 
startday = new Date();
clockStart = startday.getTime();
function initStopwatch() { 
var myTime = new Date();         
var timeNow = myTime.getTime();          
var timeDiff = timeNow - clockStart;         
this.diffSecs = timeDiff/1000;         
return(this.diffSecs); } 
function getSecs() {        
var mySecs = initStopwatch();         
var mySecs1 = ""+mySecs;         
mySecs1= mySecs1.substring(0,mySecs1.indexOf(".")) + " сек.";         
document.forms[0].timespent.value = mySecs1;
document.forms[0].rasstoyan.value = Math.round(mySecs * 154/60)+" чел. ";
document.forms[0].rasxod.value = Math.round(mySecs * 154/60*15/100)+" чел. ";
window.setTimeout('getSecs()',1000); }


