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

  if(browser.isIE){
    animateWaiting();		
  }
  document.body.style.background="transparent url("+backgroundImage+") repeat-x top left";
  Element.addClassName( "interstitialContainerEmbedded", "interstitialShow" );
  if ($("interstitialMessage")){
    $("interstitialCancel").onclick = function(){/* use cancel button not back button */
	location.reload(true);
	return false; 
    }
  }
}
//}

/* 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>9) {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';
   $('progressBar'+counter).style.display = 'block';
   counter++;
   setTimeout('animateWaiting()',180);
}