// JavaScript Document
// voor menu

sfHover = function() {
	var sfEls = document.getElementById("menu").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
// start het afspelen
function start_film(film,breedte,hoogte) {
	var tmp = null;
	if (AC_FL_RunContent == 0) {
		tmp = "This page requires AC_RunActiveContent.js.";
	} else {
		tmp = AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', breedte,
			'height', hoogte + 25,
			'src', 'video/jcplayer',
			'quality', 'high',
			'pluginspage', '',
			'align', 'middle',
			'play', 'true',
			'loop', 'false',
			'scale', 'noScale',
			'wmode', 'transparent',
			'devicefont', 'false',
			'id', 'jcplayer',
			'bgcolor', '#000000',
			'name', 'jcplayer',
			'menu', 'true',
			'allowFullScreen', 'false',
			'allowScriptAccess','sameDomain',
			'FlashVars','videoURL=' + film + '&fullScreenButton=false&autoHide=true&autoPlay=true&inkColor=0xffffff&highlightColor=0x999999&backgroundColor1=#000000&backgroundColor2=#000000&&bufferTime=10',
			'movie', 'video/jcplayer',
			'salign','TL'
			); //end AC code	
	}
	document.getElementById('filmzone').innerHTML = tmp;
}
//voor menu: dummy link//
function nolink () {
	return;
}
/*homepage*/
function lees_meer() {
	document.getElementById('lees').style.display = "none";
	document.getElementById('meer').style.display = "inline";
}
function lees_meer_alt() {
	document.getElementById('lees').style.display = "none";
	document.getElementById('meer').style.display = "inline";
	thuis.infLoopStop = true;
	thuis.foto.style.display = "none";
}
/*slides (update sept 11)*/
var thuis = new Array();
function slides(bestand,aantal,start,timing) {	
    thuis["infLoopStop"] = false;
    thuis["infLoop"] = null;
	thuis["nummer"] = start;
	thuis["maxi"] = aantal;
    thuis["bestand"] = bestand;
    thuis["timing"] = timing;
    thuis["foto"] = document.getElementById("slides");
    thuis["cache"] = document.getElementById("slides_cache");
    thuis["timeout"] = null;
    thuis.foto.innerHTML = '';
	if (thuis.nummer == 0) thuis.nummer = Math.floor(Math.random()*aantal +1);
    if (thuis["maxi"] > 1) {
        thuis.cache.style.backgroundImage ="url(images/slides/" + thuis.bestand + "_" + thuis.nummer + ".jpg)";
        infLoop();
    }
    else {
        thuis.foto.style.backgroundImage ="url(images/slides/" + thuis.bestand + "_1.jpg)";
    }
 }

infLoop=function(){
    thuis.foto.style.backgroundImage = thuis.cache.style.backgroundImage;
    thuis.nummer += 1;
    if (thuis.nummer > thuis.maxi) {thuis.nummer = 1;}
    thuis.cache.style.backgroundImage ="url(images/slides/" + thuis.bestand + "_" + thuis.nummer + ".jpg)";
    if(!thuis.infLoopStop) thuis.timeout = window.setTimeout(infLoop,thuis["timing"]); /*4000 = aantal ms interval*/
};
function fotoStop() {
    thuis.infLoopStop = true;
    window.clearTimeout(thuis.timeout); thuis.infLoop = null; 
    document.getElementById("slides").style.backgroundImage = 'none';
    document.getElementById("cache").style.backgroundImage = 'none';
}
