var defaultPic = 'empty.png';
var lightboxPics = new Array();

lightboxPics[0] = new Array(
	'20111219_pic1.jpg',
	'20111219_pic2.jpg',
	'20111219_pic3.jpg',
	'20111219_pic4.jpg',
	'20111219_pic5.jpg',
	'20111219_pic6.jpg',
	'20111219_pic7.jpg',
	'20111219_pic9.jpg',
	'20111219_pic11.jpg',
	'20111219_pic12.jpg'
);

lightboxPics[3] = new Array(
	'20100616_fu_pic1.jpg',
	'20100616_fu_pic2.jpg',
	'20100616_fu_pic3.jpg',
	'20100616_fu_pic4.jpg',
	'20100616_fu_pic5.jpg',
	'20100616_fu_pic6.jpg',
	'20100616_fu_pic7.jpg',
	'20100616_fu_pic8.jpg',
	'20100616_fu_pic9.jpg',
	'20100616_fu_pic10.jpg',
	'20100616_fu_pic11.jpg',
	'20100616_fu_pic12.jpg'
);

lightboxPics[1] = new Array(
	'1_111024_ta_echtwald_0093s.jpg',
	'2_111026_ta_echtwald_0733s.jpg',
	'3_111024_ta_echtwald_0167s.jpg',
	'4_111023_ta_echtwald_0405s.jpg',
	'5_111023_ta_echtwald_0225s.jpg',
	'6_111024_ta_echtwald_0217s.jpg',
	'7_111023_ta_echtwald_0214s.jpg',
	'8_111024_ta_echtwald_0156s.jpg',
	'9_111024_ta_echtwald_0149s.jpg',
	'10_111024_ta_echtwald_0178s.jpg',
	'11_111023_ta_echtwald_0312s.jpg',
	'12_111026_ta_echtwald_0599s.jpg',
	'13_111026_ta_echtwald_0623s.jpg',
	'14_111024_ta_echtwald_0124s.jpg',
	'15_111026_ta_echtwald_0644s.jpg',
	'16_111024_ta_echtwald_0007s.jpg',
	'17_111024_ta_echtwald_0642s.jpg',
	'18_111024_ta_echtwald_0174s.jpg',
	'19_111024_ta_echtwald_0237s.jpg',
	'111023_ta_echtwald_0020s.jpg',
	'111023_ta_echtwald_0070s.jpg',
	'111023_ta_echtwald_0093s.jpg',
	'111023_ta_echtwald_0096s.jpg',
	'111023_ta_echtwald_0112s.jpg',
	'111023_ta_echtwald_0152s.jpg',
	'111023_ta_echtwald_0153s.jpg',
	'111023_ta_echtwald_0160s.jpg',
	'111023_ta_echtwald_0161s.jpg',
	'111023_ta_echtwald_0176s.jpg',
	'111023_ta_echtwald_0181s.jpg',
	'111023_ta_echtwald_0187s.jpg',
	'111023_ta_echtwald_0188s.jpg',
	'111023_ta_echtwald_0192s.jpg',
	'111023_ta_echtwald_0198s.jpg',
	'111023_ta_echtwald_0225s.jpg',
	'111023_ta_echtwald_0263s.jpg',
	'111023_ta_echtwald_0295s.jpg',
	'111023_ta_echtwald_0305s.jpg',
	'111023_ta_echtwald_0365s.jpg',
	'111023_ta_echtwald_0398s.jpg',
	'111023_ta_echtwald_0405s.jpg',
	'111023_ta_echtwald_0423s.jpg',
	'111024_ta_echtwald_0007s.jpg',
	'111024_ta_echtwald_0010s.jpg',
	'111024_ta_echtwald_0014s.jpg',
	'111024_ta_echtwald_0015s.jpg',
	'111024_ta_echtwald_0030s.jpg',
	'111024_ta_echtwald_0034s.jpg',
	'111024_ta_echtwald_0039s.jpg',
	'111024_ta_echtwald_0043s.jpg',
	'111024_ta_echtwald_0050s.jpg',
	'111024_ta_echtwald_0052s.jpg',
	'111024_ta_echtwald_0055s.jpg',
	'111024_ta_echtwald_0061s.jpg',
	'111024_ta_echtwald_0093s.jpg',
	'111024_ta_echtwald_0108s.jpg',
	'111024_ta_echtwald_0114s.jpg',
	'111024_ta_echtwald_0120s.jpg',
	'111024_ta_echtwald_0124s.jpg',
	'111024_ta_echtwald_0126s.jpg',
	'111024_ta_echtwald_0129s.jpg',
	'111024_ta_echtwald_0144s.jpg',
	'111024_ta_echtwald_0149s.jpg',
	'111024_ta_echtwald_0154s.jpg',
	'111024_ta_echtwald_0155s.jpg',
	'111024_ta_echtwald_0157s.jpg',
	'111024_ta_echtwald_0158s.jpg',
	'111024_ta_echtwald_0163s.jpg',
	'111024_ta_echtwald_0167s.jpg',
	'111024_ta_echtwald_0174s.jpg',
	'111024_ta_echtwald_0178s.jpg',
	'111024_ta_echtwald_0181s.jpg',
	'111024_ta_echtwald_0194s.jpg',
	'111024_ta_echtwald_0212s.jpg',
	'111024_ta_echtwald_0215s.jpg',
	'111024_ta_echtwald_0217s.jpg',
	'111024_ta_echtwald_0230s.jpg',
	'111024_ta_echtwald_0237s.jpg',
	'111024_ta_echtwald_0251s.jpg',
	'111024_ta_echtwald_0254s.jpg',
	'111024_ta_echtwald_0258s.jpg',
	'111024_ta_echtwald_0268s.jpg',
	'111024_ta_echtwald_0293s.jpg',
	'111024_ta_echtwald_0319s.jpg',
	'111024_ta_echtwald_0356s.jpg',
	'111024_ta_echtwald_0369s.jpg',
	'111024_ta_echtwald_0377s.jpg',
	'111024_ta_echtwald_0385s.jpg',
	'111024_ta_echtwald_0390s.jpg',
	'111024_ta_echtwald_0401s.jpg',
	'111024_ta_echtwald_0413s.jpg',
	'111024_ta_echtwald_0434s.jpg',
	'111024_ta_echtwald_0444s.jpg',
	'111024_ta_echtwald_0462s.jpg',
	'111024_ta_echtwald_0465s.jpg',
	'111024_ta_echtwald_0474s.jpg',
	'111024_ta_echtwald_0477s.jpg',
	'111024_ta_echtwald_0478s.jpg',
	'111024_ta_echtwald_0479s.jpg',
	'111024_ta_echtwald_0487s.jpg',
	'111024_ta_echtwald_0491s.jpg',
	'111024_ta_echtwald_0495s.jpg',
	'111024_ta_echtwald_0513s.jpg',
	'111024_ta_echtwald_0531s.jpg',
	'111024_ta_echtwald_0538s.jpg',
	'111024_ta_echtwald_0539s.jpg',
	'111024_ta_echtwald_0588s.jpg',
	'111024_ta_echtwald_0606s.jpg',
	'111024_ta_echtwald_0610s.jpg',
	'111024_ta_echtwald_0627s.jpg',
	'111024_ta_echtwald_0630s.jpg',
	'111024_ta_echtwald_0642s.jpg',
	'111024_ta_echtwald_0652s.jpg',
	'111024_ta_echtwald_0666s.jpg',
	'111024_ta_echtwald_0677s.jpg',
	'111026_ta_echtwald_0599s.jpg',
	'111026_ta_echtwald_0644s.jpg',
	'111026_ta_echtwald_0690s.jpg',
	'111026_ta_echtwald_0717s.jpg',
	'111026_ta_echtwald_0722s.jpg',
	'111026_ta_echtwald_0730s.jpg',
	'111026_ta_echtwald_0733s.jpg',
	'111026_ta_echtwald_0745s.jpg',
	'111026_ta_echtwald_0774s.jpg',
	'111026_ta_echtwald_0782s.jpg',
	'111026_ta_echtwald_0790s.jpg',
	'111026_ta_echtwald_0794s.jpg',
	'111026_ta_echtwald_0796s.jpg',
	'111026_ta_echtwald_0828s.jpg'
);

