home *** CD-ROM | disk | FTP | other *** search
/ PC & Mediji 2002 March / PCM_0203.iso / MEDIA / DEMO / M10USWEB.exe / RCDATA / CABINET / money.cab / msmoney.chm / hcdropdown.htc < prev    next >
Text File  |  2001-07-25  |  2KB  |  87 lines

  1. <PUBLIC:COMPONENT URN="-/msmny:dropdown/-">
  2.  
  3. <!----------------------------------------------------------
  4.     Copyright (c) 2001 Microsoft Corporation.
  5.     All rights reserved.
  6.  
  7.     File:       hcDropDown.htc 
  8.     Revised:    Mar 20 2001
  9.     Contact:    michealh
  10. --------------------------------------------------------- -->
  11.  
  12. <PUBLIC:ATTACH FOR="element" EVENT="ondocumentready" ONEVENT="Main()" />
  13.  
  14. <PRIVATE:PROPERTY NAME="ActiveColor" />
  15. <PRIVATE:PROPERTY NAME="InactiveColor" />
  16. <PRIVATE:PROPRETY NAME="RelatedField" />
  17.  
  18. <SCRIPT TYPE="text/jscript" LANGUAGE="JScript">
  19. <!--
  20. @set @debughelp = false;
  21.  
  22. //********************************************************************
  23. function Main()
  24. {
  25.     RelatedField = element.document.getElementById(element.getAttribute("FieldToToggle"));
  26.     if(RelatedField)
  27.     {
  28.         ActiveColor           = "purple";
  29.         InactiveColor         = "#0000ff";
  30.         var L_strDefaultColor = element.currentStyle.color;
  31.         with(element)
  32.         {
  33.             style.color          = InactiveColor;
  34.             style.cursor         = "hand";
  35.             style.textDecoration = "none";
  36.             //********************************************************************
  37.             onmouseover = function()
  38.             {
  39.                 this.style.textDecoration = "underline";
  40.             }
  41.             //********************************************************************
  42.             onmouseout = function()
  43.             {
  44.                 this.style.textDecoration = "none";
  45.             }
  46.             //********************************************************************
  47.             onclick = function()
  48.             {
  49.                 var L_intRotation;
  50.                 try
  51.                 {
  52.                     if(RelatedField.currentStyle.display == "none")
  53.                     {
  54.                         L_intRotation = 3;
  55.                         RelatedField.style.display = "block";
  56.                         RelatedField.scrollIntoView(false);
  57.                     }
  58.                     else
  59.                     {
  60.                         L_intRotation = 0;
  61.                         RelatedField.style.display = "none";
  62.                     }
  63.                     this.children[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(rotation=" + L_intRotation + ")";
  64.                 }
  65.                 catch(exception)
  66.                 {
  67.                     // 
  68.                 }
  69.                 this.runtimeStyle.color = ActiveColor;
  70.                 this.style.fontStyle = (this.currentStyle.fontStyle == "normal")
  71.                     ?
  72.                     "italic"
  73.                     :
  74.                     "normal"
  75.                     ;
  76.             }
  77.         }
  78.     }
  79.     else
  80.     {
  81.         /*@if(@debughelp) alert("Assert: malformed XML\n\nCannot locate text field.") @end @*/
  82.         element.style.display = "none";
  83.     }
  84. }
  85. //-->
  86. </SCRIPT>
  87. </PUBLIC:COMPONENT>