$(document).ready(function(){var aClock=$('#analog-clock');var clockWidthHeight=aClock.width();function startClock(){aClock.css({"height":clockWidthHeight+"px"});aClock.fadeIn();setInterval(function(){rotateHands();},200);rotateHands();}
function rotateHands(){var now=new Date();var secondAngle=360/60*now.getSeconds();$('#secondHand').rotate(secondAngle,'abs');$('#secondHand').css({"left":(clockWidthHeight-$('#secondHand').width())/2+"px","top":(clockWidthHeight-$('#secondHand').height())/2+"px"});var minuteAngle=360/60*now.getMinutes();$('#minuteHand').rotate(minuteAngle,'abs');$('#minuteHand').css({"left":(clockWidthHeight-$('#minuteHand').width())/2+"px","top":(clockWidthHeight-$('#minuteHand').height())/2+"px"});var hourAngle=360/12*now.getHours();$('#hourHand').rotate((hourAngle+minuteAngle/12)%360,'abs');$('#hourHand').css({"left":(clockWidthHeight-$('#hourHand').width())/2+"px","top":(clockWidthHeight-$('#hourHand').height())/2+"px"});};startClock();});
