function getStyle(oElm, strCssRule){ // ©Robert Nyman
  var strValue = "";
  if(document.defaultView && document.defaultView.getComputedStyle){
    strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule);
  }
  else if(oElm.currentStyle){
    strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){
      return p1.toUpperCase();
    });
    strValue = oElm.currentStyle[strCssRule];
  }
  return strValue;
}

function getScrollerWidth() { // ©Fleegix
	var scr = null;
	var inn = null;
	var wNoScroll = 0;
	var wScroll = 0;
 
	// Outer scrolling div
	scr = document.createElement('div');
	scr.style.position = 'absolute';
	scr.style.top = '-1000px';
	scr.style.left = '-1000px';
	scr.style.width = '100px';
	scr.style.height = '50px';
	// Start with no scrollbar
	scr.style.overflow = 'hidden';
 
	// Inner content div
	inn = document.createElement('div');
	inn.style.width = '100%';
	inn.style.height = '200px';
 
	// Put the inner div in the scrolling div
	scr.appendChild(inn);
	// Append the scrolling div to the doc
 
	document.body.appendChild(scr);
 
	// Width of the inner div sans scrollbar
	wNoScroll = inn.offsetWidth;
	// Add the scrollbar
	scr.style.overflow = 'auto';
	// Width of the inner div width scrollbar
	wScroll = inn.offsetWidth;
 
	// Remove the scrolling div from the doc
	document.body.removeChild(
	document.body.lastChild);
 
	// Pixel width of the scroller
	return (wNoScroll - wScroll);
}

/* SHOW/HIDE TOOLTIP
   ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ */

function wit_pi4_showTooltip(obj,string) {
	var toolTip = document.getElementById('tooltipWindow');
	var toolTipText = string;
	toolTip.innerHTML = toolTipText;
	toolTip.style.display = 'block';
	function wit_pi4_followCursor(e) {
		var posX = 0;
		var posY = 0;
		if (!e) var e = window.event;
		if (e.pageX || e.pageY) { //wenn moderner Browser
			posX = e.pageX;
			posY = e.pageY;
		} else if (e.clientX || e.clientY) { // wenn IE
			posX = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
			posY = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
		}
		toolTip.style.left = (posX + 15) + "px";
		toolTip.style.top = (posY + 15) + "px";
	}
	obj.onmousemove = wit_pi4_followCursor;
}
function wit_pi4_hideTooltip(obj) {
	document.getElementById('tooltipWindow').style.display = 'none';
}


// CENTER LIGHTBOX
var bg = document.getElementById("withhfahnenfleck_pi2_background");
var obj = document.getElementById("withhfahnenfleck_pi2_lightbox");
var img = document.getElementById("withhfahnenfleck_pi2_image");
var img_text = document.getElementById("withhfahnenfleck_pi2_image_text");

var bgWidth = bg.offsetWidth;
var bgHeight = bg.offsetHeight;
/*
var objWidth = obj.offsetWidth;
var objHeight = obj.offsetHeight;
*/

var framePtLen = getStyle(document.getElementById("withhfahnenfleck_pi2_frame"), "padding-top").length;
var framePt = getStyle(document.getElementById("withhfahnenfleck_pi2_frame"), "padding-top").slice(0,framePtLen-2) * 1;
var framePbLen = getStyle(document.getElementById("withhfahnenfleck_pi2_frame"), "padding-bottom").length;
var framePb = getStyle(document.getElementById("withhfahnenfleck_pi2_frame"), "padding-bottom").slice(0,framePbLen-2) * 1;
var textHeight = getStyle(document.getElementById("withhfahnenfleck_pi2_image_text"), "margin-top").slice(0,framePbLen-2) * 1 + document.getElementById("withhfahnenfleck_pi2_image_text").offsetHeight;

var frameH = framePt + framePb + textHeight;

var framePlLen = getStyle(document.getElementById("withhfahnenfleck_pi2_frame"), "padding-left").length;
var framePl = getStyle(document.getElementById("withhfahnenfleck_pi2_frame"), "padding-left").slice(0,framePlLen-2) * 1;
var framePrLen = getStyle(document.getElementById("withhfahnenfleck_pi2_frame"), "padding-right").length;
var framePr = getStyle(document.getElementById("withhfahnenfleck_pi2_frame"), "padding-right").slice(0,framePrLen-2) * 1;

