//JS Functions @0-7884768D
var isNN = (navigator.appName.indexOf("Netscape") != -1);
var isIE = (navigator.appName.indexOf("Microsoft") != -1);
var IEVersion = (isIE ? getIEVersion() : 0);
var NNVersion = (isNN ? getNNVersion() : 0);
var EditableGrid = false;
var disableValidation = false;

function functionExists(functionName)
{
  var exists = true;
  try{
    exists = typeof(eval(functionName))=="function";
  }catch(e){
    exists = false;
  }
  return exists;
}

function ccsShowError(control, msg)
{
  alert(msg);
  control.focus();
  return false;
}

function getNNVersion()
{
  var userAgent = window.navigator.userAgent;
  var isMajor = parseInt(window.navigator.appVersion);
  var isMinor = parseFloat(window.navigator.appVersion);
  if (isMajor == 2) return 2;
  if (isMajor == 3) return 3;
  if (isMajor == 4) return 4;
  if (isMajor == 5) 
  {
    if (userAgent.toLowerCase().indexOf('netscape')!=-1)
    {
      isMajor = parseInt(userAgent.substr(userAgent.toLowerCase().indexOf('netscape')+9));
      if (isMajor>0) return isMajor;
    }
    return 6;
  }
  return isMajor;
}

function getIEVersion()
{
  var userAgent = window.navigator.userAgent;
  var MSIEPos = userAgent.indexOf("MSIE");
  return (MSIEPos > 0 ? parseInt(userAgent.substring(MSIEPos+5, userAgent.indexOf(".", MSIEPos))) : 0);
}

function inputMasking(evt)
{
  if (isIE && IEVersion > 4)
  {
    if (window.event.altKey) return false;
    if (window.event.ctrlKey) return false;
    if (typeof(this.ccsInputMask) == "string")
    {
      var mask = this.ccsInputMask;
      var keycode = window.event.keyCode;
      this.value = applyMask(keycode, mask, this.value);
    }
    return (window.event.keyCode==13?true:false);
  } else if (isNN && NNVersion<6)
  {
    if (evt.ALT_MASK) return false;
    if (evt.CONTROL_MASK) return false;
    if (typeof(this.ccsInputMask) == "string")
    {
      var mask = this.ccsInputMask;
      var keycode = evt.which;
      this.value = applyMask(keycode, mask, this.value);
    }
    return (evt.which==13?true:false);
  } else if (isNN && NNVersion==6)
  {
    if (evt.altKey) return false;
    if (evt.ctrlKey) return false;
    var cancelKey = evt.which==13;
    if (typeof(this.ccsInputMask) == "string")
    {
      var mask = this.ccsInputMask;
      var keycode = evt.which;
      if (keycode >= 32)
        this.value = applyMaskToValue(mask, this.value);
    }
    return cancelKey || evt.which==13;
  } else if (isNN && NNVersion==7)
  {
    if (evt.altKey) return false;
    if (evt.ctrlKey) return false;
    var cancelKey = evt.which==13;
    if (typeof(this.ccsInputMask) == "string")
    {
      var mask = this.ccsInputMask;
      var keycode = evt.which;
      cancelKey = keycode < 32;
      if (!cancelKey)
        this.value = applyMask(keycode, mask, this.value);
    }
    return cancelKey || evt.which==13;
  } else
    return true;
}

function applyMaskToValue(mask, value)
{
  var oldValue = String(value);
  var newValue = "";
  for (var i=0; i<oldValue.length; i++)
  {
    newValue = applyMask(oldValue.charCodeAt(i), mask, newValue);
  }
  return newValue;
}

function applyMask(keycode, mask, value)
{
  var digit = (keycode >= 48 && keycode <= 57);
  var plus = (keycode == 43);
  var dash = (keycode == 45);
  var space = (keycode == 32);
  var uletter = (keycode >= 65 && keycode <= 90);
  var lletter = (keycode >= 97 && keycode <= 122);
  
  var pos = value.length;
  switch(mask.charAt(pos))
  {
    case "0":
      if (digit)
        value += String.fromCharCode(keycode);
      break;
    case "L":
      if (uletter || lletter)
        value += String.fromCharCode(keycode);
      break;
    default:
      var isMatchMask = (String.fromCharCode(keycode) == mask.charAt(pos));
      while (pos < mask.length && mask.charAt(pos) != "0" && mask.charAt(pos) != "L")
        value += mask.charAt(pos++);
      if (!isMatchMask && pos < mask.length)
        value = applyMask(keycode, mask, value);
  }  
  return value;
}

