function NewWindow(mypage, myname, w, h, scroll)
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;

	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)

	if (parseInt(navigator.appVersion) >= 4)
	{
		win.window.focus();
	}
}


function resize(which, maxSize) {
  var elem = document.getElementById(which);
  if (elem == undefined || elem == null) return false;
  if (maxSize == undefined) maxSize = 100;
  if (elem.width > elem.height)
  {
    if (elem.width > maxSize) elem.width = maxSize;
  } 
  else
  {
    if (elem.height > maxSize) elem.height = maxSize;
  }
}