/* copyright etask.co.uk	Author: Saeed
   Content/Description: For slide-show animation of alternating pictures - each after 5 seconds (line ??) and fading-in in 10 milliseconds (line ??).
*/

var dump1 = 0;
var t = 0;

function lessSize() {
  if(dump1 >= 375) {
  dump1=0; }
	  if (document.all){
	    document.all[box].style.width = dump1+'px';
	  }
	  else {
		document.getElementById(box).style.width = dump1+'px';
		document.getElementById(box).style.width = dump1+'px';
	  }
	moreSize();
 	
}

function moreSize() {
  if (dump1 < 375){
  dump1 +=10;
    if (document.all){ 
     document.all[box].style.width = dump1+'px';
	  }
	 	else {
    document.getElementById(box).style.width = dump1+'px';
		document.getElementById(box).style.width = dump1+'px';
	  }

  t = setTimeout("moreSize()",10);
	}
}


var preLoad = new Array()

function preLoadPic(index)
{
	if (Pic[index] != ''){
		window.status='Loading : '+Pic[index]
		preLoad[index] = new Image()
		preLoad[index].src = Pic[index]
		Pic[index] = ''
		window.status=''
	}
}
// 
var slideShowSpeed = 7000


var t1

var p = Pic.length
var pos = (p-2)
var box = "slide1"
var j = 0

function runSlideShow(){
  //var rand = ((j+1)%2 ? 0 : 1) 
  //box = 'Slide'+rand
	document.images[box].src = preLoad[j].src
	document.getElementById('imgtext').innerHTML = PicText[j];
	
	j = j + 1
	if (j > (p-1)) j=0
	t1 = setTimeout('runSlideShow()', slideShowSpeed)
	preLoadPic(j)
	lessSize()
	//less()
}

function endSlideShow(){
clearTimeout(t)

}

function startSlideShow(){
t1 = setTimeout('runSlideShow()', slideShowSpeed)
preLoadPic(j)
}

startSlideShow()
