var RecordCounter = new Class({
	setOptions: function(options) {
	this.options = Object.extend({
			startCount: 1221885400,
			startTime: 1229629536,
			incrementsPerSecond: 12,
			delayMilliseconds: 1500
		}, options || {});
	},
	initialize: function(el, options){
		this.el = $(el);
		this.setOptions(options);
		this.currentTime = (new Date()).getTime();

		this.updateCount.bind(this).periodical(this.options.delayMilliseconds);
	},
	updateCount: function() {
		var timeDiff = parseInt((this.currentTime - this.options.startTime) * this.options.incrementsPerSecond / 1000);
		var currentCount = (this.options.startCount + timeDiff);
		this.currentTime += this.options.delayMilliseconds;

		this.el.setHTML('<span>' + currentCount + '</span>');
	}
});

window.addEvent('domready', function() {
	if ($('RecordsShuttledBox')) {
		new RecordCounter('RecordsShuttledBox', {startCount:1221885400, startTime:1229629536000, incrementsPerSecond:12, delayMilliseconds:200});
	}
});

