// CONFIGURATION ----------------------------------------------------------
// Set these variables appropriate to your page
// ------------------------------------------------------------------------

// how long to wait between each rotation
var delay   = 5000;      // 5 seconds

// the header banners to display
var headers = new Array("images/rotateheader.gif",
                        "images/Prudentialbanner.gif",
                        "images/PFCbanner.gif");

// the button names that match the headers above
var buttons = new Array("PPM",
                        "PCR",
                        "PFC");

// the numeric button identifiers to tell us which images should be replaced
// we increment from the start to the end
var buttonStart = 401;   // G4 & G4M
var buttonEnd   = 424;  // G23 & G23


// DONT MESS WITH THIS ----------------------------------------------------
// ------------------------------------------------------------------------
var index     = 0;
var headerPos = 1;
var regex     = new RegExp(buttons.join("|"));
function rotateImage() {
   // switch the header graphic
   document.images[headerPos].src = headers[index];

   // now do the buttons
   for ( var i = buttonStart; i <= buttonEnd; i ++ ) {
      var normal   = eval("G" + i);
      var rollover = eval("G" + i + "M");
      var img      = eval("document.GP" + i);
      var n_src    = normal.src;
      var r_src    = rollover.src;

      n_src = n_src.replace(regex, buttons[index]);
      r_src = r_src.replace(regex, buttons[index]);

      normal.src   = n_src;
      rollover.src = r_src;
      img.src      = n_src;
   }

   index = ++index % headers.length;

   setTimeout("rotateImage()", delay);
}