var siteTimer = Class.create(); siteTimer.prototype = { initialize: function( display_id ) { this.display = $(display_id); if(!this.display){ return false; } window.setInterval( this.tictac.bind(this), 1000 ); }, tictac: function() { this.date = new Date(); this.date = this.date.toLocaleString(); this.display.update(this.date); } }