var frameW = framePl + framePr;

function lightboxHeight(imgH) {
	return(imgH + frameH);
}

function lightboxWidth(imgW) {
	return (imgW + frameW);
}

var displayWidth = window.innerWidth || document.documentElement.clientWidth;
var displayHeight = window.innerHeight || document.documentElement.clientHeight;

obj.style.left = ((displayWidth - getScrollerWidth()) / 2) - (frameW / 2) + "px";
obj.style.top = (displayHeight / 2) - (frameH / 2) + "px";


function centerDiv2() {
	var displayWidth = window.innerWidth || document.documentElement.clientWidth;
	var displayHeight = window.innerHeight || document.documentElement.clientHeight;
	obj.style.left = ((posX + displayWidth - getScrollerWidth()) / 2) - ((img.firstChild.width + frameW) / 2) + "px";
	obj.style.top = (posY + displayHeight / 2) - ((img.firstChild.height + frameH) / 2) + "px";
}

function centerDiv(imgW, imgH) {
	var displayWidth = window.innerWidth || document.documentElement.clientWidth;
	var displayHeight = window.innerHeight || document.documentElement.clientHeight;
	obj.style.left = (posX + (displayWidth - getScrollerWidth()) / 2) - ((imgW + frameW) / 2) + "px";
	obj.style.top = (posY + displayHeight / 2) - ((imgH + frameH) / 2) + "px";
}
window.onresize = centerDiv2;


function transform(imgW, imgH) {
	var tem = new Image(); 
	tem.src = img.firstChild.src;
	
	var wDiff = (curImgW - imgW);
	var hDiff = (curImgH - imgH);
	if ((wDiff == 0) && (hDiff == 0)) {
		if (IE) setTimeout("fadeImgInIE()", 200); else setTimeout("fadeImgIn()", 200);
	} else {
		if ((wDiff < 0) && (hDiff < 0)) {
			transformA(wDiff, hDiff);
		} else if ((wDiff > 0) && (hDiff > 0)) {
			transformB(wDiff, hDiff);
		} else if ((wDiff < 0) && (hDiff > 0)) {
			transformC(wDiff, hDiff);
		} else if ((wDiff > 0) && (hDiff < 0)) {
			transformD(wDiff, hDiff);
		}
	}
}

var q = 0;
var s = 0;


function transformA(a,b) {
	if (q > a) {
		if ((q - 20) < a) {	// zahl überschritten
			curImgW += (a - (q - 20));
			q -= (a - (q - 20));
		} else {
			curImgW += 20;
			q -= 20;
		}
		img.firstChild.style.width = curImgW + "px";
		img_text.style.width = curImgW + "px";
	}

	if (s > b) {
		if ((s - 20) < b) {	// zahl überschritten
			curImgH += (b - (s - 20));
			s -= (b - (s - 20));
		} else {
			curImgH += 20;
			s -= 20;
		}
		img.firstChild.style.height = curImgH + "px";
	}
	
	if ((a >= q) && (b >= s)) {	// fertig
		q=0;
		s=0;
		centerDiv(curImgW, curImgH);
		if (IE) fadeImgInIE(); else fadeImgIn();
	} else {
		centerDiv(curImgW, curImgH);
		setTimeout(function(){transformA(a,b);}, 20);
	}
}

function transformB(a,b) {
	if (q < a) {
		if ((q - 20) > a) {	// zahl unterschritten
			curImgW -= (a - (q - 20));
			q += (a - (q - 20));
		} else {
			curImgW -= 20;
			q += 20;
		}
		img.firstChild.style.width = curImgW + "px";
		img_text.style.width = curImgW + "px";
	}
	
	if (s < b) {
		if ((s - 20) > b) {	// zahl unterschritten
			curImgH -= (b - (s - 20));
			s += (b - (s - 20));
		} else {
			curImgH -= 20;
			s += 20;
		}
		img.firstChild.style.height = curImgH + "px";
	}
	
	if ((a <= q) && (b <= s)) {	// fertig
		q=0;
		s=0;
		centerDiv(curImgW, curImgH);
		if (IE) fadeImgInIE(); else fadeImgIn();
	} else {
		centerDiv(curImgW, curImgH);
		setTimeout(function(){transformB(a,b);}, 20);
	}
}

