I have some code that seems to work fine for changing the bg of a div. However, I was wondering if there was a way to make it fade is instead of just change. Don't know javascript that well. Here is the code:

<script>
var bgimage=new Array()
bgimage[0]="<?php bloginfo('template_directory'); ?>/images/wrapper-bg1.jpg"
bgimage[1]="<?php bloginfo('template_directory'); ?>/images/wrapper-bg2.jpg"
bgimage[2]="<?php bloginfo('template_directory'); ?>/images/wrapper-bg3.jpg"
bgimage[3]="<?php bloginfo('template_directory'); ?>/images/wrapper-bg.jpg"

var abc=-1

function t(){
if (abc<bgimage.length-1)
abc++
else
abc=0
document.getElementById("wrapper").style.background = 'url("'+bgimage[abc]+'")';
document.getElementById("wrapper").style.backgroundRepeat = "no-repeat";
document.getElementById("wrapper").style.backgroundColor = "#E3E3C6";
}

window.onload = load;

function load()
{
setInterval("t()",6000); //change every 4 seconds, can be changed.
}
</script>