/***************************************************************************
 *                                   tt.js
 *                            -------------------
 *   begin                : Monday, Feb. 02, 2004
 *   copyright            : (C) 2004-2005 Markus Fischer
 *   email                : N/A
 *
 *   $Id: tt.js,v 1.0.2 2004/02/02 21:15:00 fisch Exp $
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;
var toolTipSTYLE="";
var toolScrollSTYLE="";
offsetX = 0;
offsetY = 20;


function initToolTips()
{
  if(ns4||ns6||ie4)
  {
    if(ns4) toolTipSTYLE = document.toolTipLayer;
    else if(ns6) toolTipSTYLE = document.getElementById("toolTipLayer").style;
    else if(ie4) toolTipSTYLE = document.all.toolTipLayer.style;
    if(ns4) document.captureEvents(Event.MOUSEMOVE);
    else
    {
      toolTipSTYLE.visibility = "visible";
      toolTipSTYLE.display = "none";
    }
    document.onmousemove = moveToMouseLoc;
  }
}

function toolTip(msg, fg, bg, w)
{
	var tt_tablewidth = '';
  if(toolTip.arguments.length < 1)
  {
    if(ns4) toolTipSTYLE.visibility = "hidden";
    else toolTipSTYLE.display = "none";
  }
  else
  {
    if(!fg) fg = "#777777";
    if(!bg) bg = "#FFFFFF";
		if(w)
		{
			tt_tablewidth = ' width="'+w+'" ';
		}
    var content =
    '<table'+tt_tablewidth+' border="0" cellspacing="0" cellpadding="1" bgcolor="' + fg + '"><td>' +
    '<table'+tt_tablewidth+' border="0" cellspacing="0" cellpadding="1" bgcolor="' + bg + 
    '"><td align="center"><font face="sans-serif" color="' + fg +
    '" size="2">' + msg +
    '</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';
			if(w) toolTipSTYLE.width = w;
    }
  }
}

function moveToMouseLoc(e)
{
  if(ns4||ns6)
  {
    x = e.pageX;
    y = e.pageY;
  }
  else
  {
		//z = document.body.offsetHeight - 37;
    x = event.x + document.body.scrollLeft;
    y = event.y + document.body.scrollTop+0;
		/*if(y >= z) 
		{
			y = y - 150;
		}*/
  }
  toolTipSTYLE.left = x + offsetX;
  toolTipSTYLE.top = y + offsetY;
  return true;
}

function initmoveDIV()
{
	toolScrollSTYLE = document.all.TubScroll.style;
}

function moveDIV(Intervall,b)
{
	var oldtop = toolScrollSTYLE.top;
	oldtop = oldtop.replace('px','');
	var newtop = parseInt(oldtop);
	if(b == 1)
	{
		if(newtop < 0)
		{
			newtop = newtop + Intervall;
		}
	}
	else
	{
		newtop = newtop - Intervall;
	}
	toolScrollSTYLE.top = newtop;
}

// /End Script

