//Copyright Peter Enzenberger.de, 1999
//All rights reserved
//Die Nutzung ohne Einwilligung des Author ist nicht gestattet

////////
function mailWindow() {
	window.open('','Ergebnis','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=no,width=485,height=600');
}

////////
function openWindow(url, w, h) {
	var groesse = "resizable=yes,width=" + w + ",height=" + h;
	popup = window.open(url,'remote',groesse);
}

////////
function openBrowserWindow(theURL, winName, features) {
  window.open(theURL, winName, features);
}

////////
function findObject(n, d) {
	var p,i,x;
	if (!d) d=document;
	if ((p=n.indexOf("?"))>0 && parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
	if (!(x=d[n])&&d.all) x=d.all[n];
	for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObject(n,d.layers[i].document);
	if(!x && document.getElementById) x=document.getElementById(n); return x;
}


////////
function moveLayer(object, x, y) {
    if (document.layers && document.layers[object]) {
        document.layers[object].left = x;
        document.layers[object].top = y;
    }
    else if (document.all) {
        document.all[object].style.posLeft = x;
        document.all[object].style.posTop = y;
    }
}

////////
function showHideLayers() {
	var i, p, v, obj, args=showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3)
	if ((obj=findObject(args[i]))!=null) {
		v=args[i+2];
		if (obj.style) {
			obj=obj.style;
			v=(v=='show')?'visible':(v='hide')?'hidden':v;
		}
		obj.visibility=v;
	}
}

////////
function showLayer(id) {
	myID = cbeGetElementById(id).cbe;
	myID.zIndex(1);
	showHideLayers(id,'','show')
}
////////
function hideLayer(id) {
	showHideLayers(id,'','hide')
}


////////
function toggleVisibility(sId) {
  var prevVisState = document.getElementById(sId).cbe.visibility();
  cbe.visibility(!prevVisState);
}


xOffset = 2;
yOffset = -20;

////////
function showHelpLayer(id,myBox) {
//1: name of layer to show
//2: delta for xOffset
//3: delta for yOffset
	xDelta = 0;
	yDelta = 0;
	with (showHelpLayer) {
		if (arguments.length > 1) {
			xDelta = arguments[1];
			if (arguments.length = 2) {
				yDelta = arguments[2];
			}
		}
//		alert("arg: " + arguments[0] +" "+ xDelta +"/"+ yDelta);
	}
	toID = cbeGetElementById(id).cbe.id + "XY";
	toXY = cbeGetElementById(toID).cbe;
//	alert("mouseID: " + mouseID.id);
	myID = cbeGetElementById(id).cbe;
	myID.zIndex(1);
	myID.show();
	savedX = myID.pageX();
	savedY = myID.pageY();
	myID.slideTo(toXY.pageX() + xOffset + xDelta, toXY.pageY() + yOffset + yDelta, 500);
}
////////
function hideHelpLayer(id, myBox) {
		hideLayer(id);
		myID.slideTo(savedX, savedY, 0);
}


////////
//function BoxOver(LinkObject)	{
//	Rollover für Tabellenfelder
//	geht nicht in Opera beim zurücksetzen der Zellenfarbe
//	LinkObject.style.background="#4365A7";
//	LinkObject.style.border='solid';
//	LinkObject.style.borderWidth='5px';
//	LinkObject.style.borderColor='#4365A7';
//}
////////
//function BoxOut(LinkObject)	{
//	LinkObject.style.background="";
//	geht nicht in Opera beim zurücksetzen der Zellenfarbe
//	LinkObject.style.border='0';
//	LinkObject.style.borderWidth='0px';
//	LinkObject.style.borderColor='transparent';
//}



////////
function reloadPage(init) {  //reloads the window if Nav4 resized
	if (init==true) with (navigator) {
			if ((appName=="Netscape") && (parseInt(appVersion)==4)) {
				document.myPageWidth=innerWidth; document.myPageHeight=innerHeight; onresize=reloadPage;
		}
	}
	else if (innerWidth!=document.myPageWidth || innerHeight!=document.myPageHeight) location.reload();
}

reloadPage(true);
