

<!-- ... Quelle Dummy ...

function bglayer(){}

// ... Ende Dummy ... -->




<!-- ... Quelle Beispiel ...

// Browserabhaengige Informationen
var	nn	= (navigator.appName == "Netscape") ? true : false

// Bildinformationen
var	imgURL		= "kg/bakg1.gif"
var	imgWidth	= 300
var	imgHeight	= 200

// Darstellungsinformationen
var	imgStep	= 50	// Zeitintervall in ms
var	imgIncX	= 1	// horizontale Schrittweite
var	imgIncY	= 2	// vertikale Schrittweite

// Statusinformationen
var	imgDirX	= 1
var	imgDirY	= 1

// Zentrieren des Hintergrundbilds
function bgstep()
{
	var	iWidth	= (nn ? innerWidth : Number(document.body.clientWidth))
	var	iHeight	= (nn ? innerHeight : Number(document.body.clientHeight))

	var	ttop	= 0
	var	tleft	= 0

	with(nn ? document.Bild : Bild)
	{
		// Kein Platz fuer die Darstellung?
		if((imgWidth + imgIncX) > iWidth ||
			(imgHeight + imgIncY) > iHeight)
		{
			visibility	= false
			return
		}
		if(nn)
		{
			tleft	= left
			ttop	= top
		}
		else
		{
			tleft	= parseInt(style.left)
			ttop	= parseInt(style.top)
		}
		if(isNaN(tleft))
			tleft	= 0
		if(isNaN(ttop))
			ttop	= 0

		// Positionskorrektur nach Fensterveraenderung
		if(tleft + imgWidth > iWidth)
			tleft	= iWidth - imgWidth
		if(ttop + imgHeight > iHeight)
			ttop	= iHeight - imgHeight

		// Neupositionierung
		tleft	+= imgDirX * imgIncX
		ttop	+= imgDirY * imgIncY
		if(tleft + imgWidth > iWidth)
		{
			imgDirX	*= -1
			tleft	= 2 * (iWidth - imgWidth) - tleft
		}
		if(ttop + imgHeight > iHeight)
		{
			imgDirY	*= -1
			ttop	= 2 * (iHeight - imgHeight) - ttop
		}
		if(tleft < 0)
		{
			imgDirX	*= -1
			tleft	= -tleft
		}
		if(ttop < 0)
		{
			imgDirY	*= -1
			ttop	= -ttop
		}
		if(nn)
		{
			left	= tleft
			top	= ttop
		}
		else
		{
			style.left	= tleft
			style.top	= ttop
		}
		visibility	= true
	}
	setTimeout("bgstep()", imgStep)
}

// Initialisierung der Darstellung
function bglayer()
{
	with(nn ? document.Bild : Bild)
	{
		if(nn)
		{
			left	= 0
			top	= 0
			width	= imgWidth
			height	= imgHeight
			with(document)
			{
				open("text/html")
				write("<IMG SRC=\"" + imgURL + "\" " +
					"WIDTH=" + imgWidth + " " +
					"HEIGHT=" + imgHeight + " ALT=\"\">")
				close()
			}
		}
		else
		{
			style.left	= 0
			style.top	= 0
			style.width	= imgWidth
			style.height	= imgHeight
			innerHTML	= "<IMG SRC=\"" + imgURL + "\" " +
						"WIDTH=" + imgWidth + " " +
						"HEIGHT=" + imgHeight + " ALT=\"\">"
		}
		setTimeout("bgstep()", imgStep)
	}
}

// -->




