/*


Main SlideShow Class:

EXAMPLE USAGE:

new SlideShow('container', { slideDuration: 2 });

*/
var Browse = Class.create({

	initialize: function(element, options){
		this.element = element;
		this.suppliedOptions = options;
		this.defaultOptions = $H({
			
		});

		// assigning the options to internal variables
		this.options = this.defaultOptions.merge(this.suppliedOptions).toObject();
		this.observe();
	},

	observe: function(){
		$$('a').each( function(e){
			if (e.title != "noAjax" && e.href.charAt(e.href.length-1) != "#")
			{
				link = e.href;
				e.observe( 'click', this.request.bindAsEventListener(this, link) );
				e.href="#";
			}
		}.bind(this));
	},
	
	request: function ( e, link )
	{
		//console.log(link);
		try {
		new Ajax.Request(link, {
			method: 'get',
			object: this,
			onSuccess: function(transport) {
				this.update(transport);
			}.bind(this)
		});
		} catch (err) {
			alert(err);
		}
	},
	update: function(rsp)
	{
		$('content').update(rsp.responseText);
		this.observe();
	}

});