function validate_control(control)
{
/*
ccsCaption - string
ccsErrorMessage - string

ccsRequired - boolean
ccsMinLength - integer
ccsMaxLength - integer
ccsRegExp - string

ccsValidator - validation function

ccsInputMask - string
*/
  if (disableValidation) return true;
  var errorMessage = control.ccsErrorMessage;
  var customErrorMessage = (typeof(errorMessage) != "undefined");
   
  if (typeof(control.ccsRequired) == "boolean" && control.ccsRequired)
    if (control.value == "")
      return ccsShowError(control, customErrorMessage ? errorMessage :
        "The value in field " + control.ccsCaption + " is required.");

  if (typeof(control.ccsMinLength) == "number")
    if (control.value != "" && control.value.length < parseInt(control.ccsMinLength))
      return ccsShowError(control, customErrorMessage ? errorMessage :
        "The length in field " + control.ccsCaption + " can't be less than " + parseInt(control.ccsMinLength) + " symbols.");

  if (typeof(control.ccsMaxLength) == "number")
    if (control.value != "" && control.value.length > parseInt(control.ccsMaxLength))
      return ccsShowError(control, customErrorMessage ? errorMessage :
        "The length in field " + control.ccsCaption + " can't be greater than " + parseInt(control.ccsMaxLength) + " symbols.");

  if (typeof(control.ccsInputMask) == "string")
  {
    var mask = control.ccsInputMask;
    var maskRE = new RegExp(stringToRegExp(mask).replace(/0/g,"\\d").replace(/L/g,"[A-Za-z]"), "i");
    if (control.value != "" && (control.value.search(maskRE) == -1))
      return ccsShowError(control, customErrorMessage ? errorMessage :
        "The value in field " + control.ccsCaption + " is not valid.");
  }

  if (typeof(control.ccsRegExp) == "string")
    if (control.value != "" && (control.value.search(new RegExp(control.ccsRegExp, "i")) == -1))
      return ccsShowError(control, customErrorMessage ? errorMessage :
        "The value in field " + control.ccsCaption + " is not valid.");

  if (typeof(control.ccsDateFormat) == "string")
  {
    if (control.value != "" && !checkDate(control.value, control.ccsDateFormat))
      return ccsShowError(control, customErrorMessage ? errorMessage :
        "The value in field " + control.ccsCaption + " is not valid. Use the following format: "+control.ccsDateFormat);
  }

  if (typeof(control.ccsValidator) == "function")
    if (!control.ccsValidator())
      return ccsShowError(control, customErrorMessage ? errorMessage :
        "The value in field " + control.ccsCaption + " is not valid.");

  return true;
}

