
function HTMLNavigationGrid(sys, formID, posX, posY) {
  this.create(sys, formID, posX, posY, 40, 20);
}

HTMLNavigationGrid.inherits(HTMLNavigation);

HTMLNavigationGrid.prototype.name = 'HTMLNavigationGrid';

HTMLNavigationGrid.prototype.createButton = function(img, description, hint, onclick, space, div, width, tab, visible) {
  var bt = new HTMLButton(this.sys, this.formID, -1, space, 0, width, this.height, description, img);
  bt.hint = hint;
  bt.onclick = onclick;
  bt.visible = visible;
  bt.design(div, tab);
  this.buttons.push(bt);
  return bt;
}

HTMLNavigationGrid.prototype.setMainImages = function(imgInclude, imgEdit, imgDelete, imgRefresh, imgFields) {
  if (imgInclude != -1) this.btInclude = this.addMainButton(skin+'grid_include.gif', getLocaleMessage("LABEL.INCLUDE"), this.getAction('actInclude'), 40);
  if (imgEdit != -1)    this.btEdit = this.addMainButton(skin+'grid_edit.gif', getLocaleMessage("LABEL.RECORD_EDIT"), this.getAction('actEdit'), 40);
  if (imgDelete != -1)  this.btDelete = this.addMainButton(skin+'grid_delete.gif', getLocaleMessage("LABEL.REMOVE_RECORD"), this.getAction('actDelete'), 40);
  if (imgRefresh != -1) this.btRefresh = this.addMainButton(skin+'grid_refresh.gif', getLocaleMessage("LABEL.REFRESH"), this.getAction('actRefresh'), 40);
  if (imgFields != -1)  this.btFields = this.addMainButton(skin+'grid_sort.gif', getLocaleMessage("INFO.MANIPULATE_GRID_FIELDS"), this.getAction('actFields'), 40);
}

HTMLNavigationGrid.prototype.setEditImages = function(imgSave, imgCancel) {
  if (imgSave != -1)   this.btEditSave = this.addEditButton(skin+'grid_save.gif', getLocaleMessage("LABEL.OK"), getLocaleMessage("LABEL.OK"), this.getAction('actEditSave'), false, 80);
  if (imgCancel != -1) this.btEditCancel = this.addEditButton(skin+'grid_cancel.gif', getLocaleMessage("LABEL.CANCEL"), getLocaleMessage("LABEL.CANCEL"), this.getAction('actEditCancel'), false, 80);
}

HTMLNavigationGrid.prototype.setIncludeImages = function(imgSave, imgCancel) {
  if (imgSave != -1)   this.btIncludeSave = this.addIncludeButton(skin+'grid_save.gif', getLocaleMessage("LABEL.OK"), getLocaleMessage("LABEL.OK"), this.getAction('actIncludeSave'), false, 80);
  if (imgCancel != -1) this.btIncludeCancel = this.addIncludeButton(skin+'grid_cancel.gif', getLocaleMessage("LABEL.CANCEL"), getLocaleMessage("LABEL.CANCEL"), this.getAction('actIncludeCancel'), false, 80);
}

HTMLNavigationGrid.prototype.actInclude = function() {
  this.parent.include();
}

HTMLNavigationGrid.prototype.actEdit = function() {
  this.parent.edit();
}

HTMLNavigationGrid.prototype.actDelete = function() {
  this.parent.deleteRow(this);
}

HTMLNavigationGrid.prototype.actRefresh = function() {
  this.parent.refresh();
}

HTMLNavigationGrid.prototype.actFields = function() {
  this.parent.openGridManager();
}

HTMLNavigationGrid.prototype.actEditSave = function() {
  this.parent.post();
}

HTMLNavigationGrid.prototype.actEditCancel = function() {
  this.parent.cancelEdit();
}

HTMLNavigationGrid.prototype.actIncludeSave = function() {
  this.parent.post();
}

HTMLNavigationGrid.prototype.actIncludeCancel = function() {
  this.parent.cancelInclude();
}
