QueryPanel = function (newId, newParent, newXPosition, newYPosition, newZIndex, newWidth, newHeight, newVisibility, newQueryControl, newQueryControlId)
{
  if (arguments.length > 0)
    this.init(newId, newParent, newXPosition, newYPosition, newZIndex, newWidth, newHeight, newVisibility, newQueryControl, newQueryControlId);
};

QueryPanel.prototype = new GuiWidget();
QueryPanel.constructor = QueryPanel;
QueryPanel.superclass = GuiWidget.prototype;

QueryPanel.prototype.init = function (newId, newParent, newXPosition, newYPosition, newZIndex, newWidth, newHeight, newVisibility, newQueryControl, newQueryControlId)
{
  QueryPanel.superclass.init.call(this, newId, newParent, newXPosition, newYPosition, newZIndex, newWidth, newHeight, newVisibility, "queryObjectPanel");
  this.id = newId;
  if (newQueryControlId != null)
  {
    this.queryControl = OBJECT_MANAGER.getControl(newQueryControlId);
    this.queryControlId = newQueryControlId;
  }
  else
  {
    this.queryControl = newQueryControl;
    this.queryControlId = newQueryControl.id;
  }
  this.queryControl.queryPanel = this;
};

QueryPanel.prototype.initialize = function()
{
  this.queryForms = new Object;
  var yPos = 0;
  for (var i in this.queryControl.queryList)
  {
    this.queryForms[i] = new QueryForm(this.id+'QueryForms.'+i, this.element, 0, yPos, 0, this.width(), 25, true, this.queryControl, this.queryControlId,i);
    yPos = yPos + this.queryForms[i].height();
  }
  this.height(yPos);
};

