// Non-library functions which are nonetheless common across PIR pages.

// Returns true if the XMLHttpRequest object response's X-Html-Template-Name header is one of the acceptableValues (an array)

checkTemplateHeader = function (response, acceptableValues) {
  var xHtmlTemplateName = response.getResponseHeader('X-Html-Template-Name');
  acceptableValues = acceptableValues.concat( [ "status.htmlf", "dump-backtrace.html", "debug-input.html" ] );
  return !(oddjobs.func.filter ( function (value) {							
    return (xHtmlTemplateName == value);
  }, acceptableValues).length);
};

redirectToLogin = function () {
  location.replace ('login');
};

// We need to wrap since initialize is not yet defined.
window.onload = function () {
  initialize();
}