/* 
     Titel: Dynamic HTML Lib v1.0b
     Autor: Johannes Gamperl
     email: jg@jg.seite.net
     Datum: 14.10.1999
 
     Copyright (c) J|G Webdesign & Programmierung - Johannes Gamperl, 1999. 
     All rights reserved. Alle Rechte vorbehalten. URL: http://jg.seite.net
 
     Dieser Code darf für nicht-kommerzielle sowie kommerzielle Zwecke frei
     genutzt und angepaßt werden, solange dies unentgeltlich erfolgt und
     dieser Vermerk bestehen bleibt. 
 */
 
 
 
 
 /* Browsertyp ermitteln (Kurzform für die Library)  */
 /* ------------------------------------------------ */
 
 ns4 = (document.layers)? true:false
 ie4 = (document.all)? true:false
 ns6 = ((parseInt(navigator.appVersion) >= 5) && (navigator.appName == "Netscape")) ? true : false; 
 
 
 
 /* Funktionen zur visibility-Eigenschaft von Ebenen */
 /* ------------------------------------------------ */

 function getEbene(id) {
 	if (ie4) return document.all[id];
 	if (ns6) return document.getElementById(id);
 }

 function zeigeEbene(id) {
 	if (ns4) document.layers[id].visibility = "show";
 	if (ie4) document.all[id].style.visibility = "visible";
 	if (ns6) document.getElementById(id).style.visibility = "visible";
     
 }
 
 function verbergeEbene(id) {
 	if (ns4) document.layers[id].visibility = "hide";
   	if (ie4) document.all[id].style.visibility = "hidden";
   	if (ns6) document.getElementById(id).style.visibility = "hidden";
 }
 
 
 /* Funktionen zum Ändern von Inhalten               */
 /* ------------------------------------------------ */
 
 function updateInhalt(id,nest,text) {
 	if (ns4) {
         var ebene = (nest)? eval('document.'+nest+'.document.'+id+'.document') : document.layers[id].document;
         ebene.open();
         ebene.write(text);
         ebene.close();
     }
     else document.all[id].innerHTML = text;
 }
 
 
 
 function blendeEbene(id, left, top, right, bottom) {
 	if (ns4) {
     	id.clip.left   = left;
 	    id.clip.top    = top;
     	id.clip.right  = right;
 	    id.clip.bottom = bottom;
   	}
     if (ie4) id.style.clip = 'rect(' + top + ' ' +  right + ' ' + bottom + ' ' + left +')';
 }
 
 
 
 function setBgColor(id,farbe) {
 	if (ns4) document.layers[id].document.bgColor = farbe;
 	if (ie4) document.all[id].style.backgroundColor = farbe;
 }
 
 function setBgImage(id,src) {
 	if (ns4) document.layers[id].background.src = src;
 	if (ie4) document.all[id].style.backgroundImage = "url(" +src+ ")";
 }
 
 
 
 /* Utilities zum Arbeiten mit Dynamic HTML          */
 /* ------------------------------------------------ */
 
 
 function getZIndex(id) {
 	if (ns4) return(document.layers[id].zIndex);
  	if (ie4) return(document.all[id].style.zIndex);
  	if (ns6) return(document.getElementById(id).style.zIndex);
		 
 	return(-1);
 }
 
 function setZIndex(id,z) {
 	if (ns4) document.layers[id].zIndex = z;
  	if (ie4) document.all[id].style.zIndex = z;
  	if (ns6) {    var l = document.getElementById(id);
		      l.style.zIndex=z; 
		 } 
 }
 
 
 function screenInfo(was) {
 	if (ns4 || ie4) {
 		if (was == 1) return screen.width;
 		if (was == 2) return screen.height;
 		if (was == 3) return screen.colorDepth;
 		if (was == 4) return screen.pixelDepth;
 		if (was == 5) return screen.availHeight;
 		if (was == 6) return screen.availWidth;
 	}
 }	
 
 
 function sichtbarInfo(id) {
  	if (ns4 && document.layers[id].visibility == "show") return(true);
 	if (ie4 && document.all[id].style.visibility == "visible") return(true);
 	return(false);
 }
 
 function positionInfo(id,bool) {
 	if (ns4) info = (bool) ? parseInt(document.layers[id].left):parseInt(document.layers[id].top);
 	if (ie4) info = (bool) ? parseInt(document.all[id].style.left):parseInt(document.all[id].style.top);
        if (ns6) info = (bool) ? parseInt(document.getElementById(id).style.left):parseInt(document.getElementById(id).style.top);
 	return(info);
 }

 function scrollInfo(id, bool) {
    if (ie4) info = (bool) ? parseInt(document.all[id].scrollLeft):parseInt(document.all[id].scrollHeight);
    if (ns6) info = (bool) ? parseInt(document.getElementById(id).offsetLeft):parseInt(document.getElementById(id).offsetHeight);
    return (info);
 } 

 function sizeInfo(id, bool) {
 	if (ns4) info = (bool) ? parseInt(document.layers[id].width):parseInt(document.layers[id].height);
 	if (ie4) info = (bool) ? parseInt(document.all[id].style.width):parseInt(document.all[id].style.height);
        if (ns6) info = (bool) ? parseInt(document.getElementById(id).style.width):parseInt(document.getElementById(id).style.height);
 	return(info);

 } 
 function mouseMove(e) {
         var x = (document.layers)? e.pageX : event.x+document.body.scrollLeft;
         var y = (document.layers)? e.pageY : event.y+document.body.scrollTop;
         if (!mouseFlag) status = "x:"+x+" y:"+y;
 		else { xpos = x; ypos = y; }
         return true;
 }
 
 function mouseMoveInit(flag) {
 mouseFlag = flag;
 document.onmousemove = mouseMove;
 if (ns4) document.captureEvents(Event.MOUSEMOVE);
 }
 
 
 
 
 /* Funktionen zum Bewegen von Ebenen                */
 /* ------------------------------------------------ */
 
 function bewegeEbene(id,x,y) {
 	if (ns4) document.layers[id].moveTo(x,y);
 	if (ie4) {
 	    document.all[id].style.left = x;
     	document.all[id].style.top  = y;
   }
   if (ns6) {
      var l = document.getElementById(id);
      l.style.left = x;
      l.style.top = y;
      }
 }
 
 function slideEbene(id,x,y) {
 	if (ns4) document.layers[id].moveBy(x,y);
 	if (ie4) {
 		document.all[id].style.pixelLeft += x;
 		document.all[id].style.pixelTop  += y;
 	}
 	if (ns6) {
      var l = document.getElementById(id);
      l.style.left = parseInt(l.style.left) + x;
      l.style.top = parseInt(l.style.top) + y;

 	}
 	
 }
 
 
 
 
 
 /* Funktionen zu Fenster und Seiten-Eigenschaften   */
 /* ------------------------------------------------ */
 
 function getFensterWidth() {
 	if (ns4 || ns6) return(window.innerWidth);
 	if (ie4) return(document.body.offsetWidth);
 }
 
 function getFensterHeight() {
 	if (ns4 || ns6) return(window.innerHeight);
 	if (ie4) return(document.body.offsetHeight);
 }
 
 function getSeitenWidth() {
 	if (ns4 || ns6) return(document.width);
 	if (ie4) return(document.body.scrollWidth);
 }
 
 function getSeitenHeight() {
 	if (ns4 || ns6) return(document.height);
 	if (ie4) return(document.body.scrollHeight);
 }
 
 function getSeitenScrollX() {
 	if (ns4 || ns6) return(window.pageXOffset);
     if (ie4) return(document.body.scrollLeft);
 }
 
 function getSeitenScrollY() {
 	if (ns4 || ns6) return(window.pageYOffset);
     if (ie4) return(document.body.scrollTop);
 }
 
