// code for hailstone clock // quick review 2-14-2008

for (i=0;i<26;i++){
	var scale=2
	var angle = i * 6;
	var piangle = Math.PI - Math.PI / 180 * angle;
	var fromleft = scale*10+5 + Math.round(scale*10 * Math.sin(piangle));
	var fromtop  = scale*10+5  + Math.round(scale*10 * Math.cos(piangle));
	//document.write('<div id="dot'+i+'" style="position:absolute;left:-10;top:-10;cursor:default;z-index:50"><font face="Arial" size="4">.<\/font><\/div>');
	document.write('<div class="hand" id="dot'+i+'" >.<\/div>');
}

function tick(){
	var now = new Date();
	var min = now.getMinutes();
	var hour = now.getHours();
	var sec = now.getSeconds();
	
	for(i=0;i<26;i++){
		var angle = (i < 10) ? Math.round(sec*6):(i<19)?Math.round(min*6):Math.round((hour*30)+((min/2)));
		var minus = (i<10)?0:(i<19)?10:19;
		var piangle = Math.PI - Math.PI / 180 * angle;
		var fromleft = scale*10+5 + Math.round(((i-minus)*scale) * Math.sin(piangle));
		var fromtop  = scale*10+5 + Math.round(((i-minus)*scale) * Math.cos(piangle));
		
		with(document.getElementById("dot"+i).style){
			color = (i < 10) ? "#666666" : (i < 19) ? "#333333" : "#333333";
			left = fromleft+"px";
			top = fromtop+"px";
			}
	   }
	setTimeout("tick()",1000);
}

window.onload = tick;