theimg = document.getElementById('photo'); var img = new Array(); img[2] = new Image(); img[2].src = 'gall1/im01.jpg'; img[3] = new Image(); img[3].src = 'gall1/im02.jpg'; img[4] = new Image(); img[4].src = 'gall1/im03.jpg'; marker = 'gall1/im01.jpg'; function nextimg(){ if(marker=='gall1/im01.jpg'){ marker = 'gall1/im02.jpg'; theimg.src = marker; fadeup(); } else{ if(marker=='gall1/im02.jpg'){ marker = 'gall1/im03.jpg'; theimg.src = marker; fadeup(); } else{ if(marker=='gall1/im03.jpg'){ marker = 'gall1/im01.jpg'; theimg.src = marker; fadeup(); } } } } counter = 100; function fadeup(){ counter++; newop = counter/100; theimg.style.opacity = newop; ieop = 'alpha(opacity=' + counter + ')'; theimg.style.filter = ieop; if(counter<100){ t = setTimeout('fadeup()',15); } else{ t = setTimeout('fadedown()',6500); } } function fadedown(){ counter--; newop = counter/100; theimg.style.opacity = newop; ieop = 'alpha(opacity=' + counter + ')'; theimg.style.filter = ieop; if(counter>0){ t = setTimeout('fadedown()',15); } else{ nextimg(); } } t = setTimeout('fadedown()',6500);