function transformC(a,b) {
	if (q > a) {
		if ((q - 20) < a) {	// zahl unterschritten
			curImgW += (a - (q - 20));
			q -= (a - (q - 20));
		} else {
			curImgW += 20;
			q -= 20;
		}
		img.firstChild.style.width = curImgW + "px";
		img_text.style.width = curImgW + "px";
	}
	
	if (s < b) {
		if ((s - 20) > b) {	// zahl unterschritten
			curImgH -= (b - (s - 20));
			s += (b - (s - 20));
		} else {
			curImgH -= 20;
			s += 20;
		}
		img.firstChild.style.height = curImgH + "px";
	}
	
	if ((a >= q) && (b <= s)) {	// fertig
		q=0;
		s=0;
		centerDiv(curImgW, curImgH);
		if (IE) fadeImgInIE(); else fadeImgIn();
	} else {
		centerDiv(curImgW, curImgH);
		setTimeout(function(){transformC(a,b);}, 20);
	}
}

function transformD(a,b) {
	if (q < a) {
		if ((q - 20) > a) {	// zahl unterschritten
			curImgW -= (a - (q - 20));
			q += (a - (q - 20));
		} else {
			curImgW -= 20;
			q += 20;
		}
		img.firstChild.style.width = curImgW + "px";
		img_text.style.width = curImgW + "px";
	}
	
	if (s > b) {
		if ((s - 20) < b) {	// zahl überschritten
			curImgH += (b - (s - 20));
			s -= (b - (s - 20));
		} else {
			curImgH += 20;
			s -= 20;
		}
		img.firstChild.style.height = curImgH + "px";
	}
	
	if ((a <= q) && (b >= s)) {	// fertig
		q=0;
		s=0;
		centerDiv(curImgW, curImgH);
		if (IE) fadeImgInIE(); else fadeImgIn();
	} else {
		centerDiv(curImgW, curImgH);
		setTimeout(function(){transformD(a,b);}, 20);
	}
}

function transform2(a,b) {
	if (a < q) { // breiteres Bild kommt
		curImgW += 20;
		img.firstChild.style.width = curImgW + "px";
		img_text.style.width = curImgW + "px";
		q -= 20;
	} else if (a > q) {		// schmaleres Bild kommt
		curImgW -= 20;
		img.firstChild.style.width = curImgW + "px";
		img_text.style.width = curImgW + "px";
		q += 20;
	}

	if (b < s) { // höheres Bild
		curImgH += 20;
		img.firstChild.style.height = curImgH + "px";
		s -= 20;
	} else if (b > s) { // niedrigeres Bild
		curImgH -= 20;
		img.firstChild.style.height = curImgH + "px";
		s += 20;
	}

	if ((a == q) && (b == s)) {	// fertig
		q=0;
		s=0;
		centerDiv(curImgW, curImgH);
		if (IE) fadeImgInIE(); else fadeImgIn();
	} else {
		centerDiv(curImgW, curImgH);
		setTimeout(function(){transform2(a,b);}, 20);
	}
}


// PREPARE LIGHTBOX

var curImgId;
var curImgSrc;
var curNavId;
var arrLength = document.getElementById("withhfahnenfleck_pi2_gallery").getElementsByTagName('img').length;

var z = "";
var i=1;

if (document.getElementById("withhfahnenfleck_pi2_select")) {	// Auswahl der Bilder
	for (i=1; i<=arrLength; i++) {
		z += "<a href='#' id='withhfahnenfleck_pi2_nav00" + i +"' onclick='lbSwitch(this.id);return false;'>" + i + "</a>";
	}
	document.getElementById("withhfahnenfleck_pi2_select").innerHTML = z;
} else {	// zeigt nur die Bildnummern an id=withhfahnenfleck_pi2_imagenumber
	document.getElementById("withhfahnenfleck_pi2_imagenumber_max").innerHTML = arrLength;
}

// SHOW LIGHTBOX


var DOM =(document.getElementById&&!document.all)?1:0;
var IE  =(document.all)?1:0;
var IE6 =(typeof document.body.style.maxHeight == "undefined");

var winOpac = 0;
var winMin = 0;

if (IE){
	var winPlus = 8;
	var winMax = 80;
} else {
	var winPlus = 0.08;
	var winMax = 0.8;
}

var imgOpac = 0;
var imgMin = 0;

if (IE){
	var imgPlus = 5;
	var imgMax = 100;
} else {
	var imgPlus = 0.05;
	var imgMax = 1;
}



