var ns4 = false, ns6 = false, ie = false;

function checkBrowser ()
{
	if (navigator.appName == "Netscape" || navigator.appName == "Mozilla") {
		if (navigator.appVersion.substring(0, 1) == "4") ns4 = true;
		if (navigator.appVersion.substring(0, 1) >= "5") ns6 = true;
	}
	if (navigator.appName == "Microsoft Internet Explorer") ie = true;
	if (!ns4 && !ns6 && !ie) ns6 = true
}

function openWin (winname, location, winwidth, winheight, scrollbars)
{
	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(screen.width/2-(winwidth/2),screen.height/2-(winheight/2));
	fenster.location.href = location; // muss sein wg. IE-Bug...
	fenster.focus()
}

function dm (msgStr)
{
	if (msgStr != "") statusTextOn(msgStr); else statusTextOff()
}

function statusTextNS6 ()
{
	window.status = linkTxt;
	return true
}

function statusTextOn (msg)
{
	linkTxt = msg;
	if (ns6) document.addEventListener("mousemove", statusTextNS6, false);
	window.status = linkTxt;
	return true
}

function statusTextOff ()
{
	linkTxt = "";
	if (ns6) document.removeEventListener("mousemove", statusTextNS6,false);
	window.status = linkTxt;
	return true
}

function loadPage (url, parameter)
{
	parent.frames.content.location.href = url;
	parent.frames.navig.location.href = 'navig.php?' + parameter
}

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 reloadNavig (dir, parameter)
{
	parent.frames.navig.location.href=dir + 'navig.php' + parameter
}

checkBrowser();