// itime.js
// last modified 2004-07-15

main();

function main()
{
	// get current time and break down into UTC hours, minutes, seconds
	var t = new Date();
	var hr = t.getUTCHours();
	var min = t.getUTCMinutes();
	var sec = t.getUTCSeconds();
	delete t;

	// get total seconds
	sec = (hr * 60 * 60) + (min * 60) + sec;

	// add 1 hour for Biel offset
	sec = sec + (60 * 60);

	// round to nearest whole beat
//	sec = sec + 43;

	// convert to beats
	var beats = Math.floor(sec / 86.4) % 1000;

	// write
	document.write("@" + ThreeDigit(beats));
}

function ThreeDigit(n)
{
	var s = n;
	if (n < 100)
		s = "0" + s;
	if (n < 10)
		s = "0" + s;
	return s;
}

