    var mousex;
    var mousey;
    var canHide = false;
    var hintElement = null;
    var hintTimeout = null;
    var oldClassName = '';
    var oldClassNameForRowPointer = '';
    var currentlyVisibleSubmenu;
		var checkboxImage_uncecked;
		var checkboxImage_checked;
		
		checkboxImage_unchecked = new Image();
		checkboxImage_checked = new Image();
		checkboxImage_unchecked.src = 'grafiken/page/checkbox_unchecked.gif';
		checkboxImage_checked.src = 'grafiken/page/checkbox_checked.gif';

		function toggleCheckbox(id) {
			el = document.getElementById('cbf'+id);
			//alert(el.value);
			if (el.value=='1') {
				el.value = '0';
				document.getElementById('cbi'+id).src = checkboxImage_unchecked.src;
			} else {
				el.value = '1';
				document.getElementById('cbi'+id).src = checkboxImage_checked.src;
			}
			//alert(el.value);
		}

    function hideSubmenu() {
      if (currentlyVisibleSubmenu) {
        currentlyVisibleSubmenu.style.visibility = 'hidden';
        currentlyVisibleSubmenu = null;
      }
    }

    function showSubmenu(id) {
      hideSubmenu();
      el = document.getElementById(id);
      if (el) {
        currentlyVisibleSubmenu = el;
        el.style.top = (70 - (el.offsetHeight / 2)) + 'px';
        el.style.visibility = 'visible';
      }
    }
    


  	function showPIC(path,w,h, ww, hw, bu)
  	{
  		window.open("/outdoor/showPic.php4?max_dest_width="+w+"&max_dest_height="+h+"&picpath="+path+"&bu="+bu,"",
  				"width="+ww+",height="+hw+",top=5,left=5,scrollbars=yes,resizable=yes,location=no,toolbar=no,menubar=no,status=no");
  	}

  	function showLoadWindow() {
      el = document.getElementById("loadwindow");
      if (el) {
        el.style.visibility = "visible";
      }
  	}

    function sendHTTPRequest(url, params, element, afterfunction) {
      //alert("Test");
      try {
        var requester = new XMLHttpRequest();
      }
      catch (error) {
        try {
          var requester = new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch (error) {
        return false;
        }
      }
      httpresponse = '...';
      requester.onreadystatechange= function() {
          if(requester.readyState==4) {
            if (requester.status == 200){
              // prüfen, ob kein "invalid request"...
              //alert(requester.responseText);
              if (requester.responseText.substr(0,15).toLowerCase() != 'invalid request') {
                if (element && element.innerHTML) {
                  element.innerHTML = requester.responseText;
                }
                if (afterfunction) afterfunction(requester.responseText);
              } else { // Fehlermeldung ausgeben, wenn invalid request. Vermutlich veraltete Session...
                alert('Es ist ein Fehler aufgetreten. Vermutlich ist Ihre Sitzung nicht mehr gueltig. Bitte starten sie das Tool erneut, um eine neue Sitzung zu beginnen.');
              }
            } else {
                alert('Fehler "'+requester.status+'" waehrend Aufrufes: '+url+params);
            }
          }
        }
      requester.open("POST", url, true);
      requester.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
      requester.send(params);
    }



    function getPageWidth() {
      var test1 = document.body.scrollHeight;
      var test2 = document.body.offsetHeight
      if (test1 > test2) // all but Explorer Mac
      {
      	return document.body.scrollWidth;
      }
      else // Explorer Mac; would also work in Explorer 6 Strict, Mozilla and Safari
      {
      	return document.body.offsetWidth;
      }
    }

    function getPageHeight() {
      var test1 = document.body.scrollHeight;
      var test2 = document.body.offsetHeight
      if (test1 > test2) // all but Explorer Mac
      {
      	return document.body.scrollHeight;
      }
      else // Explorer Mac; would also work in Explorer 6 Strict, Mozilla and Safari
      {
      	return document.body.offsetHeight;
      }
    }

		function getWindowHeight() {
			if( typeof( window.innerWidth ) == 'number' ) {
				//Non-IE
				return window.innerHeight;
			} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
				//IE 6+ in 'standards compliant mode'
				return document.documentElement.clientHeight;
			} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
				//IE 4 compatible
				return document.body.clientHeight;
			}
		}
		
		function getWindowWidth() {
			if( typeof( window.innerWidth ) == 'number' ) {
				//Non-IE
				return window.innerWidth;
			} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
				//IE 6+ in 'standards compliant mode'
				return document.documentElement.clientWidth;
			} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
				//IE 4 compatible
				return document.body.clientWidth;
			}
		}
		

    function getXY(e) {
      if(!e) e = window.event;
      var body = (window.document.compatMode && window.document.compatMode == "CSS1Compat") ?
      window.document.documentElement : window.document.body || null;

      mousey = e.pageY ? e.pageY : e.clientY + body.scrollTop;
      mousex = e.pageX ? e.pageX : e.clientX + body.scrollLeft;

      element = document.getElementById('hintlayer');
      if (element) {
        //Bildränder beachten
        wx = getPageWidth();
        wy = getPageHeight();
        if ((mousex-20) > (wx - element.offsetWidth)) {
          mousex = (wx - element.offsetWidth) + 20;
        } else if (mousex < 30) {
          mousex = 30;
        }
        if (mousey +20 > (wy - element.offsetHeight)) {
          mousey = (wy - element.offsetHeight) - 20;
        }
        //Zuweisung
        element.style.left = mousex-25+'px';
        element.style.top = mousey+15+'px';
      }
    }
    document.onmousemove = getXY;

    function showHint(callingElement, hinttext) {
      var element;
      element = document.getElementById('hintlayer');
      element.innerHTML = hinttext;
      element.style.visibility = 'visible';
      /*
      if (oldClassName == '') {
        if ((callingElement.className.indexOf('Table') > -1) || (callingElement.className.indexOf('Decade') > -1)) {
          oldClassName = callingElement.className;
          callingElement.className = 'scTableHilightedCell';
        }
      }
      hintElement = callingElement;
      */
      if (hintTimeout)
        clearTimeout(hintTimeout);
      hintTimeout = setTimeout('hideHint(null)',3000);
    }

    function hideHint(callingElement) {
      var element;
      element = document.getElementById('hintlayer');
      element.style.visibility = 'hidden';
      /*
      if ((oldClassName != '') && (hintElement.className.indexOf('Table') > -1)) {
        hintElement.className = oldClassName;
        oldClassName = '';
      }
      */
    }


