
function _init()
{
	//window.moveTo(0,0);
	//window.resizeTo(screen.availWidth, screen.availHeight);

 if (document.all && /MSIE (5\.5|6)/.test(navigator.userAgent) &&
  document.styleSheets && document.styleSheets[0] && document.styleSheets[0].addRule)
 {
  document.styleSheets[0].addRule('.pngfix', 'behavior: url(iepngfix.htc)');
 }

	// trick: elements that are faded in during initialization have their 'style.visibility'
	// attribute set to 'hidden'.  When we are ready to fade them in, we use Mootools to set 
	// *opacity* to zero, then undo the original CSS invisibility by setting 'style.visibility'
	// to 'visible', and THEN use Mootools to fade the element in.
	
	var fInitRightAway = function()
	{
		// fade in the background image
		var bground1Fx = new Fx.Tween($('bg1'), {property:'opacity', duration: 1200, link: 'cancel', fps: 25});
		bground1Fx.set(0);
		bground1Fx.element.style.visibility = "visible";
		bground1Fx.start(1);	
	};
	
	var fFirstDelay = function()
	{
		var x = document.getElementById ? document.getElementById("innercontainer") : document.all("innercontainer");
		if (x != null)
		{
			// fade in the innercontainer
			var containerFx = new Fx.Tween($('innercontainer'), {property:'height', duration: 1000, transition: Fx.Transitions.Quad.easeOut, link: 'cancel', fps: 25});
			containerFx.set(1);
			containerFx.element.style.visibility = "visible";
			containerFx.start('1250px');
		}
		
		var eShortcutHome = $('shortcuthome');
		if (eShortcutHome != null)
		{
			var shortcutHomeFx = new Fx.Tween(eShortcutHome, {property:'opacity', duration: 250, transition: Fx.Transitions.Quad.easeOut, link: 'cancel', fps: 25});
			//shortcutHomeFx.set(0);
			shortcutHomeFx.element.style.visibility = "visible";
			//shortcutHomeFx.start(1);
		}
		
		var eViewer = $('viewer');
		if (eViewer != null)
		{
			var viewerFx = new Fx.Tween(eViewer, {property:'opacity', duration: 1000, transition: Fx.Transitions.Quad.easeOut, link: 'cancel', fps: 25});
			viewerFx.set(0);
			viewerFx.element.style.visibility = "visible";
			viewerFx.start(1);
		}
		
	}
	
	var fSecondDelay = function()
	{
		if ($('content') != null)
		{
			// fade in the background image
			if (!Browser.Engine.trident)
			{
				var contentRegFx = new Fx.Tween($('content'), {property:'opacity', duration: 1000, link: 'cancel', fps: 25});
				contentRegFx.set(0);
				contentRegFx.element.style.visibility = "visible";
				contentRegFx.start(1);
			}
			else
			{
				// opacity fades on text messes up the cleartype in IE, 
				// so cheat and transition the font colour instead of opacity:
				var contentIeFx = new Fx.Tween($('content'), {property:'color', duration: 1000, link: 'cancel', fps: 25});
				contentIeFx.set('#fff');
				contentIeFx.element.style.visibility = "visible";
				contentIeFx.start('#000');	
			}
		}
		
		if ($('pagetitle') != null)
		{
			var titleFx = new Fx.Tween($('pagetitle'), {property:'opacity', duration: 1000, link: 'cancel', fps: 25});
			titleFx.set(0);
			titleFx.element.style.visibility = "visible";
			titleFx.start(1);
		}
		
		if ($('albumheader') != null)
		{
			var albumHeaderFx = new Fx.Tween($('albumheader'), {property:'opacity', duration: 1000, link: 'cancel', fps: 25});
			albumHeaderFx.set(0);
			albumHeaderFx.element.style.visibility = "visible";
			albumHeaderFx.start(1);
		}
	
	};

	fInitRightAway.run();
	fFirstDelay.delay(1200);
	fSecondDelay.delay(1600);
	
} // end _init();

function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}


window.addEvent('pagecomplete', function(){ _init(); });