  var mouseX = 0, mouseY = 0;
  var isvisible = null;

  window.onload = init;

  function init()
  {
    if (window.Event)
      if (navigator.userAgent.indexOf("Konqueror") > -1)
        window.captureEvents(Event.MOUSEMOVE);
      else
        document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = setMousePos;
  }

  function setMousePos(e)
  {
    if (document.all) {
      mouseX = event.clientX + document.body.scrollLeft;
      mouseY = event.clientY + document.body.scrollTop;
    } else {
      mouseX = e.pageX;
      mouseY = e.pageY;
    }
    if (mouseX < 0)
      mouseX = 0;
    if (mouseY < 0)
      mouseY = 0;
    return true;
  }

  function getContainer(id)
  {
    if (document.all)
      return document.all(id);
    else if (document.layers)
      return document.layers[id];
    else if (document.getElementById)
      return document.getElementById(id);
  }

  function getContainerStyle(id)
  {
    if (document.layers)
      return getContainer(id);
    else if (document.all || document.getElementById)
      return getContainer(id).style;
  }

  function getOffsetX()
  {
    if (document.all)
      return document.body.scrollLeft;
    else if (document.layers || document.getElementById)
      return window.pageXOffset;
  }

  function getOffsetY()
  {
    if (document.all)
      return document.body.scrollTop;
    else if (document.layers || document.getElementById)
      return window.pageYOffset;
  }

  function hideContainer(id)
  {
    getContainerStyle(id).visibility = "hidden";
  }

  function showContainer(id)
  {
    if (isvisible != null)
      hideContainer(isvisible);

    isvisible = id;
    var newX = mouseX + 10;
    if (newX < getOffsetX())
      newX = getOffsetX();

    var newY = mouseY - 100;
    if (newY < getOffsetY())
      newY = getOffsetY();

    //newY = mouseY - 100;
    if (document.all && getContainerStyle(id).posLeft) {
      getContainerStyle(id).posLeft = newX;
      getContainerStyle(id).posTop = newY;
    } else if (document.getElementById) {
      getContainerStyle(id).left = newX + "px";
      getContainerStyle(id).top = newY + "px";
    } else if (document.layers) {
      getContainerStyle(id).left = newX;
      getContainerStyle(id).top = newY;
    }

    getContainerStyle(id).visibility = "visible";
  }
  
function OpenNewWindow(url) {
	windowName = "Fahrplan";
    options  = "";
	options += "top=0,";
	options += "left=0,";
    options += "toolbar=0,";
    options += "location=0,";
    options += "directories=0,";
    options += "status=0,";
    options += "menubar=0,";
    options += "scrollbars=1,";
    options += "resizable=1,";
    options += "width=500,";
    options += "height=600";
    win = window.open(url, windowName , options);
    if (!win.opener) {
    	win.opener = window;
    }
}
  


function swapImgRestore() {
	var i,x,a=document.sr;
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) {
  		x.src=x.oSrc;
	}
}


function findObj(n, d) {
	var p,i,x;
	if(!d) {
		d=document;
	}
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document;
		n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all) {
		x=d.all[n];
	}
	for (i=0;!x&&i<d.forms.length;i++) {
		x=d.forms[i][n];
	}
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) {
		x=findObj(n,d.layers[i].document);
	}
	if(!x && d.getElementById) {
		x=d.getElementById(n);
	}
	return x;
}

function swapImage() {
	var i,j=0,x,a=swapImage.arguments;
	document.sr=new Array;
	for(i=0;i<(a.length-2);i+=3) {
		if ((x=findObj(a[i]))!=null) {
			document.sr[j++]=x;
			if(!x.oSrc) {
				x.oSrc=x.src;
			}
			x.src=a[i+2];
		}
	}
}

function Zeit() 
	{
	 var Jetzt = new Date();
	 var Tag = Jetzt.getDate();
	 var Monat = Jetzt.getMonth() + 1;
	 var Jahr = Jetzt.getYear();
	 if(Jahr < 999) Jahr += 1900;
	 var Vortag  = ((Tag < 10) ? "0" : "");
	 var Vormon  = ((Monat < 10) ? ".0" : ".");
	 var Datum = Vortag + Tag + Vormon + Monat  + "." + Jahr;
	 document.write("" + Datum + "")
}