function getPosition(element)
/* der Aufruf dieser Funktion ermittelt die absoluten Koordinaten
   des Objekts element */
{
  var elem=element,tagname="",x=0,y=0;
  
/* solange elem ein Objekt ist und die Eigenschaft offsettop enthaelt
   wird diese Schleife fuer das Element und all seine Offset-Eltern ausgefuehrt */
  while ((typeof(elem)=="object")&&(typeof(elem.tagName)!="undefined"))
  {
    y+=elem.offsetTop;     /* Offset des jeweiligen Elements addieren */
    x+=elem.offsetLeft;    /* Offset des jeweiligen Elements addieren */
    tagname=elem.tagName.toUpperCase(); /* tag-Name ermitteln, Grossbuchstaben */

/* wenn beim Body-tag angekommen elem fuer Abbruch auf 0 setzen */
    if (tagname=="BODY")
      elem=0;

/* wenn elem ein Objekt ist und offsetParent enthaelt
   Offset-Elternelement ermitteln */
    if (typeof(elem)=="object")
      if (typeof(elem.offsetParent)=="object")
        elem=elem.offsetParent;
  }

/* Objekt mit x und y zurueckgeben */
  position=new Object();
  position.x=x;
  position.y=y;
  return position;
}		
		
		
function setPointer(theRow)
{
    if (typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        var theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        var theCells = theRow.cells;
    }
    else {
        return false;
    }
    var rowCellsCnt  = theCells.length;
    for (var c = 0; c < rowCellsCnt; c++) {
      oldClassNameForRowPointer = theCells[c].className;
      theCells[c].className = "scTableHilightedCell";
    }
    return true;
} // end of the 'setPointer()' function


function unsetPointer(theRow)
{
    if (typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        var theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        var theCells = theRow.cells;
    }
    else {
        return false;
    }
    var rowCellsCnt  = theCells.length;
    for (var c = 0; c < rowCellsCnt; c++) {
        theCells[c].className = oldClassNameForRowPointer;
    }
    return true;
} // end of the 'setPointer()' function

function getRadioValue(idOrName) {
	var value = null;
	var element = document.getElementById(idOrName);
	var radioGroupName = null;  
	
	// if null, then the id must be the radio group name
	if (element == null) {
		radioGroupName = idOrName;
	} else {
		radioGroupName = element.name;     
	}
	if (radioGroupName == null) {
		return null;
	}
	var radios = document.getElementsByTagName('input');
	for (var i=0; i<radios.length; i++) {
		var input = radios[ i ];    
		if (input.type == 'radio' && input.name == radioGroupName && input.checked) {                          
			value = input.value;
			break;
		}
	}
	return value;
}