lightboxPics[2] = new Array(
	'vom_wald_zum_ew.jpg',
	'wald_ist_das_ziel_1.jpg',
	'wald_ist_das_ziel_2.jpg',
	'wald_ist_das_ziel_3.jpg',
	'wald_ist_das_ziel_4.jpg'
);

var curImgNum = 0;
var curListNum = 0;

function switchPic(picName, fileName) {
	if(fileName != null && fileName != '') {
		document[picName].src = String('images/'+fileName);
	}
}
//------------------------------------------------------------
function rolloverId (id, thumb, preview) {
	switchPic('thumb'+id, thumb);
	switchPic('preview', preview);
}
//------------------------------------------------------------
function getNrOfLightboxPics(listNum) {
	return lightboxPics[listNum].length;
}
//------------------------------------------------------------
function openLightbox(listNum, imgNum) {
	document.getElementById('light').style.display='block';
	document.getElementById('fade').style.display='block';
	
	curImgNum = imgNum;
	curListNum = listNum;
	switchPic('pic', lightboxPics[listNum][imgNum]);
	checkPrevNextBtns(listNum, imgNum);
}
//------------------------------------------------------------
function closeLightbox() {
	document.getElementById('light').style.display='none';
	document.getElementById('fade').style.display='none';

	curImgNum = 0;
	switchPic('pic', defaultPic);
}
//------------------------------------------------------------
function nextLightboxPic() {
	nrPics = getNrOfLightboxPics(curListNum);
	
	curImgNum++;
	if (curImgNum > (nrPics - 1)) {
		curImgNum = (nrPics - 1);
	}
	switchPic('pic', lightboxPics[curListNum][curImgNum]);
	checkPrevNextBtns(curListNum, curImgNum);
}
//------------------------------------------------------------
function prevLightboxPic() {
	curImgNum--;
	if (curImgNum < 0) {
		curImgNum = 0;
	}
	switchPic('pic', lightboxPics[curListNum][curImgNum]);
	checkPrevNextBtns(curListNum, curImgNum);
}
//------------------------------------------------------------
function checkPrevNextBtns(listNum, imgNum) {
	if (imgNum >= (getNrOfLightboxPics(listNum)-1)) {
		document.getElementById('next').style.display='none';
  	} else {
		document.getElementById('next').style.display='block';
	}
	if (imgNum < 1) {
		document.getElementById('prev').style.display='none';
  	} else {
		document.getElementById('prev').style.display='block';
	}
}	

