Show Visitor's Stay time
<script language= "JavaScript" >varAp_name =navigator.appname;varAp_vinfo =navigator.appversion;varAp_ver = parsefloat (ap_vinfo.substring ("0,ap_vinfo.indexof" (')));varTime_start =NewDate ();varClock_start =time_start.gettime ();vardl_ok=false;functioninit () {if(ap_name== "Netscape" && ap_ver>=3.0) Dl_ok=true;return true;}functionget_time_spent () {varTime_now =NewDate ();return((Time_now.gettime ()-Clock_start)/1000);}functionShow_secs ()//show the time user spent on the side{varI_total_secs =Math.Round (Get_time_spent ());varI_secs_spent = i_total_secs% 60;varI_mins_spent = Math.Round ((i_total_secs-30)/60);varS_secs_spent = "" + ((i_secs_spent>9)? I_secs_spent: "0" +i_secs_spent);varS_mins_spent = "" + ((i_mins_spent>9)? I_mins_spent: "0" +i_mins_spent);d ocument.fm0.time_spent.value= S_mins_spent + ":" +S_secs_spent;window.settimeout (' Show_secs () ', 1000);}// -</script><form name= "fm0" onsubmit= "0" ><font color= "#6060FF" >Stay Time:</font><input type= "text" name= "time_spent" size=7 onfocus= "This.blur ()" ></FORM>
Then add it to your home source files <body> tags
<body onload= "Init (); Window.settimeout (' Show_secs () ', 1); " >
JS implementation shows the visitor's dwell time