<SCRIPT LANGUAGE="JavaScript">
var onHours = " ";
var onMinutes = " ";
var onSeconds = " ";
var offHours = 0;
var offMinutes = 0;
var offSeconds = 0;
var logSeconds = 0;
var logMinutes = 0;
var logHours = 0;
var OnTimeValue = " ";
var OffTimeValue = " ";
var PageTimeValue = " ";
function WinOpen()
{
getLogoffTime();
}
function getLogonTime()
{
var ampm = (now.getHours() >= 12) ? " P.M." : " A.M."
var Hours = now.getHours();
Hours = ((Hours > 12) ? Hours - 12 : Hours);
var Minutes = ((now.getMinutes() < 10) ? ":0" : ":") + now.getMinutes();
var Seconds = ((now.getSeconds() < 10) ? ":0" : ":") + now.getSeconds();
OnTimeValue =(" "
+ Hours
+ Minutes
+ Seconds
+ " "
+ ampm);
onHours = now.getHours();
onMinutes = now.getMinutes();
onSeconds = now.getSeconds();
}
function getLogoffTime()
{
var ampm = (now.getHours() >= 12) ? " P.M." : " A.M."
var Hours = now.getHours();
Hours = ((Hours > 12) ? Hours - 12 : Hours);
var Minutes = ((now.getMinutes() < 10) ? ":0" : ":") + now.getMinutes();
var Seconds = ((now.getSeconds() < 10) ? ":0" : ":") + now.getSeconds();
OffTimeValue =(" "
+ Hours
+ Minutes
+ Seconds
+ " "
+ ampm);
offHours = now.getHours();
offMinutes = now.getMinutes();
offSeconds = now.getSeconds();
timer();
}
function timer()
{
if (offSeconds >= onSeconds)
{ logSeconds = offSeconds - onSeconds; }
else
{
offMinutes -= 1;
logSeconds = (offSeconds + 60) - onSeconds;
}
if (offMinutes >= onMinutes)
{ logMinutes = offMinutes - onMinutes; }
else
{
offHours -= 1;
logMinutes = (offMinutes + 60) - onMinutes;
}
logHours = offHours - onHours;
logHours = ((logHours < 10) ? "0" : ":") + logHours;
logMinutes = ((logMinutes < 10) ? ":0" : ":") + logMinutes;
logSeconds = ((logSeconds < 10) ? ":0" : ":") +logSeconds;
PageTimeValue =(" "
+ logHours
+ logMinutes
+ logSeconds);
displayTimes();
}
function displayTimes()
{
// Verander hier je tekst:
alert("bedankt voor het bezoek aan www.sitemasters.be\n\n Hopelijk zien we je snel weer terug. :)\ \n\nJe bent begonnen om:" +OnTimeValue+"\n\nEn gestopt om: "+OffTimeValue+"\n\nJe bent zo lang op deze pagina geweest: " + PageTimeValue);
}
</SCRIPT>