var IE4 = false, NS4 = false, NS6 = false, DOM = false;

if ((navigator.appName == "Netscape") && (navigator.appVersion.substring (0, 1) == "4")) NS4 = true;
if ((navigator.appName == "Netscape") && (navigator.appVersion.substring (0, 1) >= "5")) NS6 = true;
if ((document.all) && (navigator.userAgent.indexOf ('MSIE 4') >= 0)) IE4 = true;
if (document.getElementById) DOM = true;

var ie4 = IE4, ns4 = NS4, ns6 = NS6, dom = DOM;

var image_preload_counter = 0;

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 dm (msgStr)
{
	document.returnValue = false;
	if (document.images) {
			window.status = msgStr;
			document.returnValue = 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 preloadImage (image_file_name)
{
	image_preload_counter++;
	eval ("preload_" + image_preload_counter + " = new Image ();");
	eval ("preload_" + image_preload_counter + ".src = \"" + image_file_name + "\"");
}
