//================================= CLASS CONSTRUCTOR ========================================
function Globals()
{
//VARIABLES
//Page ref for the global page ...
 this.pageRef = null;
//referince to MenuPage
 this.menuRef = null;

//Packages ...
 this.fdoc = null;
 this.idoc = null;
 this.attachListDlg = null;
 this.docProtocols = null;
 this.lovListDlg = null;
 this.lovdlg = null;
 this.qbuilderdlg = null;
 this.modifyInfo = null;
 this.nadd = null;
 this.nmsg = null;
 this.nmsgs = null;
 this.nsys = null;
 this.usersdlg = null;
 this.tIters = null;
 this.iterRoot = null;
 this.iterActions = null;
 this.iterAction = null;
 this.utils = null;
 this.query = null;
 this.pQuery = null;
 this.lQuery = null;
 this.savedQuery = null;
 this.qresult = null;
 this.qLResult = null;
 this.rights = null;
 this.linkedDocs = null;
 this.viewLinkedDocs = null;
 this.randNr = null;
 this.iVal = null;

//Informations ...
 this.cUserName = null;

//Link to the preview frame ...
 this.previewRef = null;

//Initializing ...
 this.initialize();
}

//====================================== STATIC ==============================================
//CONSTANTS
//<<< GLOBAL CONSTANTS >>>
//Modal results
 Globals.MODALRESULT_NONE   = 0;
 Globals.MODALRESULT_OK     = 1;
 Globals.MODALRESULT_CANCEL = 2;

//Client Field Types
 Globals.FIELDTYPE_INT      = 1;
 Globals.FIELDTYPE_REAL     = 2;
 Globals.FIELDTYPE_DATE     = 3;
 Globals.FIELDTYPE_TIME     = 31;
 Globals.FIELDTYPE_STR      = 4;
 Globals.FIELDTYPE_INTARRAY = 5;
 Globals.FIELDTYPE_STRARRAY = 6;

 Globals.PROTOCOL_NONE      = 0;
 Globals.PROTOCOL_IN        = 1;
 Globals.PROTOCOL_OUT       = 2;

//Content Type
 Globals.CONTENT_NONE          = 0;
 Globals.CONTENT_PROTOCOL_IN   = 1;
 Globals.CONTENT_PROTOCOL_OUT  = 2;
 Globals.CONTENT_FAMILY        = 4;

//Sort order
 Globals.SORTORDER_NONE = 0;
 Globals.SORTORDER_ASC  = 1;
 Globals.SORTORDER_DESC = 2;

//Special separator characters for list
 Globals.CLIENT_LIST_SEPARATOR = ",";
 Globals.SERVER_LIST_SEPARATOR = "|";

//VARIABLES
//Trace variables
 Globals.TRACEFILEALL_PATH     = "c:\\JS_ALL_LOG.txt";
 Globals.TRACEFILECURRENT_PATH = "c:\\JS_CURRENT_LOG.txt";
 Globals.TRACETYPE_INFO    = 0;
 Globals.TRACETYPE_WARNING = 1;
 Globals.TRACETYPE_ERROR   = 2;
 Globals.TRACETYPENAME_INFO    = "INFORMATION";
 Globals.TRACETYPENAME_WARNING = "WARNING";
 Globals.TRACETYPENAME_ERROR   = "ERROR";

//Chronos variables
 Globals.TRACE_CHRONOS_START = null;

//METHODS

//====================================== MEMBERS =============================================
Globals.prototype.setDefaults = function()
{
 this.pageRef = null;
 this.menuRef = null;
 this.fdoc = null;
 this.idoc = null;
 this.attachListDlg = null;
 this.docProtocols = null;
 this.lovdlg = null;
 this.qbuilderdlg = null;
 this.modifyInfo = null;
 this.nadd = null;
 this.nmsg = null;
 this.nmsgs = null;
 this.nsys = null;
 this.usersdlg = null;
 this.tIters = null;
 this.iterRoot = null;
 this.iterActions = null;
 this.iterAction = null;
 this.utils = null;
 this.query = null;
 this.pQuery = null;
 this.lQuery = null;
 this.savedQuery = null;
 this.qresult = null;
 this.qLResult = null;
 this.rights = null;
 this.linkedDocs = null;
 this.viewLinkedDocs = null;
}

Globals.prototype.initialize = function()
{
 var
  logPath = null;

 this.setDefaults();
//Initializing log paths ...
 logPath = PATH_getInternetCache();
 Globals.TRACEFILEALL_PATH = logPath+"\\JS_ALL_LOG.txt";
 Globals.TRACEFILECURRENT_PATH = logPath+"\\JS_CURRENT_LOG.txt";
//Initializing objects ...
 this.fdoc = new GFDoc();
 this.idoc = new GIDoc();
 this.attachListDlg = new GAttachListDlg();
 this.docProtocols = new GDocProtocols();
 this.lovListDlg = new GLovListDlg();
 this.lovdlg = new GLovDlg();
 this.qbuilderdlg = new GQBuilder();
 this.modifyInfo = new GModifyInfo();
 this.nadd = new GNotifAdd();
 this.nmsg = new GNotifMsg();
 this.nmsgs = new GNotifMsgs();
 this.nsys = new GNotifSys();
 this.tIters = new GTIters();
 this.iterRoot = new GIterRoot();
 this.iterActions = new GIterActions();
 this.iterAction = new GIterAction();
 this.usersdlg = new GUsersDlg();
 this.utils = new GUtils();
 this.query = new GQuery();
 this.pQuery = new GProtocolsQuery();
 this.lQuery = new GLinkedQuery();
 this.savedQuery = new GSavedQuery();
 this.qresult = new GQueryResult();
 this.qLResult = new GLinkedQueryResult();
 this.rights = new GRights();
 this.linkedDocs = new GLinkedDocs();
 this.viewLinkedDocs = new GViewLinkedDocs();
 this.iVal = null;
}

Globals.prototype.finalize = function()
{
 if (this.idoc != null)
  this.idoc.finalize();
 if (this.docProtocols != null)
  this.docProtocols.finalize();
 if (this.attachListDlg != null)
  this.attachListDlg.finalize();
 if (this.lovListDlg != null)
  this.lovListDlg.finalize();
 if (this.lovdlg != null)
  this.lovdlg.finalize();
 if (this.qbuilderdlg != null)
  this.qbuilderdlg.finalize();
 if (this.modifyInfo != null)
  this.modifyInfo.finalize();
 if (this.notifadd != null)
  this.notifadd.finalize();
 if (this.notifmsg != null)
  this.notifmsg.finalize();
 if (this.notifmsgs != null)
  this.notifmsgs.finalize();
 if (this.notifsys != null)
  this.notifsys.finalize();
 if (this.tIters != null)
  this.tIters.finalize();
 if (this.iterRoot != null)
  this.iterRoot.finalize();
 if (this.iterActions != null)
  this.iterActions.finalize();
 if (this.iterAction != null)
  this.iterAction.finalize();
 if (this.usersdlg != null)
  this.usersdlg.finalize();
 if (this.utils != null)
  this.utils.finalize();
 this.iVal = null;
 this.setDefaults();
}
