// Variable for Camborne Snow and archive pics.
var i, imgs, pic, j, jmgs, pjc;

// Rotation for Camborne Snow pics.
function rotate()
{
  pic.src = imgs[i] ;
  (i === (imgs.length -1) ) ? i=0 : i++ ;
  setTimeout( rotate, 7000 ); 
}

// Rotation for Archive pics.
function rotatej()
{
  pjc.src = jmgs[j] ;
  (j === (jmgs.length -1) ) ? j=0 : j++ ;
  setTimeout( rotate, 7000 ); 
}

// Main Function block.
function footy()
{
// Header details.  
  document.getElementById("footerbit").innerHTML="This is the Website of the Camborne-Redruth Circuit. The Camborne-Redruth Circuit was created in September 2009 when the Redruth Circuit and the Camborne Circuit joined to form the new Circuit. The Circuit is part of the Cornish Methodist District and part of the Methodist Church in Great Britain. The Circuit consists of 17 chapels: Barripper, Beacon, Brea, Bridge, Carn Brea, Centenary, Four Lanes, Illogan Highway, Kehelland, Mawla, Paynters Lane End, Pool, Porthtowan, Redruth Methodist Church, Troon, Wall and Wesley. Copyright © 2009-2010 Camborne-Redruth Circuit";


// Camborne snow rotation bit.
  pic = document.getElementById("pic");
 
  imgs = [ "http://www.camborne-redruth.org/images/CentFlowerFestival2010/cent2010flower02.jpg", "http://www.camborne-redruth.org/images/CentFlowerFestival2010/cent2010flower03.jpg", "http://www.camborne-redruth.org/images/CentFlowerFestival2010/cent2010flower06.jpg", "http://www.camborne-redruth.org/images/CentFlowerFestival2010/cent2010flower09.jpg", "http://www.camborne-redruth.org/images/CentFlowerFestival2010/cent2010flower22.jpg", "http://www.camborne-redruth.org/images/CentFlowerFestival2010/cent2010flower26.jpg", "http://www.camborne-redruth.org/images/CentFlowerFestival2010/cent2010flower27.jpg" ] ;

  var preload= new Array();
  for( i=0; i< imgs.length; i++ )
  {
    preload[ i ] = new Image();
    preload[ i ].src = imgs[ i ];
  }

  i=0;

  rotate();

// Camborne snow rotation bit.
  pjc = document.getElementById("pjc");
 
  jmgs = [ "http://www.camborne-redruth.org/archive/images/img001_thumb.jpg", "http://www.camborne-redruth.org/archive/images/img002_thumb.jpg", "http://www.camborne-redruth.org/images/archive/img003_thumb.jpg", "http://www.camborne-redruth.org/archive/images/img004_thumb.jpg", "http://www.camborne-redruth.org/archive/images/img005_thumb.jpg" ] ;

  var preloadj= new Array();
  for( j=0; j< jmgs.length; j++ )
  {
    preloadj[ j ] = new Image();
    preloadj[ j ].src = jmgs[ j ];
  }

  j=0;

  rotatej();

}

onload=footy;