var curImgId;
var curImgSrc;
var curImgBig;

var curImgW;
var curImgH;


var posX;
var posY;

function setScrolledPixels() {	// gescrollte Distanz in Pixeln
	if (window.pageXOffset || window.pageYOffset) { //wenn moderner Browser
		posX = window.pageXOffset;
		posY = window.pageYOffset;
		//posY = e.offsetY; // IE
	} else { // wenn IE
		posX = document.body.scrollLeft + document.documentElement.scrollLeft;
		posY = document.body.scrollTop + document.documentElement.scrollTop;
	}
}

function lbStart(id){
	setScrolledPixels();
	if (document.getElementById("withhfahnenfleck_pi2_select")) {	// Auswahl der Bilder
		if (document.getElementById(curNavId)) {
			document.getElementById(curNavId).className = "";
		}
		curImgId = id;
		curImgSrc = document.getElementById(curImgId).src;
		curImgBig = document.getElementById(curImgId).parentNode.href;
		
		var tempPic = new Image(); 
		tempPic.src = curImgBig;
			
		if (tempPic.complete == true) {
			var w = tempPic.width;
			var h = tempPic.height;

			if (IE) img.firstChild.style.filter = "alpha(opacity=0)"; else img.firstChild.style.opacity = "0";
			img.firstChild.src = tempPic.src;
			
			curImgW = img.firstChild.width;
			curImgH = img.firstChild.height;
			
			
			// 11.05. behebt IE-Resizing-Fehler bei erneutem Öffnen der Lightbox
			if (IE) {
			curImgW = 460;
			curImgH = 300;
			}

			if (IE) img_text.style.filter = "alpha(opacity=0)"; else img_text.style.opacity = "0";
			img_text.innerHTML = imageTexts[curImgId.substring(26)-1];
			transform(w,h);
		} else {
			tempPic.onload = function(){
				var w = tempPic.width;
				var h = tempPic.height;

			if (IE) img.firstChild.style.filter = "alpha(opacity=0)"; else img.firstChild.style.opacity = "0";
				img.firstChild.src = tempPic.src;

				curImgW = img.firstChild.width;
				curImgH = img.firstChild.height;
				
			if (IE) img_text.style.filter = "alpha(opacity=0)"; else img_text.style.opacity = "0";
				img_text.innerHTML = imageTexts[curImgId.substring(26)-1];
				transform(w,h);
			}
		}
		curNavId = "withhfahnenfleck_pi2_nav00" + curImgId.substring(26);
		document.getElementById(curNavId).className = "active";
	} else {
		curImgId = id;
		curImgSrc = document.getElementById(curImgId).src;
		curImgBig = document.getElementById(curImgId).parentNode.href;
		
		var tempPic = new Image(); 
		tempPic.src = curImgBig;
		if (tempPic.complete == true) {
			var w = tempPic.width;
			var h = tempPic.height;
			
			if (IE) img.firstChild.style.filter = "alpha(opacity=0)"; else img.firstChild.style.opacity = "0";
			img.firstChild.src = tempPic.src;

			curImgW = img.firstChild.width;
			curImgH = img.firstChild.height;
			
			// 11.05. behebt IE-Resizing-Fehler bei erneutem Öffnen der Lightbox
			if (IE) {
			curImgW = 460;
			curImgH = 300;
			}

			if (IE) {curImgW = 1; curImgH = 1;}
			
			if (IE) img_text.style.filter = "alpha(opacity=0)"; else img_text.style.opacity = "0";
			img_text.innerHTML = imageTexts[curImgId.substring(26)-1];
			transform(w,h);
		} else {
			tempPic.onload = function(){
				var w = tempPic.width;
				var h = tempPic.height;
				
				if (IE) img.firstChild.style.filter = "alpha(opacity=0)"; else img.firstChild.style.opacity = "0";
				img.firstChild.src = tempPic.src;

				curImgW = img.firstChild.width;
				curImgH = img.firstChild.height;
				
				if (IE) img_text.style.filter = "alpha(opacity=0)"; else img_text.style.opacity = "0";
				img_text.innerHTML = imageTexts[curImgId.substring(26)-1];
				transform(w,h);
			}
		}
		document.getElementById("withhfahnenfleck_pi2_imagenumber_current").innerHTML = curImgId.substring(26);	
	}
	lbShow();
}


