function setBindings() {
	var as = document.getElementById("port").getElementsByTagName("DIV");
	
	for (var i = 0; i < as.length; i++) {
		if (as[i].className=="nix") {
			
			if (typeof as[i].addEventListener == 'function') {
				as[i].addEventListener('mouseover', function () {showEPHpicture(this)}, false);
				as[i].addEventListener('mouseout', function () {hideEPHpicture(this)}, false);
			} else {
				as[i].attachEvent('onmouseover', function () { showEPHpicture(event.srcElement.parentNode) });
				as[i].attachEvent('onmouseout', function () { hideEPHpicture(event.srcElement.parentNode) });
			}
			
			as[i].effect1 = "";
			as[i].effect2 = "";
		}
	}
}

function hideEPHpicture(obj) {	
	var divs = obj.parentNode.getElementsByTagName("div");
	
	for (var i = 0; i < divs.length; i++) {
		if (divs[i].className == "foto") {
			if (typeof obj.effect2.cancel == 'function') {
				obj.effect2.cancel();
			}
			
			var rand_no = Math.random();
			
			
			var xs = 0;
			var ys = 0;
			
			obj.effect1 = new Effect.Move(divs[i], {
				y: ys,
				x: xs,
				mode: 'absolute',
				duration: 0.5
			});
		}
	}
}

function showEPHpicture(obj) {
	
	var divs = obj.parentNode.getElementsByTagName("div");
		
	for (var i = 0; i < divs.length; i++) {
		if (divs[i].className == "foto") {
			if (typeof obj.effect1.cancel == 'function') {
				obj.effect1.cancel();
			}
			obj.effect2 = new Effect.Move(divs[i], {
				y: 170,
				x: 0,
				mode: 'absolute',
				duration: 0.5
			});
		}
	}
}

/* PROJECTEN achtergronden */

function proj0() {
	new Effect.Move('slider', { x: 0, y: 0, duration: 0, delay: 0.0, mode: 'absolute'});
}
function proj1() {
	new Effect.Move('slider', { x: 0, y: -170, duration: 0, delay: 0.0, mode: 'absolute'});
}
function proj2() {
	new Effect.Move('slider', { x: 0, y: -340, duration: 0, delay: 0.0, mode: 'absolute'});
}
function proj3() {
	new Effect.Move('slider', { x: 0, y: -510, duration: 0, delay: 0.0, mode: 'absolute'});
}
function proj4() {
	new Effect.Move('slider', { x: 0, y: -680, duration: 0, delay: 0.0, mode: 'absolute'});
}
function proj5() {
	new Effect.Move('slider', { x: 0, y: -850, duration: 0, delay: 0.0, mode: 'absolute'});
}
function proj6() {
	new Effect.Move('slider', { x: 0, y: -1020, duration: 0, delay: 0.0, mode: 'absolute'});
}


/* BUREAU PAGINAS HEADLINES FADE-IN */
function headlineShow() {
	new Effect.Appear('the-headline', { x: 0, y: -30, duration: 2, delay: 0.6, mode: 'relative'});
}

/* PROJECTEN HOME */
function link1Color() { document.getElementById('term1').style.color="#CB3024"; }
function link1ColorOff() { document.getElementById('term1').style.color="#ffffff"; }
function link2Color() { document.getElementById('term2').style.color="#CB3024"; }
function link2ColorOff() { document.getElementById('term2').style.color="#ffffff"; }
function link3Color() { document.getElementById('term3').style.color="#CB3024"; }
function link3ColorOff() { document.getElementById('term3').style.color="#ffffff"; }
function link4Color() { document.getElementById('term4').style.color="#CB3024"; }
function link4ColorOff() { document.getElementById('term4').style.color="#ffffff"; }
function link5Color() { document.getElementById('term5').style.color="#CB3024"; }
function link5ColorOff() { document.getElementById('term5').style.color="#ffffff"; }
function link6Color() { document.getElementById('term6').style.color="#CB3024"; }
function link6ColorOff() { document.getElementById('term6').style.color="#ffffff"; }

/* INIT FADES QUOTES */
var currentquote = 0;

function initpersonen() {
	setTimeout('initQuotes()', 1000);
}

/* QUOTES */
	
function initQuotes() {
	setTimeout('showhideQuote('+currentquote+')', 1000);
}

function showhideQuote(currentquote) {
	
	currentquote++;

	var quote1 = document.getElementById("quote1");
	var quote2 = document.getElementById("quote2");
	var quote3 = document.getElementById("quote3");
	
	var quoteimg1 = document.getElementById("personen_quote_img_1");
	var quoteimg2 = document.getElementById("personen_quote_img_2");
	var quoteimg3 = document.getElementById("personen_quote_img_3");
	
	var quotesdiv = document.getElementById("quotesdiv");
	var divs = quotesdiv.getElementsByTagName("div");
	var totalquotes = divs.length;

	if (currentquote < totalquotes || currentquote == totalquotes) {
		
			if (currentquote > 1) {
			// fade out vorige
			var previousquote = currentquote - 1;
			new Effect.Fade('quote'+ previousquote, {duration: 2.0});
			new Effect.Fade('personen_quote_img_'+ previousquote, {duration: 2.0});
			}

			// fade in nieuwe
			new Effect.Appear('quote'+currentquote, {duration: 2.0});
			new Effect.Appear('personen_quote_img_'+currentquote, {duration: 2.0});
			setTimeout('showhideQuote('+currentquote+')', 5000);
			
	} else {
		
		currentquote = 0;
		new Effect.Fade('quote'+ totalquotes);
		new Effect.Fade('personen_quote_img_'+ totalquotes);
		initQuotes();
		
	}
}

