function Fensterweite()
{
    if (navigator.userAgent.indexOf("MSIE") > -1 && navigator.userAgent.indexOf("Opera") == -1
        && navigator.userAgent.indexOf("Safari") == -1 && navigator.userAgent.indexOf("Netscape") == -1) {
         return document.documentElement.offsetWidth;
    } else {
         return window.innerWidth;
    }
}

function Fensterhoehe()
{
    if (navigator.userAgent.indexOf("MSIE") > -1  && navigator.userAgent.indexOf("Opera") == -1
        && navigator.userAgent.indexOf("Safari") == -1 && navigator.userAgent.indexOf("Netscape") == -1) {
         return document.documentElement.offsetHeight;
    } else {
         return window.innerHeight;
    }
}
function neuAufbau()
{
     if (document.getElementById('top_nav').style.width != Fensterweite() || document.getElementById('subnav').style.width != Fensterhoehe())
         location.href = location.href;
}
// Funktion zum Öffnen eines neuen Fensters
function neues_Fenster(URL)
        {
        newWindow = window.open(URL, "Druckversion");
        window.newWindow.focus();
        return newWindow;
        }

//Funktion um eine DIV anzuzeigen und auszublenden
function einblenden (divid) {
    if (document.getElementById) {
    window.onResize = null;
    document.getElementById(divid).style.display = "block";
    //window.setTimeout('window.onresize = neuAufbau', 500);
    }
}
function ausblenden (divid) {
    if (document.getElementById) {
    document.getElementById(divid).style.display = "none";
    }
}
//Funktion um die Farbe einer Tabellenzeile zu ändern
function farbe_aendern(a) {
    document.getElementById(a).style.backgroundColor = '#ffb1b1';
}
function farbe_zurueck(a) {
    document.getElementById(a).style.backgroundColor = '#A4EA80';
}
function farbe_aendern2(a) {
    document.getElementById(a).style.backgroundColor = '#ffb1b1';
}
function farbe_zurueck2(a) {
    document.getElementById(a).style.backgroundColor = '#66CC33';
}

// Drag and Drop

// gueltig fuer Netscape ab Version 6, Mozilla, Internet Explorer ab Version 4

//Das Objekt, das gerade bewegt wird.
var dragobjekt = null;

// Position, an der das Objekt angeklickt wurde.
var dragx = 0;
var dragy = 0;

// Mausposition
var posx = 0;
var posy = 0;


function draginit() {
 // Initialisierung der Überwachung der Events

  document.onmousemove = drag;
  document.onmouseup = dragstop;
}


function dragstart(element) {
   //Wird aufgerufen, wenn ein Objekt bewegt werden soll.

  dragobjekt = element;
  dragx = posx - dragobjekt.offsetLeft;
  dragy = posy - dragobjekt.offsetTop;
}


function dragstop() {
  //Wird aufgerufen, wenn ein Objekt nicht mehr bewegt werden soll.

  dragobjekt=null;
}


function drag(ereignis) {
  //Wird aufgerufen, wenn die Maus bewegt wird und bewegt bei Bedarf das Objekt.

  posx = document.all ? window.event.clientX : ereignis.pageX;
  posy = document.all ? window.event.clientY : ereignis.pageY;
  if(dragobjekt != null) {
    dragobjekt.style.left = (posx - dragx) + "px";
    dragobjekt.style.top = (posy - dragy) + "px";
  }
}