
var step1 = null;
var step2 = null;

function setupintro ()
{
	//document.body.style.backgroundImage = "url(images/intro_end.jpg)";
	$('introbody2').style.backgroundImage = "url(images/intro_end.jpg)";
	step1 = Effect.Appear($('loadingdiv'),
	{
		duration: 1.0
		,from: 1.0
		,to: 0.0
		,delay: 1.0
		,queue: 'start'
		,afterFinish: function ()
		{
			Element.hide('loadingdiv');
			step2 = Effect.Appear($('intro'),
			{
				duration: 3.0
				,from: 1.0
				,to: 0.0
				,delay: 0.0
				,queue: 'start'
				,afterFinish: loadMain
			});
		}
	});
}

function loadMain ()
{
	Element.hide('intro');
	Effect.Appear($('outerwrappermain'),
	{
		from: 				0.0
		,to: 					1.0
		,duration:		3.0
		,transition:	Effect.Transitions.linear
		,queue:				'start'
		,delay:				0.5
	});
}

function skipToLoadMain ()
{
	if ( step1 != null ) step1.cancel();
	if ( step2 != null ) step2.cancel();
	Element.hide('loadingdiv');
	Element.hide('intro');
	Effect.Appear($('outerwrappermain'),
	{
		from: 				0.0
		,to: 					1.0
		,duration:		0.5
		,transition:	Effect.Transitions.linear
		,queue:				'start'
		,delay:				0.0
	});
}

Event.observe( window, "load", setupintro );