function getDocHeight() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    );
}

function getDocWidth() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollWidth, D.documentElement.scrollWidth),
        Math.max(D.body.offsetWidth, D.documentElement.offsetWidth),
        Math.max(D.body.clientWidth, D.documentElement.clientWidth)
    );
}


function lbShow(){
	if (IE6) {
		//bg.style.width = displayWidth;
		//bg.style.height = displayHeight;
		bg.style.width = getDocWidth();
		bg.style.height = getDocHeight();
	}
	if (IE) bg.style.filter = "alpha(opacity=0)"; else bg.style.opacity = "0";
	bg.style.display = "block";
	bg.style.visibility = "visible";
	obj.style.display = "block";
	if (IE) fadeInIE(); else fadeIn();
}

function lbHide(){
	obj.style.display = "none";
	obj.style.visibility = "hidden";
	img.firstChild.src = "clear.gif";
	/*
	img.firstChild.style.width = "auto";
	img.firstChild.style.height = "auto";
	*/
	img.firstChild.style.width = "260px";
	img.firstChild.style.height = "200px";
	
	if (IE) fadeOutIE(); else fadeOut();
}

function fadeIn(){
	winOpac = Math.round((winOpac + winPlus)*100)/100;
	if (!(winOpac > winMax)){
		bg.style.opacity = winOpac;
		setTimeout ("fadeIn()", 5);
	} else {
		img.firstChild.style.width = "460px";
		img.firstChild.style.height = "300px";
		centerDiv(460, 300);
		
		obj.style.visibility = "visible";
	}
}

function fadeInIE(){
	winOpac = Math.round((winOpac + winPlus)*100)/100;
	if (!(winOpac > winMax)){
		bg.style.filter = "alpha(opacity=" + winOpac + ")";
		setTimeout ("fadeInIE()", 5);
	} else {
		img.firstChild.style.width = "460px";
		img.firstChild.style.height = "300px";
		centerDiv(460, 300);

		obj.style.visibility = "visible";
	}
}

function fadeOut(){
	if (winOpac > winMin){
		winOpac = Math.round((winOpac - winPlus)*100)/100;
		bg.style.opacity = winOpac;
		setTimeout ("fadeOut()", 5);
	} else {
		bg.style.display = "none";
		bg.style.visibility = "hidden";
	}
}
function fadeOutIE(){
	if (winOpac > winMin){
		winOpac = Math.round((winOpac - winPlus)*100)/100;
		bg.style.filter = "alpha(opacity=" + winOpac + ")";
		setTimeout ("fadeOutIE()", 5);
	} else {
		bg.style.display = "none";
		bg.style.visibility = "hidden";
	}
}


function fadeImgIn() {
	if (img.firstChild.style.opacity < imgMax) {
		imgOpac += imgPlus;
		img.firstChild.style.opacity = imgOpac;
		img_text.style.opacity = imgOpac;
		setTimeout("fadeImgIn()", 10);
	} else {
		imgOpac = 0;
		document.getElementById("withhfahnenfleck_pi2_back").setAttribute('onclick', 'lbBack()');
		document.getElementById("withhfahnenfleck_pi2_forth").setAttribute('onclick', 'lbForth()');
	}
}

function fadeImgInIE() {
	if (img.firstChild.style.filter.substring(14).substring(0,(img.firstChild.style.filter.substring(14).length-1)) < imgMax) {
		imgOpac += imgPlus;
		img.firstChild.style.filter = "alpha(opacity=" + imgOpac + ")";
		//img.firstChild.style.opacity = imgOpac;
		img_text.style.filter = "alpha(opacity=" + imgOpac + ")";
		//img_text.style.opacity = imgOpac;
		setTimeout("fadeImgInIE()", 10);
	} else {
		imgOpac = 0;
		document.getElementById("withhfahnenfleck_pi2_back").onclick = function(){lbBack();};
		document.getElementById("withhfahnenfleck_pi2_forth").onclick = function(){lbForth();};
	}
}


