﻿
// ####   John LeFave 10/2009

var bannerImg = new Array();
var ie5=(document.getElementById && document.all);
var ns6=(document.getElementById && !document.all);
var totalBan;


function loadImages()
{
  // Enter the names of the images below
  bannerImg[0]="imageRotation/images/Southbridge.jpg";
  bannerImg[1]="imageRotation/images/4067_welcome_photo.jpg";
  bannerImg[2]="imageRotation/images/click_it.jpg";
  bannerImg[3]="imageRotation/images/dentistry.jpg";
  bannerImg[4]="imageRotation/images/library_lights.jpg";
  bannerImg[5]="imageRotation/images/4066_admissions_photo.jpg";
  bannerImg[6]="imageRotation/images/QCC05.jpg";
  bannerImg[7]="imageRotation/images/students2.jpg";
  bannerImg[8]="imageRotation/images/tang1.jpg";
  bannerImg[9]="imageRotation/images/TLC-patio.jpg";
  bannerImg[10]="imageRotation/images/qcc.jpg";
  totalBan = bannerImg.length;
}


var stepsUp; // How many stepsUp would you like for fading?. Max is 100, min is 1.
var gapsUp;	// How long would you like the delay between each frame (in 1/1000 ths of a second)? Min is 1, max should be no more than 10000 (10 seconds).
var n;
var m;
function fadeIn()
{
m=Math.round(n/stepsUp*100);

if(ie5)
{
document.getElementById("banner").style.filter="alpha(opacity="+m+")";
}

if(ns6)
{
document.getElementById("banner").style.opacity= m/100;
}
n++;

if(n<=stepsUp)
{
setTimeout("fadeIn()",gapsUp);
}
}
//  ###########################

var newBanner = 0;

function cycleBan() 
{
 newBanner++;
  if (newBanner == totalBan) {
    newBanner = 0;
  }
  document.banner.src=bannerImg[newBanner];
  n = 0;
  m = 0;
  stepsUp=30;
  gapsUp=20;
  fadeIn();
  // set the time below for length of image display
  // i.e., "4*1000" is 4 seconds
  setTimeout("cycleBan()", 6*1000);
}

// ##  Blinking Text
var speed = 800;
var x = 0;
var color = new initArray("#000", "#F00");

function initArray()
{
	this.length = initArray.arguments.length;
	for (var i = 0; i < this.length; i++) 
	{
		this[i] = initArray.arguments[i];
 	}
}

//function chcolor(blinker){ 
//if (navigator.appVersion.indexOf("MSIE") != -1)
//{
//document.all.blinker.style.color = color[x];
//}
//(x < color.length-1) ? x++ : x = 0;
//}
//setInterval("chcolor()",speed);


