﻿var divElements;

function closeAllDivs() {
      divElements = document.getElementsByTagName("DIV");
      
      for (i = 0; i < divElements.length; i++) {
          if ((divElements[i].id).indexOf("divRoll") > -1) {
              divElements[i].style.display = "none";
          }
      }

      //Show divCategory if user is on page BrowseArticles.aspx (clientID = ctl00_EntireContent_MainContent_ArticleListing1_divCategory)
      divCategory = document.getElementById("ctl00_EntireContent_MainContent_ArticleListing1_divCategory");
      if (divCategory != null) divCategory.style.display = "block";
      
      //Show divArticleSideDetails if user is on page ShowArticle.aspx
      divArticleSideDetails_ = document.getElementById("divArticleSideDetails");
      if (divArticleSideDetails_ != null) divArticleSideDetails_.style.display = "block";
}

function showRollOverDiv(param) {
    divElements = document.getElementById("divRoll" + param);
    divElements.style.display = "block";

    divElements = document.getElementById("divRollText" + param);
    divElements.style.display = "block";
}


function showRollOverNaviDiv(param) {
    divElements = document.getElementById(param);
    divElements.style.display = "block";

    //Hide divCategory (clientID = ctl00_EntireContent_MainContent_ArticleListing1_divCategory) which is on page BrowseArticles.aspx
    divCategory = document.getElementById("ctl00_EntireContent_MainContent_ArticleListing1_divCategory");
    if (divCategory != null) divCategory.style.display = "none";

    //Hide divArticleSideDetails if user is on page ShowArticle.aspx
    divArticleSideDetails_ = document.getElementById("divArticleSideDetails");
    if (divArticleSideDetails_ != null) divArticleSideDetails_.style.display = "none";
}


var tableElements;

function closeAllDescription() {
      tableElements = document.getElementsByTagName("TABLE");

      for (i = 0; i < tableElements.length; i++) {
          if ((tableElements[i].id).indexOf("tableDesc") > -1) {
              tableElements[i].style.display = "none";
          }
      }

      //only show the description that is related to the current page (applicable on second pages)
      tableElements = document.getElementById("tableDesc" + pageIs);
      if (tableElements != null) tableElements.style.display = "block";
}

function showDescription(param) {
      //first, close the description for the current page
      tableElements = document.getElementById("tableDesc" + pageIs);
      if (tableElements != null) tableElements.style.display = "none";
      
      //second, show the description for the mouse-overed icon        
      tableElements = document.getElementById(param);
      if (tableElements != null) tableElements.style.display = "block";
}

//Add MouseOver Row Highlight
function AddRowHighlight(row) {
    row.style.backgroundColor = "#e9d8e2";
}
function RemoveRowHighlight(row, rowIndex) {
      if (rowIndex % 2 == 0) row.style.backgroundColor = "#ffffff";
      else row.style.backgroundColor = "#f8f8f8";
}


//Get height of a div
function getHeight( divID ) {
      var height = 0;
      height = document.getElementById(divID).offsetHeight;
      return height;
}



