var init = function()
{
	setup_nav();
}

var applicationExit = function()
{
	
}

var pageloader = function( link )
{
	if(animating) { return; }
	animating = true;
	
	var pageIdentifier = filenameFromPath(link);
	$(document.body).setAttribute('id', pageIdentifier);
	
	if(!$('ajax-content'))
	{
		if($('content-main-block-inner'))
		{			
			$('content-main-block-inner').descendants().invoke('stopObserving');
			$('content-main-block-inner').remove();
		}
			
		$('main-cols').insert( { top: new Element('div', { id: 'ajax-content' }).hide() } );
		
		if($('loading')) { $('loading').show(); }
		new Ajax.Updater('ajax-content', link, { onComplete: pageupdate, evalScripts: true });
	}
	else
	{
		$('flash-toggle').stopObserving('click');
		$('flash-area').fade( { duration: 0.5, afterFinish: function() {
			Effect.BlindUp('ajax-content', { scaleContent: false, duration: 0.5, afterFinish: function() {
				if($('loading')) { $('loading').show(); }
				
				$('ajax-content').descendants().invoke('stopObserving');
				new Ajax.Updater('ajax-content', link, { onComplete: pageupdate, evalScripts: true } );
			} } );
		} } );
	}
}

document.observe('dom:loaded', homepage);
Event.observe(window, 'resize', homepage);
