﻿var activeDiv;
var activeLink;
var activeProd;

function setActiveDiv(id){
    var e = document.getElementById(id);
    var l = document.getElementById(id+'l');
    activeDiv = e;
    activeLink = l;
    }
function ShowLinkDiv(id) 
  {
  //alert('test');
    var e = document.getElementById(id);
    var l = document.getElementById(id+'l');
    //alert (l.className);
    if (e != null) 
    {
        
        if (activeDiv != null)
        {
          activeDiv.style.display = 'none';
          activeLink.className = 'internlink';
        }
        if (e.style.display == 'none') 
        {
          e.style.display = 'block';
          l.className = 'internlinkover'; 
        }
        else { 
        e.style.display = 'none';
        l.className = 'internlink'; }
        activeDiv = e;
        activeLink = l;
      }
    }
    

function ShowDiv(id) 
  {
  //alert('test');
    var e = document.getElementById(id);
    if (e != null) 
    {
        
        if (activeDiv != null)
        {
          activeDiv.style.display = 'none';
        }
        if (e.style.display == 'none') 
        {
          e.style.display = 'block'; 
        }
        else { e.style.display = 'none'; }
        activeDiv = e;
      }
    }


    function ExpandDiv(id) {
      //alert('test');
      var linkExpand = document.getElementById("lbExpand");
      var linkColapse = document.getElementById("lbColapse");
      if (linkExpand)
        linkExpand.style.display = 'none';
      if (linkColapse) {
        linkColapse.style.display = '';
      }
        
      var e = document.getElementById(id);
      if (e != null) {
        if (activeDiv != null) {
          e.style.display = 'block';
        }
        activeDiv = e;
      }
    }
    function ColapseDiv(id) {
      //alert('test');
      var linkExpand = document.getElementById("lbExpand");
      var linkColapse = document.getElementById("lbColapse");
      if (linkExpand)
        linkExpand.style.display = '';
      if (linkColapse) {
        linkColapse.style.display = 'none';
      }

      var e = document.getElementById(id);
      if (e != null) {
        if (activeDiv != null) {
          e.style.display = 'none';
        }
        activeDiv = e;
      }
    }

 
function ShowProd(id) 
{
  if(id == 'noprod')
  {
    if (activeProd)
    {
        activeProd.style.visibility = 'hidden';
        activeProd.style.height = '1px';
    }
    divMainDocs.style.visibility = 'hidden';
    divMainDocs.style.height = '1px';
  }
  else
  {
    divMainDocs.style.visibility = 'visible';
    divMainDocs.style.height = 'auto';
    var prod = document.getElementById(id);
    if (prod != null) 
    {
        if (activeProd != null)
        {
          activeProd.style.visibility = 'hidden';
          activeProd.style.height = '1px';
        }
        if (prod.style.visibility == 'hidden') 
        {
          prod.style.visibility = 'visible';
          prod.style.height = 'auto';
          //prod.style.overflow = 'visible';
        }
        else { prod.style.display = 'none'; }
        activeProd = prod;
      }
    }
}

