var Breite = 1024;
var Hoehe  = 768;

var isDOM   = (typeof(document.getElementsByTagName) != 'undefined' && typeof(document.createElement) != 'undefined') ? 1 : 0;
var isIE4   = (typeof(document.all) != 'undefined' && parseInt(navigator.appVersion) >= 4) ? 1 : 0;
var isNS4   = (typeof(document.layers) != 'undefined') ? 1 : 0;
var capable = (isDOM || isIE4 || isNS4) ? 1 : 0;
    // Uggly fix for Opera and Konqueror 2.2 that are half DOM compliant

if (capable) 
  {
  if (typeof(window.opera) != 'undefined') 
    {
    var browserName = ' ' + navigator.userAgent.toLowerCase();
    if ((browserName.indexOf('konqueror 7') == 0)) 
      {
      capable = 0;
      }
    }
  else if (typeof(navigator.userAgent) != 'undefined') 
    {
    var browserName = ' ' + navigator.userAgent.toLowerCase();
    if ((browserName.indexOf('konqueror') > 0) && (browserName.indexOf('konqueror/3') == 0)) 
      {
      capable = 0;
      }
    }
  }

// xClientWidth r5, Copyright 2001-2007 Michael Foster (Cross-Browser.com)
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL

function xClientWidth()
  {
  var v=0,d=document,w=window;
  if((!d.compatMode || d.compatMode == 'CSS1Compat') && !w.opera && d.documentElement && d.documentElement.clientWidth)
    {v=d.documentElement.clientWidth;}
  else if(d.body && d.body.clientWidth)
    {v=d.body.clientWidth;}
  else if(xDef(w.innerWidth,w.innerHeight,d.height)) 
    {
    v=w.innerWidth;
    if(d.height>w.innerHeight) v-=16;
    }
  return v;
  }

// xClientHeight r5, Copyright 2001-2007 Michael Foster (Cross-Browser.com)
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL

function xClientHeight() 
  {
  var v=0,d=document,w=window;
  if((!d.compatMode || d.compatMode == 'CSS1Compat') && !w.opera && d.documentElement && d.documentElement.clientHeight)
    {v=d.documentElement.clientHeight;}
  else if(d.body && d.body.clientHeight)
    {v=d.body.clientHeight;}
  else if(xDef(w.innerWidth,w.innerHeight,d.width)) 
    {
    v=w.innerHeight;
    if(d.width>w.innerWidth) v-=16;
    }
  return v;
  }

/* ==================================================================== */
/* Resize Handler				   			*/
/* ==================================================================== */

function neuAufbau () 
  {
  if (Weite != Fensterweite() || Hoehe != Fensterhoehe()) location.href = location.href;
  }

/* ==================================================================== */
/* Funktionen zum Ein-/und Ausblenden der Dropdownliste		*/
/* ==================================================================== */

function changeEbene(id,id1,size) 
  {
  if (isDOM) 
    {
      if (document.getElementById(id1).style.visibility=='hidden')
        { 
        document.getElementById(id1).style.visibility = "visible";
        document.getElementById(id).style.clip = "rect(auto 450px auto -450px)";
        }
      else
        {
        document.getElementById(id1).style.visibility = "hidden";
        document.getElementById(id).style.clip = "rect(0px auto "+size+"px 0px)"  
        }
      return true;
    }

  if (isNS4) 
    {
    if (this.document.layers[id1].visibility=='hide')
      {
      this.document.layers[id1].visibility = "show";
      this.document.layers[id].style.clip = "rect(auto 450px auto -450px)";
      }
    else  
      {
      this.document.layers[id1].visibility = "hide";
      this.document.layers[id].style.clip = "rect(0px auto "+size+"px 0px)";
      }
    return true;
    }

  if (isIE4) 
    {
    if (this.document.all[id1].style.visibility=='hidden')
      { 
      this.document.all[id1].style.visibility = "visible";
      this.document.all[id].style.clip = "rect(auto 450px auto -450px)";
      }
    else
      {
      this.document.all[id1].style.visibility = "hidden";
      this.document.all[id].style.clip = "rect(0px auto "+size+"px 0px)";
      }
    return true;
    }
  }

