var WebSite = new Class(
{
    initialize: function()
	{
		this.fadeSpeed = 300;
		this.fadePage = new Fx.Tween('content', { property: 'opacity', duration: this.fadeSpeed } );
		this.selectPage('home');
	},
	selectPage:function(pageTitle)
	{
		this.fadePage.cancel();
		this.fadePage.start(0).chain(
			function()
			{
				$('content').set('html','<div id="loaderImage"><img alt="Loading..." src="loader.gif"/></div>');
				this.fadePage.start(1);
				this.myReq = new Request(
				{
					method: 'get', url: 'lynnspin/'+pageTitle+'.html',onSuccess : 
					function( text )
					{
						$('content').innerHTML = '<div id="loadedContent">'+ text + '</div';
						this.fadePage.start(1);
					}.bind(this)
				}
				).send();
			}.bind(this)
		); 
	}
});

var spinSite;
window.addEvent('domready', function()
{
	spinSite = new WebSite();	
});