id_verhaal_current = 0;
id_dia = -1;
id_verhaal_carrousel = [];
dia_timeout = 0;

function verhaalOnMouseover (id) {
	if (id_dia >= 0) {
		clearTimeout (dia_timeout);
		setDisplay ("IMG_verhaal_"+id_verhaal_carrousel[id_dia], 0);
	}
	if (id_verhaal_current) setDisplay ("IMG_verhaal_"+id_verhaal_current, 0);
	id_verhaal_current = id;
	if (id_verhaal_current) setDisplay ("IMG_verhaal_"+id_verhaal_current, 1);
}

function verhaalOnMouseout () {
	if (id_verhaal_current) setDisplay ("IMG_verhaal_"+id_verhaal_current, 0);
	id_verhaal_current = 0;
	if (id_verhaal_carrousel.length > 3) startDiavoorstelling ();
}

function diavoorstelling () {
	setDisplay ("IMG_verhaal_"+id_verhaal_carrousel[id_dia], 0);
	id_dia = (id_dia + 1) % id_verhaal_carrousel.length;
	setDisplay ("IMG_verhaal_"+id_verhaal_carrousel[id_dia], 1);
	dia_timeout = setTimeout ('diavoorstelling ()', 4000);
}

function startDiavoorstelling () {
	if (id_dia < 0) id_dia = 0;
	setDisplay ("IMG_verhaal_"+id_verhaal_carrousel[id_dia], 1);
	clearTimeout (dia_timeout);
	dia_timeout = setTimeout ('diavoorstelling ()', 4000);
}

function imagemapOnClick (src, width, height, left, top) {
	setInnerHtml ("DIV_overlay", "<img src=\""+src+"\" width=\""+width+"\" height=\""+height+"\" border=\"0\" alt=\"\" class=\"foto\" onclick=\"overlayOnClick ();\">");
	setPosition ("DIV_overlay", left, top);
	setWidth ("DIV_overlay", width + 16);
	setHeight ("DIV_overlay", height + 16);
	setDisplay ("DIV_overlay", 1);
	setPosition ("IMG_overlayschaduw", left + 6, top + 6);
	setWidth ("IMG_overlayschaduw", width + 16);
	setHeight ("IMG_overlayschaduw", height + 16);
	setDisplay ("IMG_overlayschaduw", 1);
}
function overlayOnClick () {
	setDisplay ("DIV_overlay", 0);
	setDisplay ("IMG_overlayschaduw", 0);
}

function bodyOnLoad () {
	if (id_verhaal_carrousel.length > 3) startDiavoorstelling ();
}