var flag=false;
var fadeInOpacity=0;
var picture=0;
var crossFadeDuration = 1;
var j = 1;
var p = Pic.length;
var preLoad = [];
for (i = 0; i < p; i++) {
preLoad[i] = new Image();
preLoad[i].src = Pic[i];
}
var ie=false;
if(document.all){
 ie=true
}
function runSlideShow() {
 var pbg;
 picture=document.images.SlideShow;
 if((!ie)&&(flag)){
  pbg=j-1;
  if(j==0){pbg=(p-1);}
  document.getElementById('bg').style.background="url("+preLoad[pbg].src+") 3px 3px no-repeat";
 }
if (ie) {
picture.style.filter="blendTrans(duration=2)";
picture.style.filter="blendTrans(duration=crossFadeDuration)";
picture.filters.blendTrans.Apply();
}
if(flag){
  if(!ie){picture.style.opacity="0";}
  picture.src=preLoad[j].src;
  document.getElementById('scapt').innerHTML = capt[j];
  document.getElementById('scapt2').innerHTML = capt2[j];

}
if (ie) {
picture.filters.blendTrans.Play();
}
j = j + 1;
if (j > (p - 1)) j = 0;
setTimeout(runSlideShow, 6000);
}

function opacMoz(){
 if(!ie){
  if ((fadeInOpacity<1)&&(flag)){
    fadeInOpacity = fadeInOpacity + .02;
    picture.style.opacity = fadeInOpacity;
    setTimeout(opacMoz, 50);
  }
 }
 flag=true;
}







