﻿<!--

var bodyBackground = new Image();
bodyBackground.src = '/NR/rdonlyres/92A79693-85BB-4277-83D6-39C8F9B47574/0/nescafe_background.jpg';

var timedPages = new Array();
timedPages[0] = 'pur_espresso';
timedPages[1] = 'pur_gold';
timedPages[2] = 'pur_classic';
timedPages[3] = 'greenblend';
timedPages[4] = 'crema';

timedPages[5] = 'cappuccino_cremig';
timedPages[6] = 'cappuccino_xpress';
timedPages[7] = 'cappuccino_cafeauchocolat';
timedPages[8] = 'cappuccino_choco';
timedPages[9] = 'cappuccino_frappe';

//timedPages[8] = 'pads';

var activeIndex = -1;
function stopTimer() {
	timerStopped = true;
	if( activeIndex >= 0) {
		swapImage(timedPages[activeIndex], menuImages[activeIndex][1].src, menuImages[activeIndex][0].src);
		activeIndex = -1;
	}
}

function startTimer() {
    timerSwitch( -1);
}

function timerSwitch( curIndex) {
	if( timerStopped == true) return;
  if( activeIndex >= 0) {
    swapImage(timedPages[activeIndex], menuImages[activeIndex][1].src, menuImages[activeIndex][0].src);
  }
  nextIndex = curIndex + 1;
  if( nextIndex > timedPages.length -1) {
    nextIndex = 0;
  }
  swapImage(timedPages[nextIndex], menuImages[nextIndex][0].src, menuImages[nextIndex][1].src);
  switchPage( timedPages[nextIndex]);
  activeIndex = nextIndex;
  window.setTimeout("timerSwitch(" + nextIndex + ")", 3000);
}

// -->