/* ==================================================================== */
/* Funktionen zum Markieren einer Tabellenzeile beim Drueberfahren	*/
/* ==================================================================== */
/* @param   object    the table row					*/
/* @param   string    the action calling this script (over or out)	*/
/* ==================================================================== */
/* @return  boolean  whether pointer is set or not			*/
/* ==================================================================== */

function setPointer(theRow, theAction)
  {
  var theCells = null;		          // Tabellenzeile (TR)
  var theDefaultColor = '#FFFFFF';	// Hintergrundfarbe Tabelle
  var thePointerColor = '#C0C0C0';	// Farbe Marker

  // 2. Gets the current row and exits if the browser can't get it
  if (typeof(document.getElementsByTagName) != 'undefined') 
    {
    theCells = theRow.getElementsByTagName('td');
    }
  else if (typeof(theRow.cells) != 'undefined') 
    {
    theCells = theRow.cells;
    }
  else 
    {
    return false;
    }

  // 3. Gets the current color...
  var rowCellsCnt  = theCells.length;
  var domDetect    = null;
  var currentColor = null;
  var newColor     = null;
  
  // 3.1 ... with DOM compatible browsers except Opera that does not return
  //         valid values with "getAttribute"
  if (typeof(window.opera) == 'undefined' && typeof(theCells[0].getAttribute) != 'undefined') 
    {
    currentColor = theCells[0].getAttribute('bgcolor');
    domDetect    = true;
    }
  // 3.2 ... with other browsers
  else 
    {
    currentColor = theCells[0].style.backgroundColor;
    domDetect    = false;
    } // end 3

  
  // 3.3 ... Opera changes colors set via HTML to rgb(r,g,b) format so fix it
  if (currentColor.indexOf("rgb") >= 0)
    {
    var rgbStr = currentColor.slice(currentColor.indexOf('(') + 1, currentColor.indexOf(')'));
    var rgbValues = rgbStr.split(",");
    currentColor = "#";
    var hexChars = "0123456789ABCDEF";
    for (var i = 0; i < 3; i++)
      {
      var v = rgbValues[i].valueOf();
      currentColor += hexChars.charAt(v/16) + hexChars.charAt(v%16);
      }
    }

  // 4. Defines the new color
  // 4.1 Current color is the default one
  if (currentColor == '' || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) 
    {
    if (theAction == 'over' && thePointerColor != '') 
      {
      newColor = '#C0C0C0';
//      newColor = thePointerColor;
      }
    }
  // 4.1.2 Current color is the pointer one
  else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()) 
    {
    if (theAction == 'out') 
      {
      newColor = theDefaultColor;
      }
    }
  // 5. Sets the new color...
  if (newColor) 
    {
    var c = null;
    // 5.1 ... with DOM compatible browsers except Opera
    if (domDetect) 
      {
      for (c = 0; c < rowCellsCnt; c++) 
        {
//        theCells[c].setAttribute('color', theDefaultColor, false);
        theCells[c].setAttribute('bgcolor', newColor, false);
//        alert(theDefaultColor);
        } // end for
      }
      // 5.2 ... with other browsers
    else 
      {
      for (c = 0; c < rowCellsCnt; c++) 
        {
        theCells[c].style.backgroundColor = newColor;
        theCells[c].style.color = theDefaultColor;
        }
      }
    } // end 5

  return true;
  } // end of the 'setPointer()' function

/* ==================================================================== */
/* Funktionen zum Markieren einer Tabellenzeile beim Drueberfahren	*/
/* ==================================================================== */
/* @param   object    the table row					*/
/* @param   string    the action calling this script (over or out)	*/
/* ==================================================================== */
/* @return  boolean  whether pointer is set or not			*/
/* ==================================================================== */

