var slidetiming = 5000;
var imageptr = 1;

function load () {
  getstartpoint();
	runslideshow();
}

function getstartpoint() {
var i = 0;
var j;
  i = Math.random();
	imageptr = Math.ceil(i * imagecount);
}

function runslideshow(){
  if (document.all){
    document.images.currentimg.style.filter="blendTrans(duration=1.0)"; /* CrossFadeDuration */
    document.images.currentimg.filters.blendTrans.Apply();
  }
  document.images.currentimg.src = imgfile[imageptr];
	document.images.currentimg.alt = imgfile[imageptr];
/* if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[imageptr];*/
  if (document.all) document.images.currentimg.filters.blendTrans.Play();
  imageptr = imageptr + 1;
  if (imageptr >= imagecount) imageptr=1;
  wait = setTimeout('runslideshow()', slidetiming);
}

function opencontactwindow() {
var url = 'pages/contactus.html';
  mywin = window.open(url,"contactus",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=650,height=560,top=200,left=200');
}
