if (document.getElementById) DOM = true; else DOM = false;
dom = DOM;

function displayStatusbarMessage (msgStr)
{
	document.returnValue = false;
	if (document.images) {
			window.status = msgStr;
			document.returnValue = true;
	}
} // function displayStatusbarMessage

function openWin (winname, location, winwidth, winheight, scrollbars)
{
	if (winwidth > screen.width) { winwidth = screen.width - 100; scrollbars = "scrollbars=yes"; }
	if (winheight > screen.height) { winwidth = screen.height - 100; scrollbars = "scrollbars=yes"; }

	if (scrollbars == "") scrollbars = ",scrollbars=no,"; else scrollbars = "," + scrollbars + ",";
	win = window.open('', winname, 'width=' + winwidth + ',height=' + winheight + scrollbars + 'resizable=yes, toolbar=no, status=no, directories=no, menubar=no, location=no');
	win.moveTo(screen.width / 2 - winwidth / 2, screen.height / 2 - winheight / 2);
	win.location.href = location;
	win.focus();
} // function openWin

function addClass (elementname, classname)
{
	document.getElementById(elementname).className = document.getElementById(elementname).className + " " + classname;
} // function addClass

function removeClass (elementname, classname)
{
	document.getElementById(elementname).className = document.getElementById(elementname).className.replace(classname, "");
} // function removeClass

function roundStd (x)
{
	var k = (Math.round(x * 100) / 100).toString();
	k += (k.indexOf('.') == -1)? '.00' : '00';
	var p = k.indexOf('.');
	return k.substring(0, p) + ',' + k.substring(p+1, p+3);
} // function roundStd