function setSprachePointer(theSpracheRow, theSpracheAction)
  {
  var theSpracheCells = null;		// Tabellenzeile (TR)
  var theSpracheDefaultColor = '#FFFFFF';	// Hintergrundfarbe Tabelle
  var theSprachePointerColor = '#C0C0C0';	// Farbe Marker

  // 2. Gets the current row and exits if the browser can't get it
  if (typeof(document.getElementsByTagName) != 'undefined') 
    {
    theSpracheCells = theSpracheRow.getElementsByTagName('td');
    }
  else if (typeof(theSpracheRow.cells) != 'undefined') 
    {
    theSpracheCells = theSpracheRow.cells;
    }
  else 
    {
    return false;
    }

  // 3. Gets the current color...
  var rowSpracheCellsCnt  = theSpracheCells.length;
  var domSpracheDetect    = null;
  var currentSpracheColor = null;
  var newSpracheColor     = null;
  var oldSpracheColor     = null;
  
  // 3.1 ... with DOM compatible browsers except Opera that does not return
  //         valid values with "getAttribute"
  if (typeof(window.opera) == 'undefined' && typeof(theSpracheCells[0].getAttribute) != 'undefined') 
    {
    currentSpracheColor = theSpracheCells[0].getAttribute('bgcolor');
    domSpracheDetect    = true;
    }
  // 3.2 ... with other browsers
  else 
    {
    currentSpracheColor = theSpracheCells[0].style.backgroundColor;
    domSpracheDetect    = false;
    } // end 3

  
  // 3.3 ... Opera changes colors set via HTML to rgb(r,g,b) format so fix it
  if (currentSpracheColor.indexOf("rgb") >= 0)
    {
    var rgbSpracheStr = currentSpracheColor.slice(currentSpracheColor.indexOf('(') + 1, currentSpracheColor.indexOf(')'));
    var rgbSpracheValues = rgbSpracheStr.split(",");
    currentSpracheColor = "#";
    var hexSpracheChars = "0123456789ABCDEF";
    for (var i = 0; i < 3; i++)
      {
      var v = rgbSpracheValues[i].valueOf();
      currentSpracheColor += hexSpracheChars.charAt(v/16) + hexSpracheChars.charAt(v%16);
      }
    }

  // 4. Defines the new color
  // 4.1 Current color is the default one
  if (currentSpracheColor == '' || currentSpracheColor.toLowerCase() == theSpracheDefaultColor.toLowerCase()) 
    {
    if (theSpracheAction == 'over' && theSprachePointerColor != '') 
      {
//      newSpracheColor = '#C0C0C0';
      newSpracheColor = theSprachePointerColor;
      oldSpracheColor = theSpracheDefaultColor;
      }
    }
  // 4.1.2 Current color is the pointer one
  else if (currentSpracheColor.toLowerCase() == theSprachePointerColor.toLowerCase()) 
    {
    if (theSpracheAction == 'out') 
      {
      newSpracheColor = theSpracheDefaultColor;
      oldSpracheColor = theSprachePointerColor;
      }
    }
  // 5. Sets the new color...
  if (newSpracheColor) 
    {
    var c = null;
    // 5.1 ... with DOM compatible browsers except Opera
    if (domSpracheDetect) 
      {
      for (c = 0; c < rowSpracheCellsCnt; c++) 
        {
        theSpracheCells[c].setAttribute('bgcolor', newSpracheColor,0);
        theSpracheCells[c].setAttribute('color', oldSpracheColor,0);
// alert(oldSpracheColor);
        } // end for
      }
      // 5.2 ... with other browsers
    else 
      {
      for (c = 0; c < rowSpracheCellsCnt; c++) 
        {
        theSpracheCells[c].style.backgroundColor = newSpracheColor;
        theSpracheCells[c].style.color = oldSpracheColor;
        }
      }
    } // end 5

  return true;
  } // end of the 'setSprachePointer()' function


