var mPhotoCounter = 0; var mPhotoNumber = 12; var mPhotoFadeSpeed = 1000; var mPhotoCallSpeed = 1000; var mPhotoChangeSpeed = 5000; var mPhotoTimeout = null; var mPhotoInterval = null; var mScreenWidth = 1024; function jsSlideShow() { mScreenWidth = screen.availWidth; if(mScreenWidth <= 1024) mScreenWidth = 1024; if(mScreenWidth > 1024) mScreenWidth = 1280; if(mScreenWidth > 1280) mScreenWidth = 1440; preload(); } function preload() { window.clearTimeout(mPhotoTimeout); document.getElementById("foreground").style.background = "url(images/"+mScreenWidth+"_"+(mPhotoCounter % mPhotoNumber)+".jpg) repeat-x right top"; $("#foreground").fadeIn(1); mPhotoCounter++; $("#preloadbox").html("\"Stimmungsfoto"); window.clearInterval(mPhotoInterval); } function complete() { try { if(document.getElementById("slideimage_"+mPhotoCounter).complete == true) { window.clearInterval(mPhotoInterval); document.getElementById("background").style.background = "url(images/"+mScreenWidth+"_"+(mPhotoCounter % mPhotoNumber)+".jpg) repeat-x right top"; window.clearTimeout(mPhotoTimeout); mPhotoTimeout = window.setInterval("opacity()", mPhotoChangeSpeed); } } catch(e) { window.clearInterval(mPhotoInterval); } } function opacity() { window.clearTimeout(mPhotoTimeout); $("#foreground").fadeOut(mPhotoFadeSpeed); mPhotoTimeout = window.setInterval("preload()", mPhotoCallSpeed); }