// JavaScript Document
$(document).ready(function() {

function repeatfadeO(delay, id) { 
	$("#"+id).children("img").fadeOut(2500, function() { repeatfade(delay, id); });
}

function repeatfade(delay, id) { 
	$("#"+id).children("img").delay(2000).fadeIn(2500, function() { repeatfadeO(delay, id); });
}


$("#buttonshome a").each(function(){
								  
	if ($(this).attr("id") == "een") { var delay = 0; }
	else if ($(this).attr("id") == "twee") { var delay = 500; }
	else if ($(this).attr("id") == "drie") { var delay = 1000; }
	else if ($(this).attr("id") == "vier") { var delay = 1500; }
	else if ($(this).attr("id") == "vijf") { var delay = 2000; }
	else if ($(this).attr("id") == "zes") { var delay = 2500; }
	$(this).children("img").delay(delay).fadeIn(2500, function() {
		$(this).fadeOut(2500, function() { repeatfade(delay, $(this).parents("a").attr("id")); });
	});
});

$("#buttonshome.english a").each(function(){
								  
	if ($(this).attr("id") == "een_en") { var delay = 0; }
	else if ($(this).attr("id") == "twee_en") { var delay = 500; }
	else if ($(this).attr("id") == "drie_en") { var delay = 1000; }
	else if ($(this).attr("id") == "vier_en") { var delay = 1500; }
	else if ($(this).attr("id") == "vijf_en") { var delay = 2000; }
	else if ($(this).attr("id") == "zes_en") { var delay = 2500; }
	$(this).children("img").delay(delay).fadeIn(2500, function() {
		$(this).fadeOut(2500, function() { repeatfade(delay, $(this).parents("a").attr("id")); });
	});
});

});

