function openWindow(url, width, height)
{
	if ((document.body.clientWidth < width) || (document.body.clientHeight < height))
	{
		if (document.body.clientWidth < width) width = document.body.clientWidth;
		if (document.body.clientHeight < height) height = document.body.clientHeight;
	}
	posLeft = parseInt(screen.width / 2 - width / 2);
	posTop = parseInt(screen.height / 2 - height / 2);
	window.open(url,'ROWERY','top='+posTop+',left='+posLeft+',toolbar=no,scrollbars=yes,directories=no,status=no,menubar=no,resizable=no,width='+width+',height='+height);
}

function getElement(id)
{
	with (document) var element = getElementById ? getElementById(id) : all ? all[id] : layer[id];
	if(!element.style) element.style = element;
	return element;
}

function hideElement(name)
{
	getElement(name).style.display = 'none';
}

function viewElement(name)
{
	getElement(name).style.display = 'block';
}

function elementOnOff(name)
{
	if (getElement(name).style.display == 'none')
		getElement(name).style.display = 'block';
	else
		getElement(name).style.display = 'none';
}

function menuOff(name)
{
	getElement(name).style.visibility = 'hidden';
}

function menuOn(name)
{
	getElement(name).style.visibility = 'visible';
}

function number_format(number, decimals, dec_point, thousands_sep)
{
	var n = number, c = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals;
	var d = dec_point == undefined ? "." : dec_point;
	var t = thousands_sep == undefined ? "," : thousands_sep, s = n < 0 ? "-" : "";
	var i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0;
	return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
}
