/**
 * Отвечает за загрузку истории
 */
chatLoadHistoryEventsObserver = Class.create({
	initialize: function(observer) {
		this.observer = observer;
		this.init();
	},

	init: function() {

		this.observer.on('settings.onSuccess', function(c) {
			$('chat_load_history_24h').observe('click', function (e){
				this.observer.fire('history.load', {'hours':24});
				Event.stop(e);
			}.bind(this));

			$('chat_load_history_7d').observe('click', function (e){
				this.observer.fire('history.load', {'hours':168});
				Event.stop(e);
			}.bind(this));

			$('chat_load_history_14d').observe('click', function (e){
				this.observer.fire('history.load', {'hours':336});
				Event.stop(e);
			}.bind(this));

			$('chat_load_history_30d').observe('click', function (e){
				this.observer.fire('history.load', {'hours':720});
				Event.stop(e);
			}.bind(this));

			$('chat_load_history_all').observe('click', function (e){
				this.observer.fire('history.load', {'hours':0});
				Event.stop(e);
			}.bind(this));
		}.bind(this));
	}
});
