home *** CD-ROM | disk | FTP | other *** search
/ ftp.networkinstruments.com / 2015-02-04.ftp.networkinstruments.com.tar / ftp.networkinstruments.com / pub / disks / NIMS15 / NimsSetup.exe / NIMS.chm / scripts / expand.js next >
Text File  |  2011-12-21  |  4KB  |  159 lines

  1. // Copyright (c) 2002-2005 Quadralay Corporation.  All rights reserved.
  2. //
  3.  
  4. function  WebWorksDropDown_Object()
  5. {
  6.   this.fWriteArrow    = WebWorksDropDown_WriteArrow;
  7.   this.fWriteDIVOpen  = WebWorksDropDown_WriteDIVOpen;
  8.   this.fWriteDIVClose = WebWorksDropDown_WriteDIVClose;
  9. }
  10.  
  11. function  WebWorksDropDown_WriteArrow(ParamBaseURL,
  12.                                       ParamID,
  13.                                       bParamExpanded)
  14. {
  15.   var  VarIMGSrc;
  16.  
  17.   if ((typeof(document.all) != "undefined") ||
  18.       (typeof(document.getElementById) != "undefined"))
  19.   {
  20.     document.write(" <a href=\"javascript:WebWorksDropDown_ToggleDIV('" + ParamID + "');\">");
  21.  
  22.     if (bParamExpanded)
  23.     {
  24.       VarIMGSrc = ParamBaseURL + "images/expanded.gif";
  25.     }
  26.     else
  27.     {
  28.       VarIMGSrc = ParamBaseURL + "images/collapse.gif";
  29.     }
  30.  
  31.     document.write("<img id=\"" + ParamID + "_arrow\" src=\"" + VarIMGSrc + "\" border=\"0\" alt=\"\">");
  32.     document.write("</a>");
  33.   }
  34. }
  35.  
  36. function  WebWorksDropDown_WriteDIVOpen(ParamID,
  37.                                         bParamExpanded)
  38. {
  39.   if ((typeof(document.all) != "undefined") ||
  40.       (typeof(document.getElementById) != "undefined"))
  41.   {
  42.     if (bParamExpanded)
  43.     {
  44.       document.write("<div id=\"" + ParamID + "\" style=\"visibility: visible; display: block;\">");
  45.     }
  46.     else
  47.     {
  48.       document.write("<div id=\"" + ParamID + "\" style=\"visibility: hidden; display: none;\">");
  49.     }
  50.   }
  51. }
  52.  
  53. function  WebWorksDropDown_WriteDIVClose()
  54. {
  55.   if ((typeof(document.all) != "undefined") ||
  56.       (typeof(document.getElementById) != "undefined"))
  57.   {
  58.     document.write("</div>");
  59.   }
  60. }
  61.  
  62. function  WebWorksDropDown_ToggleDIV(ParamBaseURL,
  63.                                      ParamID)
  64. {
  65.   var  VarImageID;
  66.   var  VarIMG;
  67.   var  VarDIV;
  68.  
  69.  
  70.   VarImageID = ParamID + "_arrow";
  71.  
  72.   if (typeof(document.all) != "undefined")
  73.   {
  74.     // Reference image
  75.     //
  76.     VarIMG = document.all[VarImageID];
  77.     if ((typeof(VarIMG) != "undefined") &&
  78.         (VarIMG != null))
  79.     {
  80.       // Nothing to do
  81.     }
  82.     else
  83.     {
  84.       VarIMG = null;
  85.     }
  86.  
  87.     // Reference DIV tag
  88.     //
  89.     VarDIV = document.all[ParamID];
  90.     if ((typeof(VarDIV) != "undefined") &&
  91.         (VarDIV != null))
  92.     {
  93.       if (VarDIV.style.display == "block")
  94.       {
  95.         if (VarIMG != null)
  96.         {
  97.           VarIMG.src = ParamBaseURL + "images/collapse.gif";
  98.         }
  99.  
  100.         VarDIV.style.visibility = "hidden";
  101.         VarDIV.style.display = "none";
  102.       }
  103.       else
  104.       {
  105.         if (VarIMG != null)
  106.         {
  107.           VarIMG.src = ParamBaseURL + "images/expanded.gif";
  108.         }
  109.  
  110.         VarDIV.style.visibility = "visible";
  111.         VarDIV.style.display = "block";
  112.       }
  113.     }
  114.   }
  115.   else if (typeof(document.getElementById) != "undefined")
  116.   {
  117.     // Reference image
  118.     //
  119.     VarIMG = document[VarImageID];
  120.     if ((typeof(VarIMG) != "undefined") &&
  121.         (VarIMG != null))
  122.     {
  123.       // Nothing to do
  124.     }
  125.     else
  126.     {
  127.       VarIMG = null;
  128.     }
  129.  
  130.     // Reference DIV tag
  131.     //
  132.     VarDIV = document.getElementById(ParamID);
  133.     if ((typeof(VarDIV) != "undefined") &&
  134.         (VarDIV != null))
  135.     {
  136.       if (VarDIV.style.display == "block")
  137.       {
  138.         if (VarIMG != null)
  139.         {
  140.           VarIMG.src = ParamBaseURL + "images/collapse.gif";
  141.         }
  142.  
  143.         VarDIV.style.visibility = "hidden";
  144.         VarDIV.style.display = "none";
  145.       }
  146.       else
  147.       {
  148.         if (VarIMG != null)
  149.         {
  150.           VarIMG.src = ParamBaseURL + "images/expanded.gif";
  151.         }
  152.  
  153.         VarDIV.style.visibility = "visible";
  154.         VarDIV.style.display = "block";
  155.       }
  156.     }
  157.   }
  158. }
  159.