/* Interstitial page display function use with Prototype called as last function in the onsubmit or onclick*/
function interstitial()
{
  $("PageContainer").style.display="none";

  if(browser.isIE)
  {
    animateWaiting();
  }

  var backgroundImage = '/images/body/backgrounds/background.jpg';

  document.body.style.background="transparent url("+backgroundImage+") repeat-x top left";

  var interstitialContainerEmbedded = $('interstitialContainerEmbedded');

  if( interstitialContainerEmbedded )
  {
    interstitialContainerEmbedded.style.display = 'block';
  }
}

/* Interstitial page display function use with Prototype called as last function in the onsubmit or onclick*/
function interstitialAO()
{
  $("Page").style.display="none";

  if(browser.isIE)
  {
    animateWaiting();
  }

  /* Added the following behaviour instead since Prototype removeClassName and addClassName do not work consistently in IE
  as the CSS properties are not being picked up in IE. */

  var interstitialContainerEmbedded = $('interstitialContainerEmbedded');

  if( interstitialContainerEmbedded )
  {
    interstitialContainerEmbedded.style.display = 'block';
  }
}

/* An event and function for navigating back to the page via the Firefox back button. As FF caches pages and will not load them it requires the onpageshow event to reload the page and not display the interstitial instead. */
window.onpageshow = function (evt)
{
   if (evt.persisted)
   {
      location.reload(true);
   }
}
/* End of firefox back button fix */
/* End of Interstitial page display function */

var counter = 0;
function animateWaiting()
{
   if (counter>13) {counter = 0;}
   $('progressBar0').style.display = 'none';
   $('progressBar1').style.display = 'none';
   $('progressBar2').style.display = 'none';
   $('progressBar3').style.display = 'none';
   $('progressBar4').style.display = 'none';
   $('progressBar5').style.display = 'none';
   $('progressBar6').style.display = 'none';
   $('progressBar7').style.display = 'none';
   $('progressBar8').style.display = 'none';
   $('progressBar9').style.display = 'none';
   $('progressBar10').style.display = 'none';
   $('progressBar11').style.display = 'none';
   $('progressBar12').style.display = 'none';
   $('progressBar13').style.display = 'none';
   $('progressBar'+counter).style.display = 'block';
   counter++;
   setTimeout('animateWaiting()',180);
}