// Set slideShowSpeed (milliseconds) var slideShowSpeed = 7000; // Duration of crossfade (seconds) var crossFadeDuration = 10; //var relpath = document.images.imgHeaderSlideShow.src //relpath = relpath.substring(0, relpath.lastIndexOf("/")) // Specify the image files var Pic = new Array(); // to add more images, just continue // the pattern, adding to the array below //Pic[0] = 'images_new/header/header_text_1Y.gif' //Pic[1] = 'images_new/header/header_text_1B.gif' //Pic[2] = 'images_new/header/header_text_2B.gif' //Pic[3] = 'images_new/header/header_text_2Y.gif' //Pic[4] = 'images_new/header/header_text_3Y.gif' //Pic[5] = 'images_new/header/header_text_3B.gif' //Pic[3] = '4.jpg' //add image here //Pic[4] = '5.jpg' //add image here var init = false; var transitioning = false; var h = 50; var top= 25; var t; var j = 0; var p = 0; //var p = Pic.length; //var preLoad = new Array(); //for (i = 0; i < p; i++) { // preLoad[i] = new Image(); // preLoad[i].src = Pic[i]; //} function initImagePaths(){ var relpath = document.images.imgHeaderSlideShow.src relpath = relpath.substring(0, relpath.lastIndexOf("/")) // to add more images, just continue // the pattern, adding to the array below Pic [0] = new Image(); Pic [1] = new Image(); Pic [2] = new Image(); Pic [3] = new Image(); Pic [4] = new Image(); Pic [5] = new Image(); Pic [0].src = relpath + '/header_text_1Y.gif' Pic [1].src = relpath + '/header_text_1B.gif' Pic [2].src = relpath + '/header_text_2B.gif' Pic [3].src = relpath + '/header_text_2Y.gif' Pic [4].src = relpath + '/header_text_3Y.gif' Pic [5].src = relpath + '/header_text_3B.gif' //Pic[3] = '4.jpg' //add image here //Pic[4] = '5.jpg' //add image here p = Pic.length; } function runSlideShow() { if(init == false){ initImagePaths(); init = true; } if (document.all) { document.images.imgHeaderSlideShow.style.filter="blendTrans(duration=crossFadeDuration)"; document.images.imgHeaderSlideShow.filters.blendTrans.Apply(); } document.images.imgHeaderSlideShow.src = Pic[j].src; if (document.all) { document.images.imgHeaderSlideShow.filters.blendTrans.Play(); } j = j + 1; if (j > (p - 1)) j = 0; t = setTimeout('runSlideShow()', slideShowSpeed); } /*function runSlideShow() { transitioning = true; h=50; top=25; FadeToBig(); h=125; top=0; FadeToSmall(); if (transitioning ){ WaitTillTransitionComplete(); } else{ //restart runSlideShow(); } setTimeout('runSlideShow()', slideShowSpeed); }*/ function FadeToBig(){ document.getElementById("divHeaderSlideShow").style.top = top; document.getElementById("divHeaderSlideShow").style.height = h; document.images.imgHeaderSlideShow.height = h; top = top-1; h = h+2; if ((h < 125)&&(top > 0)) { setTimeout('FadeToBig()', 150); } else{ //TransitionImage(); h=125; top=0; } } function TransitionImage(){ if (document.all) { document.images.imgHeaderSlideShow.style.filter="blendTrans(duration=crossFadeDuration)"; document.images.imgHeaderSlideShow.filters.blendTrans.Apply(); } document.images.imgHeaderSlideShow.src = preLoad[j].src; if (document.all) { document.images.imgHeaderSlideShow.filters.blendTrans.Play(); } //Setup next image j = j + 1; if (j > (p - 1)) j = 0; //t = setTimeout('TransitionImage()', 250); } function FadeToSmall(){ document.getElementById("divHeaderSlideShow").style.top = top; document.getElementById("divHeaderSlideShow").style.height = h; document.images.imgHeaderSlideShow.height = h; top = top+1; h = h-2; if ((h > 50)&&(top <25)) { setTimeout('FadeToSmall()', 150); } else{ transitioning = false; h=50; top=25; } } function WaitTillTransitionComplete(){ if (transitioning){ setTimeout('CheckIfTransitioning()', 1000); } else{ //restart runSlideShow(); } } function CheckIfTransitioning(){ WaitTillTransitionComplete(); }