﻿	var index=0;
	var huidigindex='';

	PT.Sites.Dubent = {
		indexInArray: function(arr, val) {
			for (var i = 0; i < arr.length; i++) if (arr[i] == val) return i;
			return -1;
		},
		Blader: function(richting) {
			index = PT.Sites.Dubent.indexInArray(Pic, huidigindex);
			if (index == -1) {
				index = 0;
			}
			// volgende of vorige; loopt door array
			if (richting == 'volgende') {
				if (index + 1 >= Pic.length) {
					index = 0;
				}
				else {
					index++;
				}
			}
			else if (richting == 'vorige') {
				if (index - 1 < 0) {
					index = Pic.length - 1;
				}
				else {
					index--;
				}
			}
			//image veranderen
			var img = $('liedtegels').getElementsByTagName('img')[0];
			img.src = Pic[index];
			huidigindex = Pic[index];
		},
		BladerRep: function(richting) {
			index = PT.Sites.Dubent.indexInArray(Pic, huidigindex);
			if (index == -1) {
				index = 0;
			}
			// volgende of vorige; loopt door array
			if (richting == 'volgende') {
				if (index + 1 >= Pic.length) {
					index = 0;
				}
				else {
					index++;
				}
			}
			else if (richting == 'vorige') {
				if (index - 1 < 0) {
					index = Pic.length - 1;
				}
				else {
					index--;
				}
			}
			//image veranderen
			var liedid = Pic[index];
			$('rep_lied').getElementsByTagName('h2')[0].innerHTML = $(liedid).innerHTML;
			huidigindex = liedid;
		},
		ShowImgAlt: function(nr) {
			var imgbron = Pic[nr];
			$('fotopopup_img').src = imgbron;
			//$('fotopopup').alt = img[i].getAttribute("alt");
			$('fotopopup').style.display = 'block';
		},
		SluitPopup: function(id) {
			$(id).style.display = 'none';
		},
		OpenGastenboek: function(id) {
			$(id).style.display = 'block';
			$('gastenboek').style.display = 'none';
		},
		SluitGastenboek: function(id) {
			$(id).style.display = 'none';
			$('gastenboek').style.display = 'block';
		}

		/*onLoad : function (){
		}*/
	}

//PT.Sites.General.RegisterEvent(window, "load", function() {PT.Sites.Linders.onLoad();} );
