var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;
offsetX = -420;
offsetY = -120;
var toolTipSTYLE = "";
var ergebnisSTYLE = "";
//var alleDetails = true;
function initToolTips()
{
  if(ns4||ns6||ie4)
  {
    if(ns4){toolTipSTYLE = document.toolTipLayer; ergebnisSTYLE = document.ergebnisLayer;}
    else if(ns6){toolTipSTYLE = document.getElementById("toolTipLayer").style; ergebnisSTYLE = document.getElementById("ergebnisLayer").style;}
    else if(ie4){toolTipSTYLE = document.all.toolTipLayer.style; ergebnisSTYLE = document.all.ergebnisLayer.style;}
    if(ns4) document.captureEvents(Event.MOUSEMOVE);
    else
    {
      toolTipSTYLE.visibility = "visible";
      toolTipSTYLE.display = "none";
      ergebnisSTYLE.visibility = "visible";
      ergebnisSTYLE.display = "none";
    };
  toolTipSTYLE.left = 0;
  toolTipSTYLE.top = 0;
//  return true;
    document.onmousemove = moveToMouseLoc;
  };
};

// Auswahlanzeige
function toolTip(msg, fg, bg)
{
  	var a = msg.substr(0,1);
  	if(a == ">")
  	{
  		msg = msg + window.document.detail.such.value;
		
	}
  if(toolTip.arguments.length < 1) // hide
  {
    if(ns4) toolTipSTYLE.visibility = "hidden";
    else toolTipSTYLE.display = "none";
  }
  else // show
  {
    if(!fg) fg = "#333333";
    if(!bg) bg = "#ffcc33";
    var content =
    '<br><table border="0" width="258" cellspacing="0" cellpadding="1" bgcolor="' + fg + '"><td>' +
    '<table border="0" width= "255" cellspacing="0" cellpadding="2" bgcolor="' + bg + 
    '"><td align="left"><font face="arial" color="' + fg +
    '" size="-1">  ' + msg +
    '&nbsp\;</font></td></table></td></table>';
    if(ns4)
    {
      toolTipSTYLE.document.write(content);
      toolTipSTYLE.document.close();
      toolTipSTYLE.visibility = "visible";
    };
    if(ns6)
    {
      document.getElementById("toolTipLayer").innerHTML = content;
      toolTipSTYLE.display='block'
    };
    if(ie4)
    {
      document.all("toolTipLayer").innerHTML=content;
      toolTipSTYLE.display='block'
    };
  };
};

// Ergebnisanzeige

function ergebnis(land, landnummer, land_, flagge, t1, flaeche, t2, einwohner, t3, hauptstadt, erdteil, t4, sprachen, t5, religionen, gr, kl, vorh, bem, ex_l, ex_g, check, fg, bg)
{
//alert("flaggen/" + flagge);
  if(ergebnis.arguments.length < 1) // hide
  {
    if(ns4) ergebnisSTYLE.visibility = "hidden";
    else ergebnisSTYLE.display = "none";
  }
  else // show
  {
    if(!fg) fg = "#333333";
    if(!bg) bg = "#ffcc33";
    var content =
	'<br><table border="0" width="400" cellspacing="0" cellpadding="1" bgcolor="' + bg + '"><td>' +
	'<table border="0" bordercolor ="' + bg +'" width="397" cellspacing="0" cellpadding="1" bgcolor="' + fg +
	'"><tr><td width="62" valign="top">' + '<img src = "flaggen/' + flagge + '"><font face="arial" color="' + bg +
	'" size="-2"><br><br><br><br><br><br><br><br><br><br><font class="anmerkung">' + check + 
	'</font></td><td valign="top" align="left"><font face="arial" color="' + bg +
	'" size="-1">  ' + land + '</font><br><font face="arial" color="' + bg + '" size="-2">' + land_ + 
	'<br>(' + erdteil + ')<br>' + t1 + ':<b> ' + flaeche + ' kmē</b><br>' + t2 + ':<b> ' + einwohner +
	 '</b><br>' + t3 + ':<b> ' + hauptstadt + '</b><br>' + t4 + ':<b> ' + sprachen + '</b><br>' +t5 + ':<b> ' + religionen + '</b><br>' +
	 '<font color="#FF6633">1 ' + gr + ' = 100 ' + kl + '</font><br>' + ex_l + '<br>' + ex_g + '<br>' + bem +
    '&nbsp\;<br>('+ landnummer + ')</font></td></table></td></table>';
//    alert(content);
	if(ns4)
    {
      ergebnisSTYLE.document.write(content);
      ergebnisSTYLE.document.close();
      ergebnisSTYLE.visibility = "visible";
    };
    if(ns6)
    {
      document.getElementById("ergebnisLayer").innerHTML = content;
      ergebnisSTYLE.display='block'
    };
    if(ie4)
    {
      document.all("ergebnisLayer").innerHTML=content;
      ergebnisSTYLE.display='block'
    };
  };
};
// zum Ergebnisfenster
function moveToMouseLoc(e)
{
  if(ns4||ns6)
  {
    x = e.pageX;
    y = e.pageY;
  }
  else
  {
    x = event.x + document.body.scrollLeft;
    y = event.y + document.body.scrollTop;
  };
  ergebnisSTYLE.left = x + offsetX;
  ergebnisSTYLE.top = y + offsetY;
  return true;
};
// zum Auswahlfenster
/*function moveToMouseLoc(e)
{
  if(ns4||ns6)
  {
    x = e.pageX;
    y = e.pageY;
  }
  else
  {
    x = event.x + document.body.scrollLeft;
    y = event.y + document.body.scrollTop;
  };
  toolTipSTYLE.left = 0;
  toolTipSTYLE.top = 0;
  return true;
};
*/
