BB = (((navigator.appName == "Netscape") &&
	(parseInt(navigator.appVersion) >= 3 )) ||
	((navigator.appName == "Microsoft Internet Explorer") &&
	(parseInt(navigator.appVersion) >= 4 )));

KopfLeft = 0;
KopfActive = 0;

HF1 = new Image();
HF2 = new Image();
HF3 = new Image();
HF4 = new Image();
HF5 = new Image();

HFState = 0;
HFCount = 0;
HFActive = 0;
HFPos = -100;
HFHeight = 0;

MouseXPos = 0;
MouseYPos = 0;


function kopf()
{
	range = document.getElementById("kopf");

	if(KopfActive == 1)
	{
		KopfLeft = KopfLeft + 5;
		range.style.left = KopfLeft;

		if(KopfLeft == -55)
		{
			range.style.visibility = "visible";
			range.style.top = (screen.availHeight - 182) * Math.random();
		}

		if(KopfLeft == 0)
		{
			KopfActive = 2;
			window.setTimeout("kopf()", 1000);
		}
		else
		{
			window.setTimeout("kopf()", 20);
		}

	}
	else
	{
		if(KopfLeft == -60)
		{
			range.style.visibility = "hidden";
			KopfActive = 0;
		}
		else
		{
			KopfLeft = KopfLeft - 5;
			range.style.left = KopfLeft;
			window.setTimeout("kopf()", 20);
		}
	}
}

function startkopf()
{
	if(BB)
	{
		if(KopfActive == 0)
		{
			KopfActive = 1;
			KopfLeft = -60
			window.setTimeout("kopf()", 1000);

		}
	}
}



function MMove(Ev)
{
	if(navigator.appName == "Microsoft Internet Explorer")
	{

		MouseXPos = window.event.x;
		MouseYPos = window.event.y;
	}
	else
	{
		MouseXPos = Ev.pageX;
		MouseYPos = Ev.pageY;
	}
}

document.onmousemove = MMove;

function flug()
{
	pic = document.getElementById("FHummel");
	range = document.getElementById("HUMMELFLUG");
	range.style.left = HFPos * 5;
	range.style.visibility = "visible";
	HFPos = HFPos + 1;


	if (HF5.complete)
	{

		switch (HFState)
		{
			case 0:
				pic.src = HF2.src;
				break;
			case 1:
				pic.src = HF3.src;
				break;
			case 2:
				pic.src = HF4.src;
				break;
			case 3:
				pic.src = HF5.src;
				break;
			case 4:
				pic.src = HF4.src;
				break;
			case 5:
				pic.src = HF3.src;
				break;
			case 6:
				pic.src = HF2.src;
				break;
			case 7:
				pic.src = HF1.src;
				HFCount = HFCount + 1;
			break;
		}

		if (HFState == 7)
			HFState = 0;
		else
			HFState = HFState + 1;


		if(navigator.appName == "Microsoft Internet Explorer")
			WindowWidth = document.getElementsByTagName("body")[0].offsetWidth - 20;
		else
			WindowWidth = window.innerWidth;


		if(HFHeight - MouseYPos > 100)
			HFHeight = HFHeight - 4;
		else if(HFHeight - MouseYPos > 66)
			HFHeight = HFHeight - 3;
		else if(HFHeight - MouseYPos > 33)
			HFHeight = HFHeight - 2;
		else if(HFHeight - MouseYPos > 5)
			HFHeight = HFHeight - 1;
		else if(MouseYPos - HFHeight > 100)
			HFHeight = HFHeight + 4;
		else if(MouseYPos - HFHeight > 66)
			HFHeight = HFHeight + 3;
		else if(MouseYPos - HFHeight > 33)
			HFHeight = HFHeight + 2;
		else if(MouseYPos - HFHeight > 5)
			HFHeight = HFHeight + 1;
		range.style.top = HFHeight;

		if((HFPos * 5) >= (WindowWidth))
		{
			range.style.visibility = "hidden";
			range.style.left = 0;
			HFActive = 0;
		}
		else if((HFPos * 5) < (WindowWidth - 100))
		{
			range.style.width = 100;
			window.setTimeout('flug()', 30);
		}
		else
		{
			range.style.width = WindowWidth - (HFPos * 5);
			window.setTimeout('flug()', 30);
		}
	}
	else
	{
		window.setTimeout('flug()', 200);
	}

}

function startflug()
{

	if(HFActive == 0)
	{

		HFActive = 1;
		HFState=0;
		HFCount=0;
		HFPos = -20

		if(navigator.appName == "Microsoft Internet Explorer")
			WindowHeight = document.getElementsByTagName("body")[0].offsetHeight;
		else
			WindowHeight = window.innerHeight;

		range = document.getElementById("HUMMELFLUG");
		HFHeight = (WindowHeight - 80) * Math.random();
		range.style.top = HFHeight;

		if (HF1.src == "")
		{
			HF1.src = "hummel1.gif";
			HF2.src = "hummel2.gif";
			HF3.src = "hummel3.gif";
			HF4.src = "hummel4.gif";
			HF5.src = "hummel5.gif";
		}

		window.setTimeout('flug()', 1000)

	}
}

