/***********************************************************
 * File: report.js
 * (C) Bentley Systems Netherlands BV, 2007
 *
 * History:
 * 23-05-2005   FS   Initial version
 **********************************************************/

var g_cCELL_IDPREFIX = "tdReport";
var g_cDIV_IDPREFIX = "divReport";

var isIE = (document.all) ? true : false;
var g_cDISPLAY_TABLEROW = (isIE) ? "block" : "table-row";


function showLink(sUrl)
{
	fraHtml.location.href = sUrl;
	//fraHtml.document.location.replace = sUrl;
}

function clearLink()
{
	parent.fraReport.location.href = "empty.html";
}

function expand(activeID)
{
  // Retrieve DIV element belonging to given active ID
  var elDiv = document.getElementById(g_cDIV_IDPREFIX + activeID);
  if(!elDiv)
  {
    return;
  }

  // Hide all non-header rows of the table
  var elTable = elDiv.getElementsByTagName("table")[0];
  for(var idx = 0; idx < elTable.rows.length; idx++)
  {
    var elRow = elTable.rows[idx];
    if(isIE)
      var classAttr = elRow.className;
    else
      var classAttr = elRow.getAttribute("class");

    if(classAttr != "rowHead")
    {
      var displayProp = elRow.style.display;
      if(displayProp == "" || displayProp == g_cDISPLAY_TABLEROW) {
        displayProp = "none";
        document.images[activeID].src='./images/GUH_plus.gif';
      }
      else {
        displayProp = g_cDISPLAY_TABLEROW;
        document.images[activeID].src='./images/GUH_min.gif';

      }
      elRow.style.display = displayProp;
    }
  }

  return true;
}


function bounds(value, minValue, maxValue)
{
  return Math.max(Math.min(value, maxValue), minValue);
}

