
var keshajax = new Class({
        Implements: [Options, Events],
        options: {
			elements: [],
			updater: 'updater',
			loading: new Element('div').addClass('ismall').setStyle('padding-left', '20px'),
			onclass: 'on'
		},
        initialize: function(options){
            this.setOptions(options);
			this.options.elements.each(function(el){
				el.addEvent('click', function(event){
					event = new Event(event);
					event.stop();
					this.onClick(el);
				}.bind(this));
			}.bind(this));
			
			if (!this.options.bgcolorof)
			{
				this.options.bgcolorof = this.options.elements[0].get('background-color');
			}
        },
		
		ajaxify: function(url){
			var req = new Request.HTML({
					method: 'get', 
					url: url,
					data:'&tkn='+Math.random(),
					update:$(this.options.updater),
						onRequest: function() {
							$(this.options.updater).grab(this.options.loading);
						}.bind(this),
						onComplete: function() {}
			}).send();
		},
		
		
		
		onClick: function(el){
			this.options.elements.each(function(l){
				l.removeClass(this.options.onclass);
			}.bind(this));
			el.addClass(this.options.onclass);
			this.ajaxify(el.get('href'));
		}
		
});



