

	function setFooterPosition() {

		document.getElementById('footer').style.display = "block";

		iMainnaviBottom = 134 + guiGetElementHeight('mainnavi') - 150;
		iTextBottom = 135 + guiGetElementHeight('text');
		iMinBottom = 470;
		iFooterTop = iMinBottom;

		if(iMainnaviBottom > iMinBottom || iTextBottom > iMinBottom) {
			if(iMainnaviBottom > iTextBottom) {
				iFooterTop = iMainnaviBottom;
			} else {
				iFooterTop = iTextBottom;
			}
		}

		if(iFooterTop < iMinBottom) {
			iFooterTop = iMinBottom;
		}

		if(guiGetDocumentHeight() - 250 < iFooterTop) {
			document.getElementById('footer').style.position = "absolute";
			guiSetElementTop('footer', iFooterTop);
		} else {
			document.getElementById('footer').style.position = "absolute";
			guiSetElementTop('footer', guiGetDocumentHeight() - 250);
		}

	}


	function guiGetDocumentHeight() {
		// Browserweiche
		if (self.innerHeight) {
			return self.innerHeight;
		}
		else if (document.documentElement && document.documentElement.clientHeight) {
			return document.documentElement.clientHeight;
		}
		else if (document.body) {
			return document.body.clientHeight;
		}
	}

	function guiGetDocumentWidth() {
		// Browserweiche
		if (self.innerWidth) {
			return self.innerWidth;
		}
		else if (document.documentElement && document.documentElement.clientWidth) {
			return document.documentElement.clientWidth;
		}
		else if (document.body) {
			return document.body.clientWidth;
		}
	}

	function guiGetElementWidth(sID) {
		if(document.getElementById(sID)) {
			if(document.getElementById(sID).style.display != 'none') {
				return document.getElementById(sID).offsetWidth;
			} else {
				return 0;
			}
		}
	}

	function guiGetElementHeight(sID) {
		if(document.getElementById(sID)) {
			if(document.getElementById(sID).style.display != 'none') {
				return document.getElementById(sID).offsetHeight;
			} else {
				return 0;
			}
		}
	}

	function guiGetElementBottom(sID) {
		if(document.getElementById(sID)) {
			return parseInt(guiReplace(document.getElementById(sID).style.bottom, "px", ""));
		} else {
			return 0;
		}
	}

	function guiGetElementTop(sID) {
		if(document.getElementById(sID)) {
			return guiReplace(document.getElementById(sID).style.top, "px", "");
		} else {
			return 0;
		}
	}

	function guiSetElementWidth(sID, iWidth) {
		if(document.getElementById(sID) && iWidth >= 0) {
			document.getElementById(sID).style.width = guiGetPixels(iWidth) + 'px';
		}
	}

	function guiSetElementHeight(sID, iHeight) {
		if(document.getElementById(sID) && iHeight >= 0) {
			document.getElementById(sID).style.height = guiGetPixels(iHeight) + 'px';
		}
	}

	function guiSetElementTop(sID, iTop) {
		if(document.getElementById(sID)) {
			document.getElementById(sID).style.top = guiGetPixels(iTop) + 'px';
		}
	}

	function guiSetElementLeft(sID, iLeft) {
		if(document.getElementById(sID)) {
			document.getElementById(sID).style.left = guiGetPixels(iLeft) + 'px';
		}
	}

	function guiSetElementRight(sID, iRight) {
		if(document.getElementById(sID)) {
			document.getElementById(sID).style.right = guiGetPixels(iRight) + 'px';
		}
	}

	function guiSetElementBottom(sID, iBottom) {
		if(document.getElementById(sID)) {
			document.getElementById(sID).style.bottom = guiGetPixels(iBottom) + 'px';
		}
	}

	function guiSetElementDisplay(sID, sStatus) {
		if(document.getElementById(sID) && (sStatus == '') || (sStatus == 'inline') || (sStatus == 'block') || (sStatus == 'none'))  {
			document.getElementById(sID).style.display = sStatus;
		}
	}

	function guiSetElementClass(sID, sClass) {
		if(document.getElementById(sID))  {
			document.getElementById(sID).className = sClass;
		}
	}

	function guiGetPixels(sPixels) {
		return guiReplace(sPixels);
	}

	function guiReplace(sString, sSearch, sReplace) {
		sReturn = "" + sString;
		while (sReturn.indexOf(sSearch) >- 1) {
			pos= sReturn.indexOf(sSearch);
			sReturn = "" + (sReturn.substring(0, pos) + sReplace +
			sReturn.substring((pos + sSearch.length), sReturn.length));
		}

		return sReturn
	}

	function wait(iMSec)
	  {
	  var eDate = null;
	  var eMsec = 0;
	  var sDate = new Date();
	  var sMsec = sDate.getTime();

	  do {
		  eDate = new Date();
		  eMsec = eDate.getTime();

	  } while ((eMsec-sMsec)<iMSec);
	}


var aGallery = new Array();
var iPicCnt = 0;
function addImageToGal(iCnt, sImage, iWidth, iHeight, sTitle) {
	aGallery[iCnt] = new Array();
	aGallery[iCnt]['src'] = sImage;
	aGallery[iCnt]['width'] = iWidth;
	aGallery[iCnt]['height'] = iHeight;
	aGallery[iCnt]['title'] = sTitle;
	iPicCnt++;
}

function showImage4Gal(iCnt) {
	if (iPicCnt == 0) {
		return;
	}

	if (iCnt < 0) {
		iCnt = (iPicCnt - 1);
	}
	if (iCnt == iPicCnt) {
		iCnt = 0;
	}
	document.getElementById('fog').style.display = 'block';

	document.getElementById('galleryview').style.display = 'block';
	var y;
	if (self.pageYOffset) // all except Explorer
	{
		y = self.pageYOffset;
	}
	else if (document.documentElement && document.documentElement.scrollTop)
	// Explorer 6 Strict
	{
		y = document.documentElement.scrollTop;
	}
	else if (document.body) // all other Explorers
	{
		y = document.body.scrollTop;
	}

	//document.getElementById('galleryview').style.top = ((screen.availHeight / 2) - (aGallery[iCnt]['height'] / 2) - 150) + 'px';
	document.getElementById('galleryview').style.top = '80px';
	document.getElementById('galleryview').style.left = (document.body.clientWidth / 2 - (aGallery[iCnt]['width'] / 2)) + 'px';
	document.getElementById('galleryview').style.width = aGallery[iCnt]['width'] + 'px';
	var iHeight = parseInt(aGallery[iCnt]['height']) + 20;
	document.getElementById('galleryview').style.height = iHeight + 'px';
	document.getElementById('galleryview').innerHTML = '<p><a href="javascript:closeGal()"><img src="' + aGallery[iCnt]['src'] + '"></a></p>';
	document.getElementById('galleryview').innerHTML += '<p>' + aGallery[iCnt]['title'] + '</p>';
	document.getElementById('galleryview').innerHTML += '<p style="margin-top: 5px;"><a style="float: right" href="javascript:closeGal()"><img src="/images/gal_close.gif"></a></p>';

}

function closeGal() {
	document.getElementById('fog').style.display = 'none';
	document.getElementById('galleryview').style.display = 'none';
	document.getElementById('galleryview').innerHTML = '';
}


