


// BrowserCheck Object
// provides most commonly needed browser checking variables,  Copyright (C) 1999 Dan Steinman
// Distributed under the terms of the GNU Library General Public License, Available at http://www.dansteinman.com/dynapi/

function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.v = parseInt(navigator.appVersion)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0)
	this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0)
	if (this.ie5) this.v = 5
	this.min = (this.ns||this.ie)
}
is = new BrowserCheck()


// Mouse Event Functions
// mouse events for the Drag object and Scroll2 object 19991007

function initMouseEvents() {
	document.onmousedown = mouseDown;
	document.onmousemove = mouseMove;
	document.onmouseup = mouseUp;
	if (is.ns) document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP)
}
function mouseDown(e) {
	if ((is.ns && e.which!=1) || (is.ie && event.button!=1)) return true;
	var x = (is.ns)? e.pageX : event.x+document.body.scrollLeft;
	var y = (is.ns)? e.pageY : event.y+document.body.scrollTop;
	if (is.ns && e.target!=document) routeEvent(e);
	if (Scroll && ScrollTestActive()) return false;
	else if (Drag && drag.mouseDown(x,y)) return false;
	else return DynMouseDown(x,y);
}
function mouseMove(e) {
	var x = (is.ns)? e.pageX : event.x+document.body.scrollLeft;
	var y = (is.ns)? e.pageY : event.y+document.body.scrollTop;
	//if (is.ns && e.target!=document) routeEvent(e);
	if (Scroll && ScrollTestActive()) return false;
	else if (Drag && drag.mouseMove(x,y)) return false;
	else return DynMouseMove(x,y);
}
function mouseUp(e) {
	var x = (is.ns)? e.pageX : event.x+document.body.scrollLeft;
	var y = (is.ns)? e.pageY : event.y+document.body.scrollTop;
	if (is.ns && e.target!=document) routeEvent(e);
	if (Drag && drag.mouseUp(x,y)) return false;
	else return DynMouseUp(x,y);
}

// overwrite these functions in your html source to do other mouse handling
function DynMouseDown(x,y) {return true}
function DynMouseMove(x,y) {return true}
function DynMouseUp(x,y) {return true}

// include drag.js and/or scroll2.js after this file to overwrite these variables
Drag = null;
Scroll = null;




/* Popups _________________________________________________________________________________________

	copyright 2002  www.mint.de && www.null2.net
	no copying without written permission
*/


/* Initialisierung der Mausueberwachung */
function init(){ 
  initMouseEvents();
  initpop();
}

function DynMouseMove(x,y) {
  mousex=x;
  mousey=y;
}


function leeren() {  
  if (document.tx_indexedsearch.tx_indexedsearch[sword].value=="(text)") {document.suchform.suchbegr.value=""; alert("wert");}; 
}


  

function initpop(){
  if (is.ie) {
	doc='document.all.';
	stil='.style.';
	schreiben=".innerHTML=text";
	schliessen="";
  } else if (is.ns) {
	doc=		'document.getElementById(\"';
	stil=		'\").style.';
	schreiben=	"\").innerHTML=text";
	schliessen=	"\")";
  } else {
	doc=		'document.';
	stil=		'.';
	schreiben=	'.document.write(text)';
	schliessen=	".document.close()";
	}
}


function hide(block, farbe){	 // bei Listen: Block = 0
	if(block){ 
		block.style.backgroundColor = farbe;
		icke = doc + "pop" + stil;
		}
	eval ( icke+'visibility=\"hidden";');
}




var edit; var tmp; var icke; var posx;  var posy; var xmax; var last; var scroll=0; var block; var mousex; var mousey;
versatzx= 0; // Ursprung des Layers pop._x
versatzy= 0; // Ursprung des Layers pop._y
popbreite= 275; // Breite des Popups
abst= 18; // Abstand popup von Maus x und y 


function popdiv(block, farbe, text, kal) {
	bewegen(kal);
 
	if (last != text) { tmp=text; last = text;}	// texte zusammenfügen, wenn noch nicht passiert 

	if (kal)  { block.style.backgroundColor = farbe; }  // Hintergrundfarbe im Kalender ändern

	icke = doc + "pop" + stil;
	eval (doc + 'pop' + schreiben );
	eval (doc + 'pop' + schliessen);
	eval ( icke+'width=\"'+popbreite+'\";' +icke+'height=\"auto\";' +icke+'visibility=\"visible\";');
}





function bewegen(kal){

	if (is.ns)	 {
		if(edit=='yes') { versatzx = 0; versatzy =0; }				// N6 in Backend, wenn Ursprung = Seitenursprung
		posy=  mousey +abst -versatzy ;
		posx = mousex +abst -versatzx;
		xmax= window.innerWidth; 
	}
       
	if  (is.ie) { 
		xmax= document.body.offsetWidth; 
		scroll=document.body.scrollTop;
		if (kal==1) { versatzx = -230; versatzy = -220+ scroll; xmax -=230;} 	
			else { versatzx = 0; versatzy = 0;}

		if(edit=='yes') { versatzx = 0; versatzy =-105; }			// IE in Backend

		posy=  mousey +abst -versatzy ;
		posx = mousex +abst -versatzx;
		}

	if( posx +popbreite +versatzx +25 >= xmax ) { posx = xmax -popbreite -versatzx -25;}		// aber nich rechts rauslaufen

	icke = doc + "pop" + stil;
	eval ( icke+'top=\"'+posy+'\";' +icke+'left=\"'+posx+'\";');

//	 window.status="kal="+kal +" mx="+mousex +" my="+mousey +" x="+posx +" y="+posy +" version="+is.v +" breite="+xmax +" scroll:"+ scroll +" ie:"+is.ie;
}









function gourl(url){
  if(url!=''){ document.location.href=url; }
}
