(function(){
            var i=0, myimages=new Array()
            //specify random images below. You can have as many as you wish
            myimages[0]="images/header/1.jpg"
            myimages[1]="images/header/2.jpg"
            myimages[2]="images/header/3.jpg"
            myimages[3]="images/header/4.jpg"
            myimages[4]="images/header/5.jpg"
            myimages[5]="images/header/6.jpg"
            myimages[6]="images/header/7.jpg"
            myimages[7]="images/header/8.jpg"
            myimages[8]="images/header/9.jpg" 
            
            var change=function(){
            document.getElementById('header').style.backgroundImage="url("+document.getElementById('rand').src+")";
            fade('rand', 'out', 0, 150);
            setTimeout(function(){document.getElementById('rand').src=myimages[(i++<myimages.length-1? i : i=0)];},30);
            }
            
            myimages.sort(function() {return 0.5 - Math.random();});
            document.write('<div id="header"><img id="rand" onload="fade(this, \'in\', 100, 2, 30);" src="'+myimages[i++]+'" /></div>')
            setInterval(function(){change();}, 4000);
            })();
