var wl = null;

var inL = false;
var inD = false;

function inLink(cat) {
  inL = true;
  showWeblinks(cat)
}
function outLink() {
  inL = false;
  window.setTimeout("checkMouse()", 333);
}
function inDiv() {
  inD = true;
}
function outDiv() {
  inD = false;
  window.setTimeout("checkMouse()", 333);
}
function checkMouse() {
  if(!inL && !inD) hideWeblinks();
}

function showWeblinks(cat) {

  wl = window.document.getElementById('weblinks');
  wlt = window.document.getElementById('weblinks_td');
  
  // Hintergrundfarbe des Links ändern
  wlt.style.backgroundColor = "#752629";
  
  // Positionen bestimmen
  var t = 0;
  t = wlt.offsetTop;
  t += wlt.offsetParent.offsetTop;
  t += wlt.offsetParent.offsetParent.offsetTop;
  t += wlt.offsetParent.offsetParent.offsetParent.offsetTop;
  t += wlt.offsetParent.offsetParent.offsetParent.offsetParent.offsetTop;
  t += wlt.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetTop;
  t += wlt.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetTop;
  t += wlt.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetTop;

  var l = 0;
  l = wlt.offsetLeft;
  l += wlt.offsetParent.offsetLeft;
  l += wlt.offsetParent.offsetParent.offsetLeft;
  l += wlt.offsetParent.offsetParent.offsetParent.offsetLeft;
  l += wlt.offsetParent.offsetParent.offsetParent.offsetParent.offsetLeft;
  l += wlt.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetLeft;
  l += wlt.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetLeft;
  l += wlt.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetLeft;
    
  // Positionen festlegen und anzeigen
  wl.style.position = "absolute";
  wl.style.display = "block";
  t = t - wl.offsetHeight;
  l = l;
  if(document.all) l = l + 1;
  if(cat=="themen") l = l - 50;
  wl.style.top = t;
  wl.style.left = l;
  wl.style.visibility = "";

}

function hideWeblinks() {
  // Hintergrundfarbe des Links zurücksetzen
  wl = window.document.getElementById('weblinks_td');
  wl.style.backgroundColor = "#4E689C";
  // Weblinks verstecken
  wl = window.document.getElementById('weblinks');
  wl.style.visibility = "hidden";
  wl.style.display = "none";
}


var wl_c = null;

var inL_c = false;
var inD_c = false;
var wl_cur_cid = 0;

function inLink_c(cid) {
  inL_c = true;
  showWeblinks_c(cid);
}
function outLink_c(cid) {
  inL_c = false;
  window.setTimeout("checkMouse_c("+cid+")", 100);
}
function inDiv_c(cid) {
  inD_c = true;
}
function outDiv_c(cid) {
  inD_c = false;
  window.setTimeout("checkMouse_c("+cid+")", 100);
}
function checkMouse_c(cid) {
  if((!inL_c && !inD_c) || cid!=wb_cur_cid) hideWeblinks_c(cid);
}

function showWeblinks_c(cid) {

  //if(cid!=wb_cur_cid) hideWeblinks_c(wb_cur_cid);
  
  wl_c = window.document.getElementById('weblinks_c_'+cid);
  wlt_c = window.document.getElementById('weblinks_td_c_'+cid);

  wlt_c.style.backgroundColor = "#6B7381";
  wlt_c.style.color = '#FFFFFF';
  
  wl_c.style.position = "absolute";
  wl_c.style.display = "block";
  wl_c.style.visibility = "";
  wb_cur_cid = cid;

}

function hideWeblinks_c(cid) {
  // Hintergrundfarbe des Links zurücksetzen
  wl_c = window.document.getElementById('weblinks_td_c_'+cid);
  wl_c.style.backgroundColor = "#FFFFFF";
  wl_c.style.color = '#000000';
  // Weblinks verstecken
  wl_c = window.document.getElementById('weblinks_c_'+cid);
  wl_c.style.visibility = "hidden";
  wl_c.style.display = "none";
}
