function aanbieding_fadeshow(slides){
var curimageindex=0;
var nextimageindex=1;
next_image(1);
}

function next_image(i){
		if(!this.mouseover) this.mouseover = 0;
		var div = document.getElementById("aanbieding_slider");
		var totaal = aanbieding_slider.length;
		var image = this;
		if(i == totaal) i = 0;
		
		div.onmouseover	=function()	{image.mouseover = 1;}
		div.onmouseout	=function()	{
																	image.mouseover = 0;
																}
	
		if (!this.mouseover) {
				opacity('aanbieding_slider', 100, 0, 500);
				setTimeout("change_content(" + i + "); opacity('aanbieding_slider', 0, 100, 500)",600);
		}
		i++;
		setTimeout("next_image("+i+")", 5000);
}

function change_content(i){
var div = document.getElementById("aanbieding_slider");
div.innerHTML = aanbieding_slider[i];
}

function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 

//change the opacity for different browsers 
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 + ")"; 
}