/*
Die Definition der folgenden Arrays mit dem Statement "new"
muß zwingend im ersten aufgerufenen JS hinterlegt sein,
das diese Arrays verwendet.
*/

text=new Array();
title=new Array();
pos=new Array();

var x = 0;
var xx=0;
var yy=20;
var y = 0;
var showit = 0;

// Browsercheck
ns = (document.layers)? true:false
ie4 = (document.all)? true:false
ie5 = false;

if (ie4) {
	if (navigator.userAgent.indexOf('MSIE 5')>0) {
  	ie5 = true;
  }
}

if ( (ns) || (ie4) )
{
	if (ns) over = document.popDiv
  if (ie4) over = popDiv.style
  document.onmousemove = mouseMove
  if (ns) document.captureEvents(Event.MOUSEMOVE)
}

//===============
function wtl(txt)
{
	if (ns) {
		var lll = document.popDiv.document
		lll.write(txt)
		lll.close()
	} else {
		if (ie4) document.all["popDiv"].innerHTML = txt
	}
}

function show(obj) {
	if (ns) obj.visibility = "show"
  else if (ie4) obj.visibility = "visible"
}

function hide(obj) {
	if (ns) obj.visibility = "hide"
  else if (ie4) obj.visibility = "hidden"
}

function moveTo(obj,lx,ly) {
	obj.left = lx
	obj.top = ly
}

function hideit()
  {
	if ( (ns) || (ie4) ) {
		showit = 0;
		hide(over);
	}
}

// Popup zusammenbasteln

function rpopit(text, title) {
	var diff
	var nWinWidth

	if (text > "")
	{
	// Kleine Zeitverzögerung

	date = new Date();
	jetzt = date.getTime();
	diff = 0;

	while (diff < 800)
	{
	date = new Date();
	diff = date.getTime() - jetzt;
	}

	nWinWidth=screen.width/4;  // 25% der Bildschirmbreite

	if (nWinWidth > 250)
		nWinWidth = 250;

	txt = "<TABLE WIDTH=" + nWinWidth + "px BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\"#4D5C64\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0><TR><TD><B><FONT face=\"Arial, Helvetica\" size=-1 color=\"#F2C880\">"+title+"</FONT></B></TD></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=5 CELLSPACING=0 BGCOLOR=\"#647782\"><TR><TD><FONT face=\"Arial, Helvetica\" COLOR=\"#F2C880\" size=-1>"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>"
	wtl(txt);
	display_it();
	}
}

function popit(i) {
	/*
	// Positionierung (Rechts, Mitte, Links)
	if ((i == 1) || (i == 4) || (i == 7))
	{
		xx=0;
	}
	else if ((i == 2) || (i == 5) || (i == 8))
	{
		xx=-175;
	}
	else if ((i == 3) || (i == 6) || (i == 9))
	{
		xx=-340;
	}
	*/

	xx=5
	yy=0

	// Positionierung (Links, Rechts)
	if (pos[i] == "L" )
	  { xx=-250; }

	// Negative Werte bringen das Fenster nach oben!
	if (pos[i] == "U" )
	  { yy=-30; }
	else
	// Positionierung (Oben, unten)
	if ( i > 100 )
		  { yy=-105; }

	if ( i == 201 )
	  	{ yy=-30; }

	rpopit(text[i],title[i]);
}

// ...und jetzt anzeigen

function display_it() {
	if ( (ns) || (ie4) ) {
		if (showit == 0) 	{
			moveTo(over,x+xx,y+yy);
			show(over);
			showit = 1;
		}
	}
}

// Auf mousemoves reagieren

function mouseMove(e) {
	if (ns) {x=e.pageX; y=e.pageY;}
	if (ie4) {x=event.x; y=event.y;}
	if (ie5) {x=event.x+document.body.scrollLeft; y=event.y+document.body.scrollTop;}
	if (showit) {moveTo(over,x+xx,y+yy);}
}


function dummy() {}