var imgFadeIn = {type: 'opacity', from:0, to: 100, step: 2, delay:20};

function homePageAnim()
{
  // define the page object references
  
  // define the animations
  // ... globally defined above...
  
  // run the animations
  filmFadeIn();
}

function filmFadeIn()
{
  var filmImg = document.getElementById('filmImage');

  $fx(filmImg).fxAdd(imgFadeIn).fxRun(musicFadeIn);
}

function musicFadeIn()
{
  var musicImg = document.getElementById('musicImage');

  $fx(musicImg).fxAdd(imgFadeIn).fxRun(thePlusGroupFadeIn);
}

function thePlusGroupFadeIn()
{
  var theImg = document.getElementById('theImage');
  var plusImg = document.getElementById('plusImage');
  var groupImg = document.getElementById('groupImage');

  $fx(theImg).fxAdd(imgFadeIn).fxRun();
  $fx(plusImg).fxAdd(imgFadeIn).fxRun();
  $fx(groupImg).fxAdd(imgFadeIn).fxRun(containerFadeUp);  
}

function containerFadeUp() {
  var navMenu = document.getElementById('primaryNav').getElementsByTagName('ul')[0];
  var animCont = document.getElementById('animationContainer');
  var containerFadeIn = {type: 'opacity', from:60, to: 100, step: 3, delay:80};
  $fx(animCont).fxAdd(containerFadeIn).fxRun();
  $fx(navMenu).fxAdd(imgFadeIn).fxRun(); //(pageJump);  
}

function pageJump()
{
  document.location = "/Film.aspx";
}

if ( window.attachEvent ) {
    window.attachEvent( 'onload', homePageAnim );
} else {
    window.addEventListener( 'load', homePageAnim, false );
}
