var Picture = ['img1.jpg', 'img2.jpg', 'img3.jpg', 'img4.jpg', 'img5.jpg', 'img6.jpg', 'img6a.jpg', 'img7.jpg', 'c1.jpg', 'c2.jpg', 'c3.jpg', 'c4.jpg', 'c5.jpg', 'c6.jpg', 'c7.jpg', 'k1.jpg', 'k2.jpg', 'ki1.jpg', 'ki2.jpg', 'ki3.jpg', 'ki4.jpg', 'ki5.jpg', 'ki6.jpg', 'sh1.jpg', 'sh2.jpg', 'sh3.jpg', 'w1.jpg', 'w2.jpg', 'w3.jpg', 'w4.jpg', 'wl1.jpg', 'wl2.jpg' ];
var Caption = ['Ailing staircase', 'Rebuild new on site &amp; stained', 'Graffiti wall', 'Stain blocked &amp; re-painted', 'Ailing side fence.', 'Renewed and stained', 'Old gate falling apart', 'New gate made to measure &amp; fitted', 'Original patio layout', 'Joists go in', 'Walls being built', 'Structure going up', 'Flooring - Electrics &amp; plumbing going in', 'Base wall rendered', 'Glazed and completed', 'Original wall with no units', 'New units in place', 'New kitchen layout', 'Altering electrics', 'New Kitchen', 'Tiling and Lighting', 'New Kitchen', 'New Kitchen', 'Shed Construction framework', 'Construction underway', 'Happy owners', 'Ailing front garden wall', 'Rendering taking place', 'Front and back rendered', 'Finished awaiting painting', 'Windoes pre preparation', 'Painted and finished' ]


var ie = ((navigator.userAgent.indexOf("5.5") > 0 || navigator.userAgent.indexOf("6.") > 0) && document.all);
if(navigator.userAgent.toLowerCase().indexOf("opera") != -1){
	ie = false;
}
var SlideShowSpeed = 4000;
var CrossFadeDuration = 5;
var t, i, j = 0, p = Picture.length-1;


var preLoad = new Array();
for (i = 0; i < p+1; i++){
preLoad[i] = new Image();
preLoad[i].src = "Images/Examples/" + Picture[i];}

function runSlideShow(){
	var d = document.getElementById('caption');
	if (ie){
		document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
		document.images.PictureBox.filters.blendTrans.Apply();
	}
	document.images.PictureBox.src = preLoad[j].src;
	d.innerHTML = Caption[j];
	if (ie) document.images.PictureBox.filters.blendTrans.Play();
	j++;
	if (j > p) j=0;
	t = setTimeout('runSlideShow()', SlideShowSpeed);
}

window.onload = runSlideShow;