var Clock=function(b){var a=this;if((typeof AC!=="undefined"&&typeof AC.Detector!=="undefined")&&!((AC.Detector.isWebKit()&&AC.Detector.isCSSAvailable("-webkit-transform"))||(AC.Detector.isFirefox()&&AC.Detector.isCSSAvailable("-moz-transform")&&!AC.Detector.isWin()))){return false
}this.elements={};this.elements.clock=$(b);this.elements.hour=this.elements.clock.down(".hour");
this.elements.minute=this.elements.clock.down(".minute");this.elements.second=this.elements.clock.down(".second");
this.elements.date=this.elements.clock.down(".date");this.elements.hour.offset=this.elements.hour.translateOffset()||"";
this.elements.minute.offset=this.elements.minute.translateOffset()||"";this.elements.second.offset=this.elements.second.translateOffset()||"";
this.elements.hour.setVendorPrefixStyle("transform-origin","50% 100%");this.elements.minute.setVendorPrefixStyle("transform-origin","50% 100%");
this.elements.second.setVendorPrefixStyle("transform-origin","50% 100%");this.elements.hour.fullRotations=this.elements.minute.fullRotations=this.elements.second.fullRotations=0;
this.elements.hour.previousDegrees=this.elements.minute.previousDegrees=this.elements.second.previousDegrees=0;
this.interval=window.setInterval(this.update.bind(this),130);this.update();this.elements.clock.addClassName("active")
};Clock.prototype={constants:{degree:360,hour:12,minute:60,second:60},update:function(){this.__update("hour");
this.__update("minute");this.__update("second");this.__update("date");this.elements.clock.addClassName("animate")
},__update:function(a){var d=this.degreesForCurrentAmountOfUnitOfTime(a),c=this.translateCSSStringForElement(this.elements[a]);
if(a==="date"){this.elements.date.update(new Date().getDate())}else{if(Object.isElement(this.elements[a])){this.elements[a].setVendorPrefixStyle("transform","rotate("+d+"deg)"+c)
}else{try{console.warn("No element found to update for the unit of measurement: "+a)
}catch(b){}}}},degreesForCurrentAmountOfUnitOfTime:function(c){if(c==="date"||!(c in this.constants)){return 0
}var a,f,b;totalAmount=this.constants[c],now=new Date(),midnight=new Date((now.getMonth()+1)+"/"+now.getDate()+"/"+now.getFullYear()),seconds=((now.getTime()-midnight.getTime())/1000);
switch(c){case"hour":a=((seconds/this.constants.second)/this.constants.minute);
break;case"minute":a=((seconds/this.constants.second)%this.constants.minute);break;
case"second":a=(seconds%this.constants.second);break;default:try{console.warn("Must define unit to get degrees from constant.")
}catch(d){}return 0}if(a>totalAmount){a-=totalAmount}f=((a/totalAmount)*this.constants.degree);
b=f;if(f<this.elements[c].previousDegrees){this.elements[c].fullRotations+=1}this.elements[c].previousDegrees=f;
b+=this.constants.degree*this.elements[c].fullRotations;return b},translateCSSStringForElement:function(a){var b=a.translateOffset();
if(b===null){return""}else{if(AC.Detector.supportsThreeD()){return" translate3d("+b.x+"px, "+b.y+"px, 0)"
}else{return" translate("+b.x+"px, "+b.y+"px)"}}}};
