// JavaScript Document

function dg(id) {
	return document.getElementById(id);
}

function wo(url,w,h) {
	var newWin = window.open(url,'opfrisser','status=0,toolbar=0,location=0,scrollbars=1,menubar=0,width='+w+',height='+h);	
}

// PORTFOLIO & WIE WIJ ZIJN
var curProject = 0;
var curWwz = 0;
var numProjects = 2;
var totIncrement = 0;
var increment = 851;

function skipTo(number) {	
	
	switch(curWwz) {
		case 0:
			dg("wwz0").src = 'images/buttons/carolien_static.jpg';
			dg("wwz0").onmouseout = function() {
				dg("wwz0").src = 'images/buttons/carolien_static.jpg';
			}
		break;
		case 1:
			dg("wwz1").src = 'images/buttons/dennis_static.jpg';
			dg("wwz1").onmouseout = function() {
				dg("wwz1").src = 'images/buttons/dennis_static.jpg';
			}
		break;
		case 2:
			dg("wwz2").src = 'images/buttons/nikki_static.jpg';
			dg("wwz2").onmouseout = function() {
				dg("wwz2").src = 'images/buttons/nikki_static.jpg';
			}
		break;
		case 3:
			dg("wwz3").src = 'images/buttons/jasper_static.jpg';
			dg("wwz3").onmouseout = function() {
				dg("wwz3").src = 'images/buttons/jasper_static.jpg';
			}
		break;
	}
	
	switch(number) {
		case 0:
			dg("wwz0").src = 'images/buttons/carolien_active.jpg';
			dg("wwz0").onmouseout = function() {
				dg("wwz0").src = 'images/buttons/carolien_active.jpg';
			}
		break;
		case 1:
			dg("wwz1").src = 'images/buttons/dennis_active.jpg';
			dg("wwz1").onmouseout = function() {
				dg("wwz1").src = 'images/buttons/dennis_active.jpg';
			}
		break;
		case 2:
			dg("wwz2").src = 'images/buttons/nikki_active.jpg';
			dg("wwz2").onmouseout = function() {
				dg("wwz2").src = 'images/buttons/nikki_active.jpg';
			}
		break;
		case 3:
			dg("wwz3").src = 'images/buttons/jasper_active.jpg';
			dg("wwz3").onmouseout = function() {
				dg("wwz3").src = 'images/buttons/jasper_active.jpg';
			}
		break;
	}
	
	curWwz = number;
	
	totIncrement = increment * number * -1;
	fx.stop();
	fx.start(totIncrement);
}

function next() {
	if(curProject+1 < numProjects) {
		curProject++;
	} else {
		curProject = 0;
	}
	
	totIncrement = increment * curProject * -1;
	fx.stop();
	fx.start(totIncrement);	
	
	showAfter();
}

function previous() {
	if(curProject == 0) {
		curProject = numProjects-1;
	} else {
		curProject--;
	}
	
	totIncrement = increment * curProject * -1;
	fx.stop();
	fx.start(totIncrement);	
	
	showAfter();
}

function showBefore() {
	dg(curProject+'_1').style.display = 'block';
	dg(curProject+'_2').style.display = 'none';
	
	dg("before").src = 'images/buttons/voor_active.jpg';
	dg("before").onmouseout = function() {
		dg("before").src = 'images/buttons/voor_active.jpg';
	}
	
	dg("after").src = 'images/buttons/na_static.jpg';
	dg("after").onmouseout = function () {
		dg("after").src = 'images/buttons/na_static.jpg';
	}
}

function showAfter() {	
	dg(curProject+'_1').style.display = 'none';
	dg(curProject+'_2').style.display = 'block';
	
	dg("before").src = 'images/buttons/voor_static.jpg';
	dg("before").onmouseout = function() {
		dg("before").src = 'images/buttons/voor_static.jpg';
	}
	
	dg("after").src = 'images/buttons/na_active.jpg';
	dg("after").onmouseout = function() {
		dg("after").src = 'images/buttons/na_active.jpg';
	}
}