function winOpener(URLL, W, H, scrl)
{
var w=window.screen.width;
var h=window.screen.height;
var X=Math.ceil((w-W)/2);
var Y=Math.ceil((h-H)/2);
var WinID="win"+Math.round(Math.random()*10000);

var CWIN=window.open(
URLL,
WinID,
"top="+Y+", left="+X+",width="+W+",height="+H+
",scrollbars="+scrl+",status=0,menubar=0,resizable=0");
}

jsStuff = new function () {

 var weekDays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];

 this.openCenteredWindow = function (link, width, height, scrollbars, resizable) {
   scrollbars = "scrollbars=" + (scrollbars == "scrollbars" ? "1" : "0");
   resizable = "resizable=" + (resizable == "resizable" && window.resizeTo ? "1" : "0");

   var maxWidth = Math.round(screen.width * .85),
       maxHeight = Math.round(screen.height * .85),
       windowLeft = Math.round((screen.width - width)/2),
       windowTop = Math.round((screen.height - height)/2);

   width = width > maxWidth ? maxWidth : width;
   height = height > maxHeight ? maxHeight : height;

   var windowParams = "menubar=0," + scrollbars + ",titlebar=1," + resizable + ",width=" + width + ",height=" + height + ",left=" + windowLeft + ",top=" + windowTop + ",screenX=" + windowLeft + ",screenY=" + windowTop + ",status=0",
       currWindow = window.open(link.href, link.target, windowParams);

   if (currWindow._alreadyOpened) {
     currWindow.close();
     currWindow = null;
     currWindow = window.open(link.href, link.target, windowParams);
   }
   currWindow._alreadyOpened = true;

   currWindow.focus();
   return currWindow;
 }

 this.doInitialFieldClear = function (field) {
   with (field) {
     value = "";
     onfocus = null;
   }
 }

 this.getDateString = function () {
   var date = new Date();

   return weekDays[date.getDay()] + ",&nbsp;&nbsp;" + (date.getMonth() + 1) + "." + date.getDate() + "." + date.getFullYear();
 }

}
