function NewWindow(th, width, height, scroll, name)
{
	name = (name || '_blank');
	if (window.screen)
	{
		var ah = screen.availHeight - 30;
		var aw = screen.availWidth - 10;
		var xc = (aw - width) / 2;
		var yc = (ah - height) / 2;
		str = ",left=" + xc + ",screenX=" + xc;
		str += ",top=" + yc + ",screenY=" + yc;
	}
	var newwin = window.open(th, name, 'width=' + width + ',height=' + height + ',resizable=no,location=no,toolbar=no,menubar=no,status=no,scrollbars=' + scroll + str);
	if (newwin) newwin.focus();
	return newwin;
}

function OpenWindow(th, width, height, scroll)
{
	NewWindow(th, width, height, scroll);
}

function HideOverflow(container, elements, offset)
{
	var height = jQuery(container).height();
	jQuery(elements).each(function (i) {
		offset += jQuery(this).outerHeight(true);
		if (offset >= height)
		{
			jQuery(this).hide();
		}
	});
}

function utilPreloadImg(s)
{
	if (document.images)
	{
		var img = new Image();
		img.src = s;
	}
}
