I'm sure this code could be improved, but this will get done what you need:
Code:
<script type="text/javascript">
var $redir = true;
var $timeout;
var $timer = 60000; // Reset time in milliseconds
var $redirUrl = "http://www.google.com/"; // URL to redirect to
function _CancelRedir() {
clearTimeout($timeout);
$timeout = setTimeout("_Redir()", $timer);
}
function _Redir() {
if($redir == true) {
document.location.href = $redirUrl;
} else {
$timeout = setTimeout("_Redir()", $timer);
}
}
document.body.addEventListener('load', _Redir, false);
document.body.addEventListener('click', _CancelRedir, false);
document.body.addEventListener('keypress', _CancelRedir, false);
</script>
You could add more event listeners (and probably optimize that code to work from an array of events) but this covers the basics. If anything on the page is clicked or any keys are pressed (not sure exactly how your kiosk is designed or setup) it will reset the timer (set to 60 seconds). If nothing on the page is clicked or no keys are pressed then in 60 seconds it will redirect to a URL you can set.
Bookmarks