<!--
// Session expiration detection for Koskan Real Estate - http://www.koskan.com
// All code copyright © 2003-2005 Koskan Real Estate

// check if the current time is past the expiration time
// if so, kick them to the login page
// if not, set a timer to call this function in one minute
function checkExpire()
{
	if (expireafter)
	{
		var d = new Date();
		var now = unixtime();
		var pad = 15; // pad the expiration time by this many seconds to make sure that they are logged out when the page is refreshed

		if ((now-start) >= (expireafter-pad) && ds) { top.location = top.location; }
		else if ((now-start) >= (expireafter+pad)) { top.location = '/admin/index.php?mod=1&timeout=1'; }
		else { setTimeout('checkExpire()',5000); }
	}
}
function unixtime()
{
	var d = new Date();
	return Math.round((d.getTime()/1000),0);
}

var start = unixtime();
checkExpire();

-->