/* INIT SLIDER FRONTPAGE  */

function init() {
	setTimeout('initSlide("fotoslider")', 2500);
	setTimeout('initSlide2("fotoslider2")', 2500);
}

/* HOME FOTO SLIDER 1 */

var effect = "";
var effect2 = "";
var sliding = true;
var sliding2 = true;
var rowpic = 1;
var rowpic2 = 1;
var totalpics = 0;
var totalpics2 = 0;
var currentpic = 0;
var currentpic2 = 0;
var dir = 0;
var dir2 = 0;
var photowidth = 158;
var photowidth2 = 158;

function initSlide(id) {
	var fotoslider = document.getElementById(id);
	var imgs = fotoslider.getElementsByTagName("IMG");
	
	totalpics = imgs.length;
	dir = photowidth * -1;
	
	fotoslider.style.width = (imgs.length * photowidth) + "px";
	
	slidePics();
}

function slidePics() {
	if (sliding == true) {
		
		effect = new Effect.Move('fotoslider', { x: dir, y: 0, duration: 1.5, delay: 0, mode: 'relative'});
		//document.getElementById('fotos').style.overflow = "hidden";
		currentpic++;
		
		if (currentpic == ((totalpics - rowpic) - 0)) {
			//setTimeout('resetPics()', 4000);
			dir = dir * -1;
			currentpic = 0;
		} else {
			
		}
		
		//document.getElementById('pic1').innerHTML = (currentpic + 1) + "/" + totalpics;
		
		setTimeout('slidePics()', 2500);
	}
}
function resetPics() {
	dir = -158;
	sliding = false;
	currentpic = 0;
	
	effect.cancel();
	
	effect = new Effect.Move('fotoslider', { x: 0, y: 0, duration: 1.5, mode: 'absolute'});
	
	setTimeout('resetRecursiveSliding()', 2500);
}

function resetRecursiveSliding() {
	sliding = true;
	
	effect.cancel();
	
	slidePics();
}


/* FOTOSLIDER 2 */



function initSlide2(id2) {
	var fotoslider2 = document.getElementById(id2);
	var imgs2 = fotoslider2.getElementsByTagName("IMG");
	
	totalpics2 = imgs2.length;
	dir2 = photowidth2 * -1;
	
	fotoslider2.style.width = (imgs2.length * photowidth2) + "px";
	
	slidePics2();
}

function slidePics2() {
	if (sliding == true) {
		
		effect2 = new Effect.Move('fotoslider2', { x: dir2, y: 0, duration: 1.5, delay: 0, mode: 'relative'});
		//document.getElementById('fotos').style.overflow = "hidden";
		currentpic2++;
		
		//alert('total:' + totalpics2 + ' rowpic: ' + rowpic2 + ' currentpic: ' + currentpic2);
		
		if (currentpic2 == ((totalpics2 - rowpic2) - 0)) {
			//setTimeout('resetPics()', 4000);
			dir2 = dir2 * -1;
			currentpic2 = 0;
		} else {
			
		}
		
		//document.getElementById('pic2').innerHTML = (currentpic2 + 1) + "/" + totalpics2;
		
		setTimeout('slidePics2()', 2500);
	}
	
}
function resetPics2() {
	dir2 = -158;
	sliding2 = false;
	currentpic2 = 0;
	
	effect2.cancel();
	
	effect2 = new Effect.Move('fotoslider2', { x: 0, y: 0, duration: 1.5, mode: 'absolute'});
	
	setTimeout('resetRecursiveSliding2()', 2500);
}

function resetRecursiveSliding2() {
	sliding2 = true;
	
	effect2.cancel();
	
	slidePics2();
}

/* Pic fading ding! */
var currentPassie = 0;

function switchPassie() {
	//if meer dan 1, ga switchen, anders NIET
	if (passie.length > 1) {
		currentPassie++;
		
		var passiefoto = document.getElementById("passiefoto");
		
		fadePic(passiefoto);
		setTimeout("changeSrc('passiefoto', '" + passie[currentPassie] + "')", 1000);
		setTimeout("showPic('passiefoto')", 1100);
		
		if ((currentPassie + 1) == passie.length) {
			currentPassie = -1;
		}
		
		setTimeout("switchPassie()", 7000);
	}
}

var currentQuote = 0;

function switchQuoteFoto() {
	//if meer dan 1, ga switchen, anders NIET
	if (quote.length > 1) {
		currentQuote++;
		
		var quotefoto = document.getElementById("quotefoto");
		var quotetext = document.getElementById("quotes");
		
		fadePic(quotefoto);
		fadePic(quotetext);
		setTimeout("changeSrc('quotefoto', '" + quote[currentQuote] + "')", 1000);
		setTimeout("changeText('quotes', '" + quotes[currentQuote] + "')", 1000);
		setTimeout("showPic('quotefoto')", 1100);
		setTimeout("showPic('quotes')", 1100);
		
		if ((currentQuote + 1) == quote.length) {
			currentQuote = -1;
		}
		
		setTimeout("switchQuoteFoto()", 9000);
	}
}

function changeText(id, text) {
	document.getElementById(id).innerHTML = text;
}

function changeSrc(id, src) {
	document.getElementById(id).src = src;
}

function fadePic(id) {
	new Effect.Fade(id);
}

function showPic(id) {
	new Effect.Appear(id);
}


/* projecten thumb */

