<!-- JavaScripts for showing and hiding the progress bar! -->

/**
 * Shows the progress panel. Is used by the doSearch(..) function.
 *
 * Both arguments are optional and has defaults.
 */
function showProgressPanel(message, header) {
  // showHide('mainContentArea', false);
  openProgressPanel(message, header);
  scroll(0, 0);
}

/**
 * Hides the progress panel. It defaults to hidden.
 */
function hideProgressPanel() {
  if (YAHOO.ibe && YAHOO.ibe.progressPanel) {
    YAHOO.ibe.progressPanel.hide();
  }
  // showHide('mainContentArea', true);
}

/**
 * Use as an onClick-parameter to a submit button to use the progress panel when form is submitted.
 * A correct validation function (JavaScript) must be supplied.
 * @param The validation function for the form, e.g. "validateForm_air_search_do()".
 * @returns The result of the validation. 0 is failed validation, 1 is OK.
 */
function formProgress(validation_result, message, header) {
  if (validation_result) showProgressPanel(message, header);
  return validation_result;
}

/**
 * Displays the progress panel and then forwards to new link.
 * @param l Link to forward browser to.
 */
function linkProgress(l, message, header) {
  showProgressPanel(message, header);
  window.location = l;
}

/**
 * Does NOT Display the progress panel, then forwards to new link.
 * @param l Link to forward browser to.
 */
function linkPlain(l) {
  window.location = l;
}
