
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=yes,resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function closeWindow() {
	if (newWindow && !newWindow.closed) {
		newWindow.close()
	}
}

function RefreshParentAndClose() {
  var ref = window.opener.location.href;
  pos = ref.indexOf("?");
  if (pos < 0) {
	window.opener.location.href = window.opener.location.href + "?refr=true";	
  }
  else
	window.opener.location.href = window.opener.location.href + "&refr=true";



  if (window.opener.progressWindow)
        
 {
    window.opener.progressWindow.close()
  }
  window.close();
}

function RefreshParentCalendarAndClose() {
   window.opener.refreshCalendar();

  if (window.opener.progressWindow)        
  {
	window.opener.progressWindow.close()
  }
  window.close();
}

function refreshCalendar() {
	ajaxpage('external/cal/calendar.php', 'DocuDiv');
}

function CloseWindow() {
  window.close();
}

