function startSlideshow(path, numimgs, numslots, timer, rnd, start){  if (start==0) var firstimg = 1 + Math.floor(Math.random()*numimgs);   // random first image      else var firstimg = start;       // we use base 0 for our slot calculations  var delay = timer + ( Math.random()*rnd)- (rnd/2)  // random length of time if rnd is non-zero  window.setTimeout('cueNextSlide("'+path+'",'+firstimg+','+numimgs+',0,'+numslots+','+timer+','+rnd+')', delay*1000);}function cueNextSlide(path, imgno, numimgs, slotno, numslots, timer, rnd){  if (slotno >= numslots) { toback=false; } else { toback=true;  }  nextimg = (imgno % numimgs) + 1;  nextimgforthisslot = ((imgno+numslots)%numimgs)+1  nextslot = (slotno+1)%(numslots*2);  thisslot = (slotno%numslots)+1;  var frontId = path+'-sl'+thisslot+'front';  var backId = path+'-sl'+thisslot+'back';  var delay = timer + ( Math.random()*rnd)- (rnd/2);  // random length of time if rnd is non-zero  if (toback) {     window.setTimeout('changeimg("front","'+path+'","'+thisslot+'","'+nextimgforthisslot+'")', delay*750);     fade(backId,0.8, 'in');     fade(frontId, 0.8, 'out');  }  else  {     window.setTimeout('changeimg("back","'+path+'","'+thisslot+'","'+nextimgforthisslot+'")', delay*750);     fade(frontId,0.8,'in');     fade(backId,0.8,'out');  }  window.setTimeout('cueNextSlide("'+path+'",'+nextimg+','+numimgs+','+nextslot+','+numslots+','+timer+','+rnd+')', delay*1000);}function changeimg(layer, path, thisslot, imgno){  var chgimgId = path+'-sl'+thisslot+layer;  chgimg = document.getElementById(chgimgId);  chgimg.src="images/"+path+"/"+imgno+".jpg";}function fade(img, time, dir){  img = document.getElementById(img);  var steps=time*10;  if (typeof img.style.opacity != 'undefined')  {    var otype='w3c';  }  else if (typeof img.style.MozOpacity != 'undefined')  {    var otype='moz';  }  else if (typeof img.style.MKhtmlOpacity != 'undefined')  {    var otype='khtml';  }  else if (typeof img.filters =='object')  {    otype = (img.filters.length >0      && typeof img.filters.alpha == 'object'      && typeof img.filters.alpha.opacity == 'number')      ? 'ie' : 'none';  }  else { otype = 'none';}  if (otype != 'none')  {    if (dir == 'out') { dofade(steps,img,1,false,otype);}    else { dofade(steps, img, 0, true, otype); }  }}function dofade(steps, img, value, targetvisibility, otype){  value += (targetvisibility ? 1 : -1) / steps;  if (targetvisibility ? value >1 : value <0)    value = targetvisibility ? 1:0;  setfade(img,value,otype);  if (targetvisibility ? value <1 : value >0)  {    setTimeout(function()    {      dofade(steps, img, value, targetvisibility, otype);    }, 100);  }}function setfade(img,value, otype){  switch(otype)  {    case 'ie':      img.filters.alpha.opacity = value * 100;      break;    case 'khtml':      img.style.KhtmlOpacity = value;      break;    case 'moz':      img.style.MozOpacity = (value==1?0.9999999 : value);      break;    default:      img.style.opacity = (value == 1?0.9999999 : value);  }}