function addevents(){
$$('.ajax').removeEvents('click');
	$$('.ajax').each(function(el) {
		el.addEvent('click', function(el) {
			el.stop();
			if(this.get('rel')=='nofollow'){
				var updatediv = 'div'+this.get('id')
			} else {
				var updatediv = 'div'+this.get('rel')
			}
			//make ajax request
			var req = new Request({
				url: this.get('href'),
				method: 'get',
				data: { 'output' : 'ajax' },
				onRequest: function() {
					$(updatediv).setStyles({'display':'block','opacity':'.50'});
				},
				onSuccess: function(responseText) {
					$(updatediv).set('html',responseText);
					//do effect
					var myMorph = new Fx.Morph(updatediv,{'duration':500});
					myMorph.start({'opacity': 1});
					addevents();
				}
			}).send();
		});
	});
}



window.addEvent('domready',function() {
	addevents();
});