<!--
var FadeTimer = null;
var MAX_FADE_VALUE = 0.5;
var fadeAmount = 0.01;
var fadeValue = 0;
var fadeInterval = 1;
var isIE = navigator.userAgent.indexOf("MSIE") > -1 ? true : false;
var isNoIE = !isIE;

function FadeIn()
{
	if (document.getElementById("InfoBox").style.display != "block")
	{
		document.getElementById("InfoBox").style.display = "block";
    }
	var e = DragObject;
	if (e)
	{
		if (FadeTimer == null)
		{
			FadeTimer = window.setInterval('FadeIn()', fadeInterval);
			fadeValue = 0;
		}
		else
		{
			fadeValue = fadeValue + fadeAmount;
			if (fadeValue >= MAX_FADE_VALUE)
			{
				window.clearInterval(FadeTimer);
				FadeTimer = null;
				fadeValue = MAX_FADE_VALUE;
			}
			setOpacity(e, fadeValue);
		}
	}
}

function hideInfoBox()
{
	if (FadeTimer != null)
	{
		window.clearInterval(FadeTimer);
		FadeTimer = null;
    }
    fadeValue = 0;
    setOpacity(document.getElementById("InfoBox"), fadeValue);
    document.getElementById("InfoBox").style.display = "none";
}

function setOpacity(el, val)
{
	if (el)
	{
		if (isNoIE)
		{
			el.style.opacity = val;
		}
		else
		{
			el.filters.alpha.opacity = parseInt(val * 100);
		}
    }
}

/* --- Galerie-Funktionen --- */
//  HINWEIS: Nicht aendern!

var ImageList = new Array();
var position = -1;
var imagePath = "";
var InfoBoxTitle = "CLICK FOR NEXT IMAGE";

function addImage(src, title, desc)
{
	var count = ImageList.length;
	ImageList[count] = new Object();
	ImageList[count]["src"] = imagePath + src;
	ImageList[count]["title"] = title;
	ImageList[count]["desc"] = desc;
}

function nextImage()
{
	position = position + 1;
	if (position >= ImageList.length)
		position = 0;
	refreshView();
	DragStop();
}

function refreshView()
{
	var bild = document.getElementById("Bild");
	if (bild != null)
	{
		bild.src = ImageList[position]["src"];
	}
	var infoText = document.getElementById("InfoBox");
	if (infoText != null)
	{
		var content = "";
		content += "" + InfoBoxTitle + "<br><br>";
		content += (position+1) + "/" + ImageList.length + " <b><br>" + ImageList[position]["title"] + "</b><br>";
		if (ImageList[position]["desc"] != "")
			content += "" + ImageList[position]["desc"] + "<br>";
		infoText.innerHTML = content;
	}
}

function setImagePath(path)
{
	imagePath = path;
}

function setInfoBoxTitle(title)
{
	InfoBoxTitle = title;
}

/* InfoBox Implementierung */

var DragObject = null;
//var DragX = 0;
//var DragY = 0;
var MouseX = 0;
var MouseY = 0;
var OffsetX = 0;
var OffsetY = 0;

function InitInfoBox()
{
	document.getElementById("InfoBox").style.display = "none";
	document.onmousemove = Drag;
	nextImage();
}

function DragStart(id)
{
	DragObject = document.getElementById(id);
	FadeIn(DragObject);
}

function Drag(anEvent)
{
	OffsetX = isIE ? document.body.scrollLeft : 0;
    OffsetY = isIE ? document.body.scrollTop : 0;
	MouseX = document.all ? window.event.clientX : anEvent.pageX;
	MouseY = document.all ? window.event.clientY : anEvent.pageY;

	if (DragObject != null)
	{
    	MouseX += OffsetX;
       MouseY += OffsetY;
	   DragObject.style.left = (MouseX + 10) + "px";
       DragObject.style.top = (MouseY - parseInt(DragObject.offsetHeight) - 20) + "px";
	}
}

function DragStop()
{
	hideInfoBox();
	DragObject = null;
}

function StartDragHelper(id)
{
	if (DragObject == null) DragStart(id);
}
//-->