function stringToRegExp(string, arg)
{
  var str = String(string);
  str = str.replace(/\\/g,"\\\\");
  str = str.replace(/\//g,"\\/");
  str = str.replace(/\./g,"\\.");
  str = str.replace(/\(/g,"\\(");
  str = str.replace(/\)/g,"\\)");
  str = str.replace(/\[/g,"\\[");
  str = str.replace(/\]/g,"\\]");
  return str;
}

function checkDate(dateValue, dateFormat)
{
  var DateMasks = new Array(
                    new Array("MMMM", "[a-z]+"),
                    new Array("mmmm", "[a-z]+"),
                    new Array("yyyy", "[0-9]{4}"),
                    new Array("MMM", "[a-z]+"),
                    new Array("mmm", "[a-z]+"),
                    new Array("HH", "([0-1][0-9]|2[0-4])"),
                    new Array("hh", "(0[1-9]|1[0-2])"),
                    new Array("dd", "([0-2][0-9]|3[0-1])"),
                    new Array("MM", "(0[1-9]|1[0-2])"),
                    new Array("mm", "(0[1-9]|1[0-2])"),
                    new Array("yy", "[0-9]{2}"),
                    new Array("nn", "[0-5][0-9]"),
                    new Array("ss", "[0-5][0-9]"),
                    new Array("w", "[1-7]"),
                    new Array("d", "([1-9]|[1-2][0-9]|3[0-1])"),
                    new Array("y", "([1-2][0-9]{0,2}|3([0-5][0-9]|6[0-5]))"),
                    new Array("H", "(00|0?[1-9]|1[0-9]|2[0-4])"),
                    new Array("h", "(0?[1-9]|1[0-2])"),
                    new Array("M", "(0?[1-9]|1[0-2])"),
                    new Array("m", "(0?[1-9]|1[0-2])"),
                    new Array("n", "[0-5]?[0-9]"),
                    new Array("s", "[0-5]?[0-9]"),
                    new Array("q", "[1-4]")
                  );
  var regExp = "^"+stringToRegExp(dateFormat)+"$";
  for (var i=0; i<DateMasks.length; i++)
  {
    regExp = regExp.replace(DateMasks[i][0], DateMasks[i][1]);
  }
  var regExp = new RegExp(regExp,"i");
  return String(dateValue).search(regExp)!=-1;
}

function validate_row(rowId, form)
{
  var result = true;
  var isInsert = false;
  if (disableValidation) return true;
  if(typeof(eval(form + "EmptyRows")) == "number")
    if(eval(form + "Elements").length - rowId <= eval(form + "EmptyRows"))
      isInsert = true;
    for (var i = 0; i < eval(form + "Elements")[rowId].length && isInsert; i++)
      isInsert = GetValue(eval(form + "Elements")[rowId][i]) == "";
  if(isInsert) return true;

  if(typeof(eval(form + "DeleteControl")) == "number")
    {
      var control = eval(form + "Elements")[rowId][eval(form + "DeleteControl")];
      if(control.type == "checkbox")
        if(control.checked == true ) return true;
      if(control.type == "hidden")
        if(control.value != "" ) return true;
    }

  for (var i = 0; i < eval(form + "Elements")[rowId].length && (result = validate_control(eval(form + "Elements")[rowId][i])); i++);
  return result;
}

function GetValue(control) {
    if (typeof(control.value) == "string") {
        return control.value;
    }
    if (typeof(control.tagName) == "undefined" && typeof(control.length) == "number") {
        var j;
        for (j=0; j < control.length; j++) {
            var inner = control[j];
            if (typeof(inner.value) == "string" && (inner.type != "radio" || inner.status == true)) {
                return inner.value;
            }
        }
    }
    else {
        return GetValueRecursive(control);
    }
    return "";
}

function GetValueRecursive(control)
{
    if (typeof(control.value) == "string" && (control.type != "radio" || control.status == true)) {
        return control.value;
    }
    var i, val;
    for (i = 0; i<control.children.length; i++) {
        val = GetValueRecursive(control.children[i]);
        if (val != "") return val;
    }
    return "";
}


function validate_form(form)
{
  var result = true;
  if (disableValidation) return true;
  if(typeof(form) == "object" && String(form.tagName).toLowerCase()!="form" && form.form!=null) form = form.form;
  if(typeof(form) == "object" && document.getElementById(form.name + "Elements")) {
    if (typeof(eval(form.name + "Elements")) == "object") 
      for (var j = 0; j < eval(form.name + "Elements").length && result; j++) result = validate_row(j, form.name);
    else 
      for (var i = 0; i < form.elements.length && (result = validate_control(form.elements[i])); i++);
  }else if(typeof(form) == "string" && document.getElementById(form.name + "Elements"))
  {
    if(typeof(eval(form + "Elements")) == "object"){
      for (var j = 0; j < eval(form + "Elements").length && result; j++)
        result = validate_row(j, form);
    }
  }else if (typeof(form) == "object")
          for (var i = 0; i < form.elements.length && (result = validate_control(form.elements[i])); i++);
        else	
          for (var i = 0; i < document.forms[form].elements.length && (result = validate_control(document.forms[form].elements[i])); i++);
  return result;
}

function forms_onload()
{
  var forms = document.forms;
  var i, j, elm, form;
  for(i = 0; i < forms.length; i++)
  {
    form = forms[i];
    if (typeof(form.onLoad) == "function") form.onLoad();
    for (j = 0; j < form.elements.length; j++)
    {
      elm = form.elements[j];
      if (typeof(elm.onLoad) == "function") elm.onLoad();
    }
  }
  return true;
}

//
// If element exist than bind function func to element on event.
// Example: check_and_bind('document.NewRecord1.Delete1','onclick',page_NewRecord1_Delete1_OnClick);
//
function check_and_bind(element,event,func) {
  var htmlElement = eval(element);
  if (htmlElement) {
    if (typeof(htmlElement)=="object" && !htmlElement.tagName && htmlElement.length > 0)
    {
      for (var i=0; i < htmlElement.length; i++)
        eval(element+"["+i+'].'+event+'='+func);
    }else eval(element+'.'+event+'='+func);
  }
}

//End JS Functions

// ================================================================================================================
// Nome      : SelectUnselectListboxCheckboxList
//
// Descrição : Selects, unselects, toggles selections in HTML listboxes or checkbox lists.
//
// Parâmetros: Nome                          Descrição                                                    Opcional?
//             ----------------------------  -----------------------------------------------------------  ---------
//             SelectionType                 's' (select), 'u' (unselect) or 't' (toggle).
//
// Retorno   : 
// ================================================================================================================
function SelectUnselectListboxCheckboxList(HTMLForm, HTMLElementPrefixName, SelectionType)
{
  var len = HTMLForm.elements.length;

  for (var i = 0; i < len; i++)
    if (HTMLForm.elements[i].name.indexOf(HTMLElementPrefixName) == 0)
      {
      if (HTMLForm.elements[i].type.toLowerCase() == 'checkbox')
        HTMLForm.elements[i].checked = 
		    ((SelectionType.toLowerCase() == 's') ? true : ((SelectionType.toLowerCase() == 'u') ? false : !HTMLForm.elements[i].checked));
      else if (HTMLForm.elements[i].type.toLowerCase() == 'select-multiple')
        {
        for (var j = 0; j < HTMLForm.elements[i].length; j++)
          HTMLForm.elements[i].options[j].selected = 
              ((SelectionType.toLowerCase() == 's') ? true : ((SelectionType.toLowerCase() == 'u') ? false : !HTMLForm.elements[i].options[j].selected));
        }
      }
}

// ================================================================================================================
// Nome      : EnableDisableCheckboxList
//
// Descrição : Disables checkbox lists.
//
// Parâmetros: Nome                          Descrição                                                    Opcional?
//             ----------------------------  -----------------------------------------------------------  ---------
//
// Retorno   : 
// ================================================================================================================
function EnableDisableCheckboxList(HTMLForm, HTMLElementPrefixName, enabledDisabled)
{
  var len = HTMLForm.elements.length;

  for (var i = 0; i < len; i++)
    if ((HTMLForm.elements[i].name.indexOf(HTMLElementPrefixName) == 0) && (HTMLForm.elements[i].type.toLowerCase() == 'checkbox'))
      HTMLForm.elements[i].disabled = enabledDisabled;
}

// ================================================================================================================
// Nome      : OpenPopUpList
//
// Descrição : Opens a list for selection in a pop-up window.
//
// Parâmetros: Nome                          Descrição                                                    Opcional?
//             ----------------------------  -----------------------------------------------------------  ---------
//
// Retorno   : 
// ================================================================================================================
function OpenPopUpList(popUpListURL, 
                       IDFieldID, 
											 textFieldID,
											 IDColumn, 
											 textColumn, 
											 searchColumn, 
											 popupWindowWidth, 
											 popupWindowHeight)
{
  var currentTextFieldValue = 
	    (document.getElementById(IDFieldID).value == '') ? 
		    escape(document.getElementById(textFieldID).value) : 
				'';

  OpenPopUpWindow(popUpListURL + 
			                ((String(popUpListURL).indexOf('?') == -1) ? '?' : '&') + 
			                searchColumn + '=' + currentTextFieldValue +
											'&IDFieldID=' + IDFieldID +
											'&textFieldID=' + textFieldID +
											'&IDColumn=' + IDColumn +
											'&textColumn=' + textColumn, 
	                popupWindowWidth, 
									popupWindowHeight, 
									null);
}

// ================================================================================================================
// Nome      : SetOpenerIDTextFields
//
// Descrição : Set the opener ID and Text fields, based on the current selection.
//
// Parâmetros: Nome                          Descrição                                                    Opcional?
//             ----------------------------  -----------------------------------------------------------  ---------
//
// Retorno   : 
// ================================================================================================================
function SetOpenerIDTextFields(IDFieldID, 
                               textFieldID, 
															 currentSelectionID, 
															 currentSelectionText)
{
  window.opener.document.getElementById(IDFieldID).value   = currentSelectionID;
  window.opener.document.getElementById(textFieldID).value = 
	    StripHTML(currentSelectionText);

  window.opener.document.getElementById(textFieldID).focus();

  window.close();
}

// ================================================================================================================
// Nome      : StripHTML
//
// Descrição : 
//
// Parâmetros: Nome                          Descrição                                                    Opcional?
//             ----------------------------  -----------------------------------------------------------  ---------
//
// Retorno   : 
// ================================================================================================================
function StripHTML(HTMLCode)
{
  var result = String(HTMLCode);

  result = result.replace(/<br>/gi,                 '\n');
	result = result.replace(/<\/?\w+[^>]*>/gi,        '');      // Strip all HTML tags.
  result = result.replace(/&nbsp;/gi,               ' ');
  result = result.replace(/&gt;/gi,                 '>');
  result = result.replace(/&lt;/gi,                 '<');
  result = result.replace(/&quot;/gi,               '"');
  result = result.replace(/&apos;/gi,               '\'');
  result = result.replace(String.fromCharCode(160), ' ');    // 160 = Unicode nbsp.
  result = result.replace(/\s+/gi,                  ' ');    // Strip all contiguous spaces.
  result = result.replace(/^\s*((?:.|\n)*?)\s*$/gi, '$1');   // Strip all left and right spaces.

  return result;
}

// ================================================================================================================
// Nome      : OpenPopUpWindow
//
// Descrição : Opens a pop-up window.
//
// Parâmetros: Nome                          Descrição                                                    Opcional?
//             ----------------------------  -----------------------------------------------------------  ---------
//
// Retorno   : 
// ================================================================================================================
function OpenPopUpWindow(url, width, height, features)
{
  OpenPopUpWindowXY(url, width, height, 0, 0, features);
}

// ================================================================================================================
// Nome      : OpenPopUpWindowXY
//
// Descrição : Opens a pop-up window.
//
// Parâmetros: Nome                          Descrição                                                    Opcional?
//             ----------------------------  -----------------------------------------------------------  ---------
//
// Retorno   : 
// ================================================================================================================
function OpenPopUpWindowXY(url, width, height, x, y, features)
{
  var popUpWindow = 
      window.open(url + ((url.indexOf('?') == -1) ? '?' : '&') + 'popup=true', 
                  'PopUpWindow_' + String(Math.random()).substr(2),
			  					'width=' + width + ',height=' + height + ', ' + ((features == null) ? 'left=' + x + ',top=' + y + ',status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes' : features));

  popUpWindow.focus();
}

// ================================================================================================================
// Nome      : SetDocumentImageTitlesBasedOnAlt
//
// Descrição : Sets all 'title' tags of all document images based on their 'alt' tags, for compatibility with
//             Netscape.
//
// Parâmetros: Nome                          Descrição                                                    Opcional?
//             ----------------------------  -----------------------------------------------------------  ---------
//
// Retorno   : 
// ================================================================================================================
function SetDocumentImageTitlesBasedOnAlt()
{
	for (var i = 0; i < document.images.length; i++)
    if ((document.images[i].title == '') && (document.images[i].alt != ''))
		  document.images[i].title = document.images[i].alt;
}

// ================================================================================================================
// Nome      : AddCommandToJSEvent
//
// Descrição :
//
// Parâmetros: Nome                          Descrição                                                    Opcional?
//             ----------------------------  -----------------------------------------------------------  ---------
//
// Retorno   : 
// ================================================================================================================
function AddCommandToJSEvent(fAnonymous, sNewCommand, bAddToEnd)
{
  var sScript;

  if (fAnonymous)
    {
    sScript = new String(fAnonymous);

    if (sScript.indexOf('{') > 0)
      {
      sScript = sScript.substring(sScript.indexOf('{') + 1, sScript.lastIndexOf('}') - 1);

      if (bAddToEnd)
        sScript += sNewCommand;
      else
        sScript = sNewCommand + sScript;
      }
    }
  else
    sScript = new String(sNewCommand);

  return new Function(sScript);
}

// ================================================================================================================
// Nome      : InArray
//
// Descrição :
//
// Parâmetros: Nome                          Descrição                                                    Opcional?
//             ----------------------------  -----------------------------------------------------------  ---------
//
// Retorno   : 
// ================================================================================================================
function InArray(element, array)
{
  var i           = 0;
	var arrayLength = array.length;
	var found       = false;
  
  while ((i < arrayLength) && !found) 
    if (element == array[i])
      found = true;
    else
      i++;
      
  return (found ? i : -1);
}
  
// ================================================================================================================
// Nome      : EnableDisableHTMLInputFields
//
// Descrição :
//
// Parâmetros: Nome                          Descrição                                                    Opcional?
//             ----------------------------  -----------------------------------------------------------  ---------
//
// Retorno   : 
// ================================================================================================================
function EnableDisableHTMLInputFields(form, theme)
{
  var formLength      = form.elements.length;
  var searchedClasses = [theme + 'Input', theme + 'Textarea', theme + 'Select'];

  for (var i = 0; i < formLength; i++)
    {
    var elementClassIndex = 
        InArray(form.elements[i].className.replace(/^(\w+)\_d$/, '$1'), 
                searchedClasses);
    
    if (elementClassIndex != -1)
      form.elements[i].className = searchedClasses[elementClassIndex] + 
					((form.elements[i].disabled || form.elements[i].readOnly) ? '_d' : '');
    }
}

// ================================================================================================================
// Nome      : StringEndsWith
//
// Descrição : 
//
// Parâmetros: Nome                          Descrição                                                    Opcional?
//             ----------------------------  -----------------------------------------------------------  ---------
//
// Retorno   : 
// ================================================================================================================
function StringEndsWith(originalString, searchedString)
{
  var result = 
      ((originalString.length >= searchedString.length) && 
       (originalString.substr(originalString.length - searchedString.length) == searchedString));

  return result;
}

// ================================================================================================================
// Nome      : GenerateAlternateRows
//
// Descrição : 
//
// Parâmetros: Nome                          Descrição                                                    Opcional?
//             ----------------------------  -----------------------------------------------------------  ---------
//
// Retorno   : 
// ================================================================================================================
function GenerateAlternateRows(htmlTableID)
{
  var htmlTable = document.getElementById(htmlTableID);
  var applyAltDataClassIfDataRow = true;
	var dataTD = 'DataTD', altDataTD = 'AltDataTD', errorDataTD = 'ErrorDataTD';
  var isDataRow;

  // If the HTML table ID was not found, return immediately.
  if (htmlTable == null) return;

  // Loop thru all table rows and cells/columns.
  for (var rowIndex = 0; rowIndex < htmlTable.rows.length; rowIndex++)
    for (var cellIndex = 0; cellIndex < htmlTable.rows[rowIndex].cells.length; cellIndex++)
		  // Work with the current cell.
      with (htmlTable.rows[rowIndex].cells[cellIndex])
        {
				// Is it the first cell of the current row?
        if (cellIndex == 0)
          {
					// Yes! Check if it's a data cell, and thus the beginning of a data row.
          isDataRow = 
					    (StringEndsWith(className, dataTD) && 
							 !StringEndsWith(className, errorDataTD) &&
							 !StringEndsWith(className, altDataTD));

          if (isDataRow) applyAltDataClassIfDataRow = !applyAltDataClassIfDataRow;
          }

        // Should we apply the alternate data CSS class to it?
        if (isDataRow && applyAltDataClassIfDataRow)
				  // Yes!
				  className = className.replace(dataTD, altDataTD);
				else
				  // No! Jump on to the next row.
				  break;
        }
}

// ================================================================================================================
// Nome      : AdjustHtmlElementHeight
//
// Descrição : 
//
// Parâmetros: Nome                          Descrição                                                    Opcional?
//             ----------------------------  -----------------------------------------------------------  ---------
//
// Retorno   : 
// ================================================================================================================
function AdjustHtmlElementHeight(HtmlElementID, minimumHeight, reservedAreaHeight)
{
  var displayableAreaHeight = 
	    (isIE ? document.body.clientHeight : window.innerHeight);

  document.getElementById(HtmlElementID).style.height = 
      (displayableAreaHeight - reservedAreaHeight > minimumHeight) ? 
         displayableAreaHeight - reservedAreaHeight : 
         minimumHeight;
}
