var slides= new Array('cabecera1', 'cabecera2','cabecera3','cabecera4');
var home_pictures=new Array();
var header_pictures=new Array();
var i = 0;
var j=0;



function HeaderSlide() {
    Effect.Fade(header_pictures[i], {
        duration:1,
        from:1.0,
        to:0.0
    });
    i++;
    if (i == header_pictures.length) i = 0;
    Effect.Appear(header_pictures[i], {
        duration:1,
        from:0.0,
        to:1.0
    });
}
function HomeSlide() {
    Effect.Fade(home_pictures[j], {
        duration:1,
        from:1.0,
        to:0.0,
        queue: {scope: 'fadeovers', position: 'end' }
    });
    j++;
    if (j == home_pictures.length) j = 0;
    Effect.Appear(home_pictures[j], {
        duration:1,
        from:0.0,
        to:1.0,
        queue: {scope: 'fadeovers', position: 'end' }
    });
}

// the onload event handler that starts the fading.
function start_headerslide(wait) {
    for(c=0;c<n;c++){
        header_pictures[c]="header"+(c+1)
    }
    setInterval('HeaderSlide()',wait);
}
function start_homeslide(n,wait) {
    for(c=0;c<n;c++){
        home_pictures[c]="home"+(c+1)
    }
    setInterval('HomeSlide()',wait);
}