			// Höhe und Breite des Anzeigebereiches
			var iDisplayPageHeight = -1;
			var iDisplayPageWidth = -1;
			
			var imageBoxWidth = -1;
			var imageBoxHeight = -1;
			
			var imageWidth = -1;
			var imageHeight = -1;
			
			var bDisplayImage = false;
			var aImageIndex = -1;
			
			var aImages = new Array( false );

			var aOtherImages = new Array(
			"./_images/_etc/inview/rechts.jpg",
			"./_images/_etc/inview/links.jpg",
			"./_images/_etc/inview/oben.jpg",
			"./_images/_etc/inview/unten.jpg",
			"./_images/_etc/inview/btn_pic1.gif",
			"./_images/_etc/inview/btn_pic2.gif",
			"./_images/_etc/inview/btn_pic3.gif",
			"./_images/_etc/inview/btn_pic4.gif",
			"./_images/_etc/inview/btn_pic5.gif",
			"./_images/_etc/inview/btn_pic6.gif",
			"./_images/_etc/inview/btn_pic7.gif",
			"./_images/_etc/inview/btn_pic8.gif",
			"./_images/_etc/inview/btn_pic9.gif",
			"./_images/_etc/inview/btn_close.gif");
			
			function addPictures( sPageID, iCount )
			{
				try
				{
					var i = 0;
					var objImg = false;
					aImages = new Array();
					for( i = 0; i < iCount; i++)
					{
						aImages.push( new Array( 'index.php?&pi=picture&mode=f&pii='+ (i + 1) +'&pn=' + sPageID , 800 , 600 , -1 ) );
					}
					
					var ssrc = "";
					for( i = 0; i < aOtherImages.length; i++)
					{
						ssrc = aOtherImages[i];
						aOtherImages[i] = new Image();
						aOtherImages[i].src = ssrc;
					}
					
				}
				catch(e){}
			}
			
			function checkCompletedPicture(index)
			{

				var myImage = aImages[index][3]


					if( myImage.complete )
					{
						aImages[index][1] = myImage.width;
						aImages[index][2] = myImage.height;
						if( aImageIndex == index )
						{
							changePicture(index);
						}
						// alert( 'Bild: ' + index + 'h:' + aImages[index][2] );
					}
					else
					{
						setTimeout('checkCompletedPicture('+index+');', 200);
					}
			}
			
			function checkComplete ()
			{
				return true;
				try
				{
					var i = 0;
					var inComplete = 0;
					for( i = 0; i < aImages.length; i++ )
					{
						if( aImages[i][3].complete )
						{
							aImages[i][1] = aImages[i][3].width;
							aImages[i][2] = aImages[i][3].height;
						}
						else
						{
							inComplete++;
						}
					}
					if( inComplete > 0 ) setTimeout('checkComplete();', 250);
				}catch(e){}
			}
			
			function changePicture( index )
			{

					if( aImageIndex != -1 )
					{
						var myButton = document.getElementById('picturebutton' + aImageIndex);
						myButton.className = 'picturebuttonoff';
					}
					aImageIndex = index;
					
					if( aImages[aImageIndex][3] == -1 )
					{
						aImages[aImageIndex][3] = new Image();
						aImages[aImageIndex][3].src = aImages[ aImageIndex ][ 0 ];
					}
					
					var myButton2 = document.getElementById('picturebutton' + aImageIndex);
					myButton2.className = 'picturebuttonon';
					
					
					var myImage = document.getElementById('pictureboximage');
					myImage.src = aImages[aImageIndex][3].src;
						
					if( aImages[aImageIndex][3].complete )
					{
						aImages[index][1] = aImages[aImageIndex][3].width;
						aImages[index][2] = aImages[aImageIndex][3].height;
					}
					else
					{
						checkCompletedPicture( index );
					}
					
					imageWidth = aImages[ index ][ 1 ];
					imageHeight = aImages[ index ][ 2 ];

				
				if( !bDisplayImage )
				{
					start();
				}
				else
				{
					init();
				}
			}
			
			
			function checkMoveArrows()
			{
				var myImage = document.getElementById('pictureboximage');
				
				var ABNR = document.getElementById('pictureboxnavright'); // width = 30
				if( imageWidth <= imageBoxWidth ||  (myImage.offsetLeft - 2) < imageBoxWidth - imageWidth )
				{
					ABNR.style.display = 'none';
				}
				else
				{
					ABNR.style.display = 'block';
				}
				
				
				var ABNL = document.getElementById('pictureboxnavleft'); // width = 30
				if( imageWidth <= imageBoxWidth ||  myImage.offsetLeft > -1 )
				{
					ABNL.style.display = 'none';
				}
				else
				{
					ABNL.style.display = 'block';
				}
				
				var ABNU = document.getElementById('pictureboxnavup'); // width = 30
				if( imageHeight <= imageBoxHeight ||  myImage.offsetTop > -1 )
				{
					ABNU.style.display = 'none';
				}
				else
				{
					ABNU.style.display = 'block';
				}
				
				var ABND = document.getElementById('pictureboxnavdown'); // width = 120
				if( imageHeight <= imageBoxHeight || (myImage.offsetTop - 2) < imageBoxHeight - imageHeight )
				{
					ABND.style.display = 'none';
				}
				else
				{
					ABND.style.display = 'block';
				}

			}
			function DisplayImageBox()
			{
				try
				{
					var AnzeigeBox = document.getElementById('picturebox');
					AnzeigeBox.style.left = iDisplayPageWidth / 2 - imageBoxWidth / 2 + 'px';
					AnzeigeBox.style.top = iDisplayPageHeight / 2 - imageBoxHeight / 2 + 'px';
					
					AnzeigeBox.style.width = imageBoxWidth + 'px';
					AnzeigeBox.style.height = imageBoxHeight + 'px';
					
					var ABNR = document.getElementById('pictureboxnavright'); // width = 30
					ABNR.style.left = iDisplayPageWidth / 2 + imageBoxWidth / 2 - 30 + 1 + 'px';
					ABNR.style.top = iDisplayPageHeight / 2 - imageBoxHeight / 2 + ( imageBoxHeight / 2 - 60 ) + 'px';
					
					var ABNL = document.getElementById('pictureboxnavleft'); // width = 30
					ABNL.style.left = iDisplayPageWidth / 2 - imageBoxWidth / 2 +  1 + 'px';
					ABNL.style.top = iDisplayPageHeight / 2 - imageBoxHeight / 2 + ( imageBoxHeight / 2 - 60 ) + 'px';
					
					var ABNU = document.getElementById('pictureboxnavup'); // width = 30
					ABNU.style.left = iDisplayPageWidth / 2 - 60 + 'px';
					ABNU.style.top = iDisplayPageHeight / 2 -  imageBoxHeight / 2 + 1 + 'px';
	
					var ABND = document.getElementById('pictureboxnavdown'); // width = 120
					ABND.style.left = iDisplayPageWidth / 2 - 60 + 'px';
					ABND.style.top = iDisplayPageHeight / 2 + imageBoxHeight / 2 - 30 +  1 + 'px';
					
					var PBC = document.getElementById('pictureclose');
					PBC.style.left = iDisplayPageWidth / 2 + imageBoxWidth / 2 - 16 + 'px';
					PBC.style.top = iDisplayPageHeight / 2 -  imageBoxHeight / 2 - 18 + 'px';
					
					var i = 0;
					var PB;
					for( i = 0; i < aImages.length; i++ )
					{
						PB = document.getElementById('picturebutton' + i);
						PB.style.left = iDisplayPageWidth / 2 - imageBoxWidth / 2 +  1 + (47 * i) + 'px';
						PB.style.top = iDisplayPageHeight / 2 -  imageBoxHeight / 2 - 18 + 'px';
						if( PB.className == 'off' )
						{
							PB.className = 'picturebuttonoff';
						}
					}
					
					var myImage = document.getElementById('pictureboximage');
					if( imageBoxWidth < imageWidth )
					{
						myImage.style.left = ((imageWidth - imageBoxWidth) / -2) + 'px';
					}
					else
					{
						myImage.style.left = '0px';
					}
					if ( imageBoxHeight < imageHeight )
					{
						myImage.style.top =  ((imageHeight - imageBoxHeight) / -2) + 'px';
					}
					else
					{
						myImage.style.top = '0px';
					}
				}
				catch(e){}
			}
			
			
			function DisplayImageBackground()
			{
				// Controls anzeigen
				var Anzeigebereich = document.getElementById('pictureframeset');
				Anzeigebereich.className = '';
				 if( window.innerHeight )
				 {
					 iDisplayPageHeight = window.innerHeight;
					 iDisplayPageWidth = window.innerWidth;
				 }
				 else
				 {
					 iDisplayPageHeight = document.documentElement.clientHeight;
					 iDisplayPageWidth = document.documentElement.clientWidth;
				 }
				
				Anzeigebereich.style.height = (iDisplayPageHeight) + 'px';
				
				imageBoxWidth = Math.round(iDisplayPageWidth * 0.90);
				imageBoxHeight = Math.round(iDisplayPageHeight * 0.90);
				if( imageBoxWidth > imageWidth - 20 ) imageBoxWidth = imageWidth;
				if( imageBoxHeight > imageHeight - 20 ) imageBoxHeight = imageHeight;

				
				// alert('Box: ' + imageBoxWidth + ' x ' + imageBoxHeight );
				
				// Hintergrund abdunkeln (über die gesamte Seite)
				var Hintergrund = document.getElementById('picturebackground');
				Hintergrund.className = '';
			
				var iFullPageHeight = 0;
				if( document.body.clientHeight )
				{
					iFullPageHeight = document.body.clientHeight;
				}
				else if( document.documentElement.clientHeight )
				{
					iFullPageHeight = document.documentElement.clientHeight;
				}
				else
				{
					iFullPageHeight = window.innerHeight;
				}
				Hintergrund.style.height = (iFullPageHeight) + 'px';
			}
			
			var startDisplayMoveRT = -1;
			function startDisplayMoveR() { startDisplayMoveRT = setTimeout( 'DisplayMoveR();', 100 ); document.getElementById('pictureboxnavright').className = 'pictureboxnavon'; }
			function stopDisplayMoveR() { clearTimeout(startDisplayMoveRT); startDisplayMoveRT = -1; document.getElementById('pictureboxnavright').className = 'pictureboxnavoff';}
			function DisplayMoveR()
			{
				var myImage = document.getElementById('pictureboximage');
				if( myImage.offsetLeft + imageWidth > imageBoxWidth )
				{
					if( myImage.offsetLeft - 20 + imageWidth < imageBoxWidth )
					{
						myImage.style.left = imageBoxWidth - imageWidth + 'px';
						stopDisplayMoveR();
					}
					else
					{
						myImage.style.left = myImage.offsetLeft - 20 + 'px';
						startDisplayMoveRT = setTimeout( 'DisplayMoveR();', 100 );
					}
					checkMoveArrows();
				}
			}
			
			var startDisplayMoveLT = -1;
			function startDisplayMoveL() { startDisplayMoveLT = setTimeout( 'DisplayMoveL();', 100 ); document.getElementById('pictureboxnavleft').className = 'pictureboxnavon'; }
			function stopDisplayMoveL() { clearTimeout(startDisplayMoveLT); startDisplayMoveLT = -1; document.getElementById('pictureboxnavleft').className = 'pictureboxnavoff'; }
			function DisplayMoveL()
			{
				var myImage = document.getElementById('pictureboximage');
				if( myImage.offsetLeft < 0 )
				{
					if( myImage.offsetLeft + 20 > 0 )
					{
						myImage.style.left = 0 + 'px';
						stopDisplayMoveL();
					}
					else
					{
						myImage.style.left = myImage.offsetLeft + 20 + 'px';
						startDisplayMoveLT = setTimeout( 'DisplayMoveL();', 100 );
					}
					checkMoveArrows();
				}
			}
			
			var startDisplayMoveUT = -1;
			function startDisplayMoveU() { startDisplayMoveUT = setTimeout( 'DisplayMoveU();', 100 ); document.getElementById('pictureboxnavup').className = 'pictureboxnavon';}
			function stopDisplayMoveU() { clearTimeout(startDisplayMoveUT); startDisplayMoveUT = -1; document.getElementById('pictureboxnavup').className = 'pictureboxnavoff'; }
			function DisplayMoveU()
			{
				var myImage = document.getElementById('pictureboximage');
				if( myImage.offsetTop < 0 )
				{
					if( myImage.offsetTop + 20 > 0 )
					{
						myImage.style.top = 0 + 'px';
						stopDisplayMoveU();
					}
					else
					{
						myImage.style.top = myImage.offsetTop + 20 + 'px';
						startDisplayMoveUT = setTimeout( 'DisplayMoveU();', 100 );
					}
					checkMoveArrows();
				}
			}
			
			var startDisplayMoveDT = -1;
			function startDisplayMoveD() { startDisplayMoveDT = setTimeout( 'DisplayMoveD();', 100 ); document.getElementById('pictureboxnavdown').className = 'pictureboxnavon';}
			function stopDisplayMoveD() { clearTimeout(startDisplayMoveDT); startDisplayMoveDT = -1;  document.getElementById('pictureboxnavdown').className = 'pictureboxnavoff';}
			function DisplayMoveD()
			{
				var myImage = document.getElementById('pictureboximage');
				if( myImage.offsetTop + imageHeight > imageBoxHeight )
				{
					if( myImage.offsetTop - 20 + imageHeight < imageBoxHeight )
					{
						myImage.style.top = imageBoxHeight - imageHeight + 'px';
						stopDisplayMoveD();
					}
					else
					{
						myImage.style.top = myImage.offsetTop - 20 + 'px';
						startDisplayMoveDT = setTimeout( 'DisplayMoveD();', 100 );
					}
					checkMoveArrows();
				}
			}
			
			function start( )
			{
				bDisplayImage = true;
				init( );
				var Seite = document.getElementById('body');
				Seite.className = 'inview';
			}
			
			function init(  )
			{
				if( bDisplayImage )
				{
					DisplayImageBackground();
					DisplayImageBox();
					checkMoveArrows();
					window.scrollTo(0,0);
				}
			}
			
			function dispose()
			{
				bDisplayImage = false;
				var Anzeigebereich = document.getElementById('pictureframeset');
				Anzeigebereich.className = 'off';
				
				var Hintergrund = document.getElementById('picturebackground');
				Hintergrund.className = 'off';
				
				var Seite = document.getElementById('body');
				Seite.className = '';
			}
