// JavaScript Document

function rollon(imgId, type, divId){
	clearTimeout(document.getElementById(divId).myTimer);
	var filetype = "circle_over.jpg";
	if(type == "arrow"){
		filetype = "arrow_over.gif";
	}
	document.getElementById(imgId).src = '../../images/'+filetype;
	document.getElementById(divId).style.display = 'block';
	document.getElementById(divId).style.zIndex = 10;
}

function rollout(imgId, type, divId){
	var filetype = "circle.jpg";
	if(type == "arrow"){
		filetype = "arrow.gif";
	}
	document.getElementById(imgId).src = '../../images/'+filetype;
	document.getElementById(divId).myTimer = setTimeout("clearTime('"+divId+"')", 750); 
	document.getElementById(divId).style.zIndex = 1;
}

function clearTime(divId){
	document.getElementById(divId).style.display = 'none';
	clearTimeout(document.getElementById(divId).myTimer);
}

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 2000

// Duration of crossfade (seconds)
var crossFadeDuration = 3

// Specify the image files
var Pic = new Array()

Pic[0] = '../../images/headers/home1.jpg'
Pic[1] = '../../images/headers/home2.jpg'
Pic[2] = '../../images/headers/home3.jpg'
Pic[3] = '../../images/headers/home4.jpg'
Pic[4] = '../../images/headers/home5.jpg'


var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

function runSlideShow(){
   if (j == 1) slideShowSpeed = 5000;
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=3)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}
