home *** CD-ROM | disk | FTP | other *** search
/ ftp.novell.com / 2014.06.ftp.novell.com.tar / ftp.novell.com / forge / camtasia.msi / Cabs.w1.cab / CamtasiaTheater.chm1 / scripts / expand.js next >
Text File  |  2009-08-10  |  4KB  |  167 lines

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