// Global constants
  var descriptionWidth  = 420;
  var descriptionHeight = 330;
  var legendWidth       = 700;
  var legendHeight      = 450;
  var noDivList         = "|6|11|12|";
  var definitionURL     = "report_definitions.html";
  var errInvalidReport  = "You have selected a report category.\n\nPlease select a report and click the arrow button.";

// Status bar copy for Perf Standards and Call Response reports
  var igrPerfStandardStatusBarText = "Mouse over each performance standard to view a description. Click on [Report Description] to view the complete legend.";
  var igrCallResponseStatusBarText = "Mouse over each reason for calling to view a description. Click on [Report Description] to view the complete legend.";


  var visibleVar="null";
  if (is_nav) {
   layerRef="document.layers.";
   styleSwitch="";
   visibleVar="show";
   hiddenVar="hide";
  } else {
   layerRef="document.all.";
   styleSwitch=".style";
   visibleVar="visible";
   hiddenVar="hidden";
  }

// Display the Clear Divisions button if divisions are selected
function displayDivClear (pageNum){
  if ((divList.length > 0) && (noDivList.indexOf("|" + pageNum + "|") == -1)) {
    document.write("<a href=\"#\" onClick=\"clearDivs();\" ><img src=\"images/applications/clear_divisions.gif\" width=\"134\" height=\"26\" vspace=\"3\" border=\"0\" name=\"cleardivisions\"></a>");
    document.qwiknav.D.value = divList;
  }
}

// Set D field to all divisions (blank) and submit form
function clearDivisions () {
  document.qwiknav.D.value = "";
  validateQuikNav();
}

// Reset the form to retrieve reports
function resetForm (){
  document.qwiknav.target = "_top";
  document.qwiknav.action = origAction;
}

function show (divName) {
  if (is_nav6up || is_ie5up) {
    document.getElementById(divName).style.visibility = "visible";
    document.getElementById(divName).style.zIndex = "1";
  } else {
    eval(layerRef + divName + styleSwitch + '.visibility="visible"');
    eval(layerRef + divName + styleSwitch + '.zIndex = "1"');
  }
}

function hide (divName) {
  if (is_nav6up || is_ie5up) {
    document.getElementById(divName).style.visibility = "hidden";
    document.getElementById(divName).style.zIndex = "10";
  } else {
    eval(layerRef + divName + styleSwitch + '.visibility="hidden"');
    eval(layerRef + divName + styleSwitch + '.zIndex = "10"');
  }
}

function showContent (divName) {
  if (is_nav6up || is_ie4up) show(divName);
}

function displayPage () {
  showContent('content');
  hide('waitRptMsg');
}

function utilLayers () {
  if (is_mac && is_ie) {
    show('iemac');
  } else if (is_ie4up || is_nav4up) {
      if (is_nav4 && is_minor < 4.1) show('pre41');
      else show('ver4');
  } else {
    show('old');
  }
}

function hideAll () {
  hide('old');
  hide('ver4');
  hide('pre41');
}

function backToDescription () {
  window.resizeTo(descriptionWidth,descriptionHeight);
  history.back();
}

function openLegend (strLegendURL) {
  window.resizeTo(legendWidth,legendHeight);
  document.location = strLegendURL;
}

function getDef(gid,inPage){
  var marker = (is_mac && !is_nav) ? "#A" : "?rid=";
  var urlString = (definitionURL + marker + inPage + "&gid=" + gid);
  defWin = window.open(urlString,"defWin","width=" + descriptionWidth + ",height=" + descriptionHeight + ",resizable=yes,scrollbars=yes,menubar=yes,status=yes");
  defWin.resizeTo(descriptionWidth,descriptionHeight);
  defWin.focus();
}

function validateQuikNav () {
  theSelect = document.qwiknav.rid;
  if (theSelect.options[theSelect.selectedIndex].value == '-1') {
    alert(errInvalidReport);
    return false;
  } else {
    document.qwiknav.submit();
  }
}