//###########################################################
function GQuery()
{
//VARIABLES
//array of selected families
 this.location = null;
	this.subQueryLocation = null;
 this.tempWin = null;
 this.hidden = false;
 this.familyNr = 0;
 this.familyNames = new Array();
 this.familyIDs = new Array();
 this.familySelNames = new Array();
 this.familySelIDs = new Array();
 this.fieldNames = new Array();
 this.fieldHasLOV = new Array();
 this.esync = new Semaphore();
 this.fieldNr = 0;
 this.fieldIDs = new Array();
 this.fieldTypes = new Array();
 this.fillTypes = new Array();

//subQuery stuff
//load query stuff
 this.loadQuery = false;
 this.ops = new Array();
 this.val1 = new Array();
 this.val2 = new Array();
 this.loadTypes = new Array();
 this.orderId = 0;

//table stuff
 this.rowValNr = 1;

//page refs
 this.getFieldsPageRef = null;

//path for temp file
 this.localPath = null;
 this.localPathFile = null;
 this.localFile = null;

//status of the DELETE FILE
 this.statusDelFile = 0;

//types used:
 this.FTYPE_INT  = 1;
 this.FTYPE_REAL = 2;
 this.FTYPE_DATE = 3;
 this.FTYPE_STR  = 4;
 this.FTYPE_HOUR  = 31;

 this.FFTYPE_INT  = '1';
 this.FFTYPE_REAL = '2';
 this.FFTYPE_DATE = '3';
 this.FFTYPE_HOUR = '31';
 this.FFTYPE_STR  = '4';

//operators used
 this.OP_UNDEFINED = '0';
 this.OP_LESS = '1';
 this.OP_LESSEQ = '2';
 this.OP_EQ = '3';
 this.OP_GREATER = '4';
 this.OP_GREATEREQ = '5';
 this.OP_LIKE = '6';
 this.OP_UNLIKE = '7';
 this.OP_BETWEEN = '8';


//METHODS
 this.finalize = function()
 {
 }
//---------------------------------------------------
 this.init = function()
 {
 this.location = null;
	this.subQueryLocation = null;
 this.tempWin = null;
 this.loadQuery = false;
 this.hidden = false;
 this.familyNr = 0;
 this.familyNames = null;
 this.familyNames = new Array();
 this.familyIDs = null;
 this.familyIDs = new Array();
 this.familySelNames = null;
 this.familySelNames = new Array();
 this.familySelIDs = null;
 this.familySelIDs = new Array();
 this.fieldNames = null;
 this.fieldNames = new Array();

 this.fieldNr = 0;
 this.fieldIDs = null;
 this.fieldIDs = new Array();
 this.fieldTypes = null;
 this.fieldTypes = new Array();
 this.fillTypes = null;
 this.fillTypes = new Array();

 this.ops = null;
 this.ops = new Array();
 this.val1 = null;
 this.val1 = new Array();
 this.val2 = null;
 this.val2 = new Array();

 this.localPath = null;
 this.localPathFile = null;
 this.localFile = null;

 this.statusDelFile = 0;
 }
}


//###########################################################
function GQueryResult()
{
//VARIABLES
 this.cols = new Array();
 this.colIds = new Array();
 this.types = new Array();
 this.rows = new Array();
 this.ids = new Array();
 this.docIds = new Array();
 this.hasLinkedDocs = new Array();
 this.hasAttach = new Array();
 this.hasOutProtocol = new Array();
 this.isTif = new Array();
 this.docFamily = new Array();
 this.docFName = new Array();
 this.nextDocFName = new Array();
 this.prevDocFName = new Array();
 this.nextDocFamily = new Array();
 this.prevDocFamily = new Array();
 this.prewRows = new Array();
 this.prewIds = new Array();
 this.prewDocIds = new Array();
 this.nextRows = new Array();
 this.nextIds = new Array();
 this.nextDocIds = new Array();
 this.result = new Array();
 this.currentDocId = 0;
 this.currentPhisicalDocId = 0;
 this.currentDocFamId = 0;
 this.sCol = null;
 this.clickedTableRow = 0;
 this.lastReadedDocId = 0;
 this.rezSz = 0;
 this.poz = 30;
 this.maxPoz = 0;
 this.sz1 = 0;
 this.sz2 = 15;
 this.sz3 = 15;
 this.lastAction = 1;

 this.mOver = null;
 this.mOut = null;
 this.tableClick = null;

//METHODS
 this.finalize = function()
 {

 }

//---------------------------------------------------
 this.init = function()
 {
 this.cols = null;
 this.cols = new Array();
 this.colIds = null;
 this.colIds = new Array();
 this.types = null;
 this.types = new Array();
 this.rows = null;
 this.rows = new Array();
 this.prewRows = null;
 this.prewRows = new Array();
 this.nextRows = null;
 this.nextRows = new Array();
 this.result = null;
 this.result = new Array();
 this.sCol = null;
 this.rezSz = 0;
 this.poz = 0;
 this.maxPoz = 0;
 this.sz1 = 0;
 this.sz2 = 15;
 this.sz3 = 15;
 this.lastAction = 1;
 this.hasLinkedDocs = null;
 this.hasLinkedDocs = new Array();
 this.hasAttach = null;
 this.hasAttach = new Array();
 this.hasOutProtocol = null;
 this.hasOutProtocol = new Array();
 this.isTif = null;
 this.isTif = new Array();
 this.currentDocFamId = 0;
 }

}


//###########################################################
function GSavedQuery()
{
//VARIABLES
 this.savedQueryNames = new Array();

 //METHODS
  this.finalize = function()
  {

  }

  this.init = function()
  {
    this.savedQueryNames = new Array();
  }

}


//###########################################################
function GViewLinkedDocs()
{
//VARIABLES
 this.cols = new Array();
 this.colIds =  new Array();
 this.clickedTableRow = null;
 this.currentDocId = null;
 this.currentParentForLinked = 0;
 this.docFamily = new Array();
 this.docFName = new Array();
 this.nextDocFName = new Array();
 this.prevDocFName = new Array();
 this.ids = new Array();
 this.hasLinkedDocs = new Array();
 this.hasAttach = new Array();
 this.hasOutProtocol = new Array();
 this.isTif = new Array();

 this.ldPageRef = null;

//EVENTS:
 this.mOver = null;
 this.mOut = null;
 this.tableClick = null;

//METHODS
 this.finalize = function()
 {

 };

//---------------------------------------------------
 this.init = function()
 {
  this.cols = null;
  this.cols = new Array();
  this.clickedTableRow = null;
  this.currentDocId = null;
  this.currentParentForLinked = null;	 
  this.docFamily = null;
  this.docFName = null;
  this.nextDocFName = null;
  this.prevDocFName = null;
  this.ids = null;
  this.ids = new Array();
  this.mOver = null;
  this.mOut = null;
  this.tableClick = null;
  this.hasLinkedDocs = null;
  this.hasLinkedDocs = new Array();
  this.hasAttach = null;
  this.hasAttach = new Array();
  this.hasOutProtocol = null;
  this.hasOutProtocol = new Array();
  this.isTif = null;
  this.isTif = new Array();
 };

}

