var ajaxUpdater = new Class({
	Implements: [Options, Events],
	options: {
		elementsToDefeat: '.ajaxlinks a', // selector
		elementToUpdate : 'menucontents', // id
		onRequest: $empty
	},
	initialize: function(options){
		  this.setOptions(options);
		  
		  this.defeatLinks(this.options.elementsToDefeat);
//		  this.addSliders(this.options.sliders);
		  
//		  this.contentFx = new Fx.Morph(this.options.elementToUpdate, { link: 'cancel' });

/*		  if(this.options.showInitialSlider != false)	// test to see if we need to isolate  slider 
		  	this.showSlider.bind(this, this.options.showInitialSlider);
		  else
		  	this.equalizeSliders(); // show all of the sliders
*/
	},
	  


//	links: [],



   	// ******************************** 
	// MAIN NAVI STUFF
	// ******************************** 
	// Add sliders to our master array of sliders and assign them behaviours
	defeatLinks: function(links)
	{
		$$(links).each(function(element){
				element.addEvent('click', function(e){
						var e = new Event(e).stop();
						
						this.callAjax(element);
					}.bind(this));
			}, this);
	},
	callAjax : function(element)
	{
//		alert(element);	
		var myHTMLRequest = new Request({
											 url : element.href,
//											 update : $(this.options.elementToUpdate)
											 onComplete: function(response) {
//												 this.options.onRequest;
//												 alert(response);
												 var contentMorph = new Fx.Morph($(this.options.elementToUpdate), {});
												 contentMorph.chain(function(){
														$(this.options.elementToUpdate).set('html', response);
														contentMorph.start({'opacity' : 1});
													}.bind(this));
													contentMorph.start({'opacity' : 0});
												 }.bind(this)
											 });
//		myHTMLRequest.post("data=true");
		myHTMLRequest.send("data=true");
	}
});