function $(id)
{
	if(document.getElementById)
    return document.getElementById(id);
  else if(document.all)
    return document.all[id];
  else
    return false;
}
function $$(id)
{
	return document.getElementsByName(id);
}

// PopUp öffnen
function wopen1(url,ziel)
{
  window.open(url,ziel,'resizable=yes,status=yes,scrollbars=yes,menubar=yes,toolbar=yes,location=yes');
}
function wopen12(url,ziel,width,height)
{
  window.open(url,ziel,'width='+width+',height='+height+'resizable=no,status=yes,scrollbars=auto,menubar=no,toolbar=no,location=no');
}
function wopen2(url,ziel)
{
  window.open(url,ziel,'resizable=yes,status=no,scrollbars=auto,menubar=no,toolbar=no,location=no');
}

// NL-Info anzeigen
function ShowInfo(id)
{
  info = $(id);
  info.style.display = 'block';
}

// NL-Info ausblenden
function HideInfo()
{
  info.style.display = 'none';
}

// NL-Info Position aktualisieren
function updateInfo(e)
{
  if(info!=null)
  {
    posx=0; posy=0;
    if (!e) e=window.event;
    if (e.pageX && e.pageY)
    {
      posx=e.pageX;
      posy=e.pageY;
    }
    else if (e.clientX && e.clientY)
    {
      if(document.compatMode && document.compatMode=="CSS1Compat")
      {
        posx=e.clientX + document.documentElement.scrollLeft;
        posy=e.clientY + document.documentElement.scrollTop;
      }
      else
      {
        posx=e.clientX + document.body.scrollLeft;
        posy=e.clientY + document.body.scrollTop;
      }
    }
    //window.status='posx: ' + posx + ' posy: ' + posy;
    info.style.top  = (posy - 104) + 'px';
    info.style.left = (posx + 1) + 'px';
  }
}

// Anfahrtskizze einblenden
function ShowCard()
{
  if(!zoom_in)
    zoom_in = true;
  pcard = $('p_skizze');
  card = $('skizze');
  pcard.style.display = 'block';
  card.style.display = 'block';
  if(card_height<302)
  {
    card_height += 5;
    if(card!=null)
    {
      pcard.style.height = card_height + 'px';
      card.style.height = card_height + 'px';
    }
    timer = window.setTimeout("ShowCard()",0.1);
  }
}

// Anfahrtskizze ausblenden
function HideCard()
{
  if(zoom_in)
    zoom_in = false;
  pcard = $('p_skizze');
  card = $('skizze');
  if(card_height>0)
  {
    card_height -= 10;
    if(card!=null)
    {
      pcard.style.height = card_height + 'px';
      card.style.height = card_height + 'px';
    }
    timer = window.setTimeout("HideCard()",0.1);
  }
  else
  {
    pcard.style.display = 'none';
    card.style.display = 'none';
  }
}

// Anfahrtskizze
function Card()
{
  window.clearTimeout(timer);
  if(!zoom_in)
    timer = window.setTimeout("ShowCard()",0.1);
  else
    timer = window.setTimeout("HideCard()",0.1);
}

// Globale Variablen initialisieren
var zoom_in = false;
var card_height = 0;
var info = null;
var timer = null;

document.onmousemove = updateInfo;
