function dm (msgStr)
{
	document.returnValue = false;

	if (document.images) { 
		window.status = msgStr;
		document.returnValue = true;
	}
}

function swapLayer (layer1, layer2)
{
	if (navigator.appName == "Netscape") {
		if (navigator.appVersion.substring(0, 1) == "4") {
			document[layer1].visibility = "hidden";
			document[layer2].visibility = "inherit";
		}

		if (navigator.appVersion.substring(0, 1) >= "5") {
			document.getElementById(layer1).style.visibility = "hidden";
			document.getElementById(layer2).style.visibility = "inherit";
		}
	}
	else {
		document.all[layer1].style.visibility = "hidden";
		document.all[layer2].style.visibility = "inherit";
	}
}

function checkTextObj(textobj, minlen)
{
	var str = new String(textobj.value);
	if (textobj.name.indexOf("email") >= 0) {
		if ((str.indexOf("@") < 1) || (str.lastIndexOf(".") < str.lastIndexOf("@"))) return (-2);
	}
	if (str.length < minlen) return (-1);
	return 0
}

function openwin (winname, location, winwidth, winheight, scrollbars)
{
	openwin_xy (winname, location, winwidth, winheight, scrollbars, screen.width/2-(winwidth/2), screen.height/2-(winheight/2))
}

function openwin_xy (winname, location, winwidth, winheight, scrollbars, x, y)
{
	if (scrollbars == "") { scrollbars = ",scrollbars=no," } else { scrollbars = "," + scrollbars + "," }
	fenster = window.open ('', winname, 'width=' + winwidth + ',height=' + winheight + scrollbars + 'resizable=yes,toolbar=no,status=no,directories=no,menubar=no,location=no');
	fenster.moveTo (x, y);
	fenster.location.href = location;
	fenster.focus ();
}

function closewin(winname)
{
	fenster = window.open ('', winname, 'width=10,height=10,scrollbars=no,resizable=no,toolbar=no,status=no,directories=no,menubar=no,location=no');
	fenster.moveTo (0, 0);
	fenster.focus ();
	fenster.location.href = 'close_window.php';
}

function trimLeft (zk)
{
	zk_neu = escape(zk);
	if (zk_neu.indexOf("%A0") > 0) zk_neu = zk_neu.substring(0, zk_neu.indexOf("%A0"));
	return zk_neu
}
