// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 1750
// Duration of crossfade (seconds)
var crossFadeDuration = 2
// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below
for (i=1; i<50; i++){
	if (i<10){
	i='0'+i;
	}
	Pic[(i-1)] = 'assets/gallery_pics/'+i+'_construction.jpg'
}

var t
var j = 0
var p = Pic.length
var runFunc = "play"
var preLoad = new Array()
function initSlideShow(){	
	for (i = 0; i < p; i++){
   		preLoad[i] = new Image()
   		preLoad[i].src = Pic[i]
	}
	document.all.stopBut.disabled=false;
	document.all.startBut.disabled=false;
	document.all.prevBut.disabled=false;
	document.all.nextBut.disabled=false;
	document.all.lastBut.disabled=false;
	document.images.SlideShow.alt="ECC Construction"
	runSlideShow();
}
function runSlideShow(){
   if (runFunc=="stop"){
   return;
   }
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      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);
}
function stepSlideShow(direction){
	j=(direction=="prev"?j-1:j+1);
	if (j>(p-1)){
		j=0;
	}else if (j<0){
		j=p-1;
	}
	document.images.SlideShow.src = preLoad[j].src;
}
MM_preloadImages('assets/gallery_pics/opening.jpg','assets/gallery_pics/inside.jpg','assets/gallery_pics/front_group1.jpg','assets/gallery_pics/front_group2.jpg','assets/gallery_pics/front_group3.jpg','assets/gallery_pics/front_chiefs.jpg','assets/gallery_pics/999_comp.jpg','assets/gallery_pics/fstone_chiefs.jpg','assets/gallery_pics/fstone_group1.jpg')
var sCaption = new Array();
sCaption [0] = "Joint services foundation stone laying. Neil Wright, Chief Fire Officer; Dennis Launder, Chief Exec Wilts Ambulanece NHS Trust; Dame Elizabeth Neville Ex Chief Constable Wilts"
sCaption [1] = "Joint Services foundation stone laying"
sCaption [2] = "David Newbiggins OBE, High Sheriff opening the EEC 06/06/03"
sCaption [3] = "Opening of EEC 03/06/03. David Newbiggins OBE, High Sheriff; Neil Wright, Chief Fire Officer; Dennis Launder, Chief Exec Wilts Ambulanece NHS Trust; Dame Elizabeth Neville Ex Chief Constable Wilts"
sCaption [4] = "EEC Operators (l-r) Tracy Dale, Ambulance; Carole Harris, Fire; Dee Scutter, Fire; Unknown, Fire; Tina Parham, Ambulance; David Newbiggins OBE, High Sheriff; Lyn Hooke, Ambulance"
sCaption [5] = "(l-r) A/ACC Andy Tatam; CI Nick Mitchell-Briggs; Roy Denning; Karl Blackshaw, NHS; MaxGater, Director of Finance, Ambulance; High Sheriff; Richard Claridge, Divisional Officer, Ambulance; Barbara Owen, HR, Fire; Phil Appleby, Deputy Fire Officer"
sCaption [6] = "(l-r) Dennis Launder, Chief Exec, Ambulance; Jackie Miller, Ambulance Trust; High Sheriff; Derek Dart, Fire Authority; Dawn Morrell; Bertie Woolnough, Police Authority; Dame Elizabeth Nevile Ex Chief Constable, Wilts"
sCaption [7] = "Family open day inside ECC"
sCaption [8] = "999 Joint Services Competition"

for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}
function photoViewer(photo, pwidth, pheight, pcaption){
	document.images.photo_viewer.height=pheight;
	document.images.photo_viewer.width=pwidth;
	document.images.photo_viewer.alt=sCaption[pcaption];
	document.all.captionTxt.innerHTML=sCaption[pcaption];
	document.images.photo_viewer.longdesc="hello mum fghfghrgjytrth"
	document.images.photo_viewer.src = 'assets/gallery_pics/'+photo+'.jpg';
}