var t;  
var numPix = 10   ;  	 
var slideShowSpeed =4000;// milliseconds 
var crossFadeDuration = 20; 	 

if (!document.all) {
function opacity(id) { 
 var timer = 0;  
 for(i = 0; i <= 100; i++) { 
 setTimeout("changeOpac(" + i + ",'" + id + "')", (timer * crossFadeDuration) ); 
 timer++;} 
 } 
  
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
}
} // eo if (!document.all) 
 

var preLoad = new Array();
for (i = 1; i <= numPix ; i++) {
preLoad[i] = new Image();
preLoad[i].src = "rnd/"+i+".jpg"; 
} 
function runSlideShow() {

newBg = "url(./rnd/" + pixx + ".jpg)";
document.getElementById('homePic').style.backgroundImage = newBg;

pixx++;
if (pixx > numPix ) pixx = 1;

if (document.all) {
document.getElementById('homePageImage').style.filter="blendTrans(duration=2)";
document.getElementById('homePageImage').style.filter="blendTrans(duration=crossFadeDuration)";
document.getElementById('homePageImage').filters.blendTrans.Apply();
document.getElementById('homePageImage').src = preLoad[pixx].src;
document.getElementById('homePageImage').filters.blendTrans.Play();
} 
if (!document.all) {
if (pixx > numPix ) pixx = 1;
document.getElementById('homePageImage').src = preLoad[pixx].src;
document.getElementById('homePageImage').style.MozOpacity = 0;
opacity('homePageImage'  ); // FF etc 
} 

t = setTimeout('runSlideShow()', slideShowSpeed);
} 