function lbSwitch(id) {
	if (document.getElementById("withhfahnenfleck_pi2_select")) {	// Auswahl der Bilder
		if (document.getElementById(curNavId)) {
			document.getElementById(curNavId).className = "";
		}
		curImgId = "withhfahnenfleck_pi2_img00" + id;
		curImgSrc = document.getElementById(curImgId).src;
		curImgBig = document.getElementById(curImgId).parentNode.href;
				
		var tempPic = new Image(); 
		tempPic.src = curImgBig;
		
		if (tempPic.complete == true) {
			curImgW = img.firstChild.width;
			curImgH = img.firstChild.height;
			var w = tempPic.width;
			var h = tempPic.height;
			img.firstChild.style.width = curImgW + "px";
			img_text.style.width = curImgW + "px";
			img.firstChild.style.height = curImgH + "px";
			img.firstChild.src = tempPic.src;
			transform(w,h);
		} else {
			tempPic.onload = function(){
				curImgW = img.firstChild.width;
				curImgH = img.firstChild.height;
				var w = tempPic.width;
				var h = tempPic.height;
				img.firstChild.style.width = curImgW + "px";
				img_text.style.width = curImgW + "px";
				img.firstChild.style.height = curImgH + "px";
				img.firstChild.src = tempPic.src;
				transform(w,h);
			}
		}
		
		img_text.innerHTML = imageTexts[curImgId.substring(26)-1];
		curNavId = "withhfahnenfleck_pi2_nav00" + curImgId.substring(26);
		document.getElementById(curNavId).className = "active";
	} else {
		curImgId = "withhfahnenfleck_pi2_img00" + id;
		curImgSrc = document.getElementById(curImgId).src;
		curImgBig = document.getElementById(curImgId).parentNode.href;
		var tempPic = new Image();
		tempPic.src = curImgBig;
		
		if (tempPic.complete == true) {
			curImgW = img.firstChild.width;
			curImgH = img.firstChild.height;
			var w = tempPic.width;
			var h = tempPic.height;
			img.firstChild.style.width = curImgW + "px";
			img_text.style.width = curImgW + "px";
			img.firstChild.style.height = curImgH + "px";
			img.firstChild.src = tempPic.src;
			transform(w,h);
		} else {
			tempPic.onload = function(){
				curImgW = img.firstChild.width;
				curImgH = img.firstChild.height;
				var w = tempPic.width;
				var h = tempPic.height;
				img.firstChild.style.width = curImgW + "px";
				img_text.style.width = curImgW + "px";
				img.firstChild.style.height = curImgH + "px";
				img.firstChild.src = tempPic.src;
				transform(w,h);
			}
		}
		img_text.innerHTML = imageTexts[curImgId.substring(26)-1];
		document.getElementById("withhfahnenfleck_pi2_imagenumber_current").innerHTML = curImgId.substring(26);
	}
}

function lbBack() {
	if (IE) {
		document.getElementById("withhfahnenfleck_pi2_back").onclick = function(){};
		document.getElementById("withhfahnenfleck_pi2_forth").onclick = function(){};
		img.firstChild.style.filter = "alpha(opacity=0)";
		img_text.style.filter = "alpha(opacity=0)";
	} else {
		document.getElementById("withhfahnenfleck_pi2_back").setAttribute('onclick', 'lbBack()');
		document.getElementById("withhfahnenfleck_pi2_forth").setAttribute('onclick', 'lbForth()');
		img.firstChild.style.opacity = "0";
		img_text.style.opacity = "0";
	}
	var goBack = ((curImgId.substring(26)) * 1) - 1;
	if (goBack <= 0) {
		goBack = arrLength;
	}
	lbSwitch(goBack);
}

function lbForth() {
	if (IE) {
		document.getElementById("withhfahnenfleck_pi2_back").onclick = function(){};
		document.getElementById("withhfahnenfleck_pi2_forth").onclick = function(){};
		img.firstChild.style.filter = "alpha(opacity=0)";
		img_text.style.filter = "alpha(opacity=0)";	
	} else {
		document.getElementById("withhfahnenfleck_pi2_back").setAttribute('onclick', 'lbBack()');
		document.getElementById("withhfahnenfleck_pi2_forth").setAttribute('onclick', 'lbForth()');
		img.firstChild.style.opacity = "0";
		img_text.style.opacity = "0";
	}
	var goNext = ((curImgId.substring(26)) * 1) + 1;
	if (goNext > arrLength) {
		goNext = 1;
	}
	lbSwitch(goNext);
}


function checkKeycode(e) {
	if (!e) var e = window.event;
	if (e.keyCode == 27) {
		lbHide();
	} else if (e.which == 27) {
		lbHide();
	}
}

document.onkeydown = checkKeycode;
