/* Wordt gebruikt voor de fotoslider (av/24-04-2008) */

function imgscrollPrev() {
	imgscrollGo(-1);
}

function imgscrollNext() {
	imgscrollGo(1);
}

var Positie = 1;
var aantalAfbeeldingen = 1;

function imgscrollGo(x) {
	var scrollby, currentPosition, newPosition;

	aantalAfbeeldingen = $('imgscrollInner').getElementsBySelector('img').length

	Positie = Positie + x;
	
	if (Positie<1) {
		Positie = 1;
	}
	
	if (Positie>aantalAfbeeldingen) {
		Positie = aantalAfbeeldingen;
	}

	$('imgscrollInner').getElementsBySelector('img').each(function(el){
		if (el.id=='scrollimg'+Positie) {
			el.show();
		} else {
			el.hide();
		}	
	});

	if(Positie <= 1) {
		$('imgscrollPrevA').hide();
	} else {
		$('imgscrollPrevA').show();
	}
	
	if (Positie >= aantalAfbeeldingen) {
		$('imgscrollNextA').hide();
	} else {
		$('imgscrollNextA').show();
	}
}
