isf2Arr=[

["fileadmin/images_sng/hauptseiten_images/titel_motorboote.jpg"],
["fileadmin/images_sng/hauptseiten_images/titel_seefahrten.jpg"],
["fileadmin/images_sng/hauptseiten_images/titel_yachtcharter1.jpg"]
//["pic4.jpg","page4.htm"],
//["pic5.jpg","page5.htm"] // no comma at the end of the last index

]

pause = 5 // seconds
fadeSpeed = 3

opac1=100
opac2=0
nextPic=2
nextLink=0
running=0

function initISF2(){

for(var i=0;i<2;i++){
newImg=document.createElement("IMG")
newImg.setAttribute("id","opic"+(i+1))
newImg.setAttribute("src",isf2Arr[i][0])
document.getElementById("isf2images").appendChild(newImg)
}

elOpic1=document.getElementById("opic1")
elOpic2=document.getElementById("opic2")
lnkLoc=isf2Arr[nextLink][1]
document.getElementById("isf2images").onclick=function(){isf2Link()}
document.getElementById("isf2images").style.cursor="pointer"

setTimeout("fadeISF2()",pause*1000)
}

function fadeISF2(){
running=1

opac1 -= fadeSpeed
opac2 += fadeSpeed

if("filters" in document.body && "alpha" in document.body.filters){
elOpic1.filters.alpha.opacity=opac1
elOpic2.filters.alpha.opacity=opac2
}
else{
elOpic1.style.opacity=(opac1/100)-0.001
elOpic2.style.opacity=(opac2/100)-0.001
}

if(opac1<=0||opac2<=0){

if(opac1<=0){elOpic1.src=isf2Arr[nextPic][0]}
else{elOpic2.src=isf2Arr[nextPic][0]}

nextPic++
if(nextPic==isf2Arr.length){nextPic=0}

nextLink++
if(nextLink==isf2Arr.length){nextLink=0}

fadeSpeed= -fadeSpeed

running=0
}

if(opac1>=100||opac2>=100){
lnkLoc=isf2Arr[nextLink][1]
}

if(running==0){
setTimeout("fadeISF2()",pause*1000)
}
else{
setTimeout("fadeISF2()",50)
}
}