home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / nature / wel / wel004.alx < prev    next >
Encoding:
Text File  |  1996-07-09  |  12.4 KB  |  302 lines

  1.  
  2. <SCRIPT LANGUAGE="VBScript">
  3. <!--
  4. On Error Resume Next
  5. 'Variable declarations
  6. Dim mX, mY, intNumYrs, intNumTickYrs, intNumTicks, intNumMarks, intTickBase, intCurMark
  7. Dim intYrs(), intTickYears(), intTicks(), intMarks(), strDescs()
  8.  
  9. 'set list of milestone years and years with corresponding tick marks
  10. Redim intYrs(11)
  11. intYrs(0) = 1951
  12. intYrs(1) = 1955
  13. intYrs(2) = 1960
  14. intYrs(3) = 1974
  15. intYrs(4) = 1976
  16. intYrs(5) = 1979
  17. intYrs(6) = 1980
  18. intYrs(7) = 1991
  19. intYrs(8) = 1993
  20. intYrs(9) = 1994
  21. intYrs(10) = 1995
  22. intYrs(11) = 1996
  23. intNumYrs = 11
  24.  
  25. 'set years with tick marks
  26. Redim intTickYrs(7)
  27. intTickYrs(0) = 1951
  28. intTickYrs(1) = 1960
  29. intTickYrs(2) = 1970
  30. intTickYrs(3) = 1980
  31. intTickYrs(4) = 1990
  32. intTickYrs(5) = 1992
  33. intTickYrs(6) = 1994
  34. intTickYrs(7) = 1996
  35. intNumTickYrs = 7
  36.  
  37. 'set physical locations of tickmarks and milestone marks
  38. intTickBase = imgBG.left
  39. Redim intTicks(7)
  40. intTicks(0) = 120 + intTickBase
  41. intTicks(1) = 141 + intTickBase
  42. intTicks(2) = 162 + intTickBase
  43. intTicks(3) = 183 + intTickBase
  44. intTicks(4) = 205 + intTickBase
  45. intTicks(5) = 225 + intTickBase
  46. intTicks(6) = 246 + intTickBase
  47. intTicks(7) = 267 + intTickBase
  48. intNumTicks = 7
  49.  
  50. 'actual location of marks for each year
  51. Redim intMarks(11)
  52. for i = 0 to intNumYrs
  53.     for j = 0 to intNumTickYrs-1
  54.         if intYrs(i) >= intTickYrs(j) AND intYrs(i) <= intTickYrs(j+1) then
  55.             intMarks(i) = ((intYrs(i)-intTickYrs(j))/(intTickYrs(j+1)-intTickYrs(j))) * (intTicks(j+1)-intTicks(j)) + intTicks(j)
  56. '            exit for
  57.         end if
  58.     next
  59. next
  60. 'same number physical marks as years
  61. intNumMarks = intNumYrs
  62.  
  63. 'set array of descriptions for each milestone
  64. Redim strDescs(11)
  65. strDescs(0) = "The Nature Conservancy incorporates as a nonprofit organization."
  66. strDescs(1) = "The Nature Conservancy acquires its first preserve with a 60-acre purchase in the Mianus River Gorge on the New York-Connecticut border. The preserve now totals more than 550 acres."
  67. strDescs(2) = "Volunteers in Washington State receive a charter to establish the Conservancy's Washington chapter."
  68. strDescs(3) = "The Nature Conservancy creates the first state National Heritage program in South Carolina. Now covering all 50 states, the heritage network's sophisticated databases provide the most complete information about the existence and location of species and natural communities in the United States."
  69. strDescs(4) = "The Nature Conservancy of Washington acquires 878 acres along the Skagit River to protect " & chr(151) &  " along with a number of cooperating public agencies " & chr(151) & " habitat for wintering bald eagles. Today, the Skagit River Bald Eagle Natural Area totals more than 6,000 acres and is one of the largest protected habitats for bald eagles in North America."
  70. strDescs(5) = "The Nature Conservancy of Washington opens its first office."
  71. strDescs(6) = "The Nature Conservancy's International Program opens its doors and begins working with Latin American partner organizations to help build local expertise for natural area identification and conservation." & chr(10) & chr(13) & chr(10) & chr(13) & "The Nature Conservancy of Washington acquires Yellow Island, a 10-acre preserve whose colorful carpet of flowers and grasses attracts visitors each spring."
  72. strDescs(7) = "The Nature Conservancy of Washington enters into a partnership with the Army's Fort Lewis to inventory species and ecosystems within the base's boundaries. Similar programs have been initiated at McChord Air Force Base and the Army's Yakima Training Center."
  73. strDescs(8) = "On October 18, 300 bison are released on the Tallgrass Prairie Preserve in Oklahoma as part of an effort to recreate a functioning tallgrass prairie ecosystem."
  74. strDescs(9) = "The Nature Conservancy of Washington enters into a partnership with the U.S. Department of Energy to inventory species and ecosystems on uncontaminated parts of the Hanford Nuclear Reservation. Hanford supports one of the largest remaining examples of the Columbia River Basin's shrub-steppe ecosystem. The inventory yields 21 previously unknown species." & chr(10) & chr(13) & chr(10) & chr(13) & "The Nature Conservancy's Biological and Conservation Data System (BCD), a database that allows users to collect and exchange biological and conservation information, wins the Computerworld Smithsonian Award. The award honors the best societal uses of information technology across the world."
  75. strDescs(10) = "The Nature Conservancy of Washington establishes the new Wahkiacus Oaks Preserve, home to the western gray squirrel."
  76. strDescs(11) = "Membership in The Nature Conservancy of Washington surpasses 30,000 households statewide."
  77.  
  78. 'set initial cursor position and milestone description
  79. intCurMark = 0
  80. imgCursor.left = intMarks(intCurMark) - (imgCursor.width/2)
  81. lblYear.Caption = intYrs(intCurMark)
  82. txtDesc.Locked = False
  83. txtDesc.Value = strDescs(intCurMark)
  84. txtDesc.SelStart = 0
  85. txtDesc.Locked = True
  86.  
  87. 'Sub imgCursor_MouseMove(ByVal Button, ByVal Shift, ByVal X, ByVal Y)
  88. '    Track mouse movements on cursor, move cursor if mouse down
  89. Sub imgCursor_MouseMove(ByVal Button, ByVal Shift, ByVal X, ByVal Y)
  90.     On Error Resume Next
  91.     if  button = 1 then
  92.         imgCursor.left = AlignCursor(x + imgCursor.left - 5) - (imgCursor.width / 2)
  93.         lblYear.Caption = intYrs(intCurMark)
  94.         txtDesc.Locked = False
  95.         txtDesc.Value = strDescs(intCurMark)
  96.         txtDesc.SelStart = 0
  97.         txtDesc.Locked = True
  98.     end if
  99. end sub
  100.  
  101. 'Sub imgBG_MouseMove(ByVal Button, ByVal Shift, ByVal X, ByVal Y)
  102. '    Track mouse location on background
  103. Sub imgBG_MouseMove(ByVal Button, ByVal Shift, ByVal X, ByVal Y)
  104.     On Error Resume Next
  105.     mX = X
  106.     mY = Y
  107. end sub
  108.  
  109. 'Sub imgBG_Click()
  110. '    Handle mouse clicks on background, check to see if L/R arrows were clicked
  111. Sub imgBG_Click()
  112.     On Error Resume Next
  113.     'see if left arrow clicked
  114.     if InRect(mX, mY, 95, 136, 109, 168) then
  115.         if intCurMark = 0 then
  116.             'stop at leftmost date
  117.             exit sub
  118.         else
  119.             intCurMark = intCurMark-1
  120.         end if
  121.     end if
  122.     'see of right arrow clicked
  123.     if InRect(mX, mY, 277, 136, 291, 168) then
  124.         if intCurMark = intNumMarks then
  125.             'stop at rightmost date
  126.             exit sub
  127.         else
  128.             intCurMark = intCurMark+1
  129.         end if
  130.     end if            
  131.     'update cursor position and description
  132.     imgCursor.left = intMarks(intCurMark) - (imgCursor.width/2)
  133.     lblYear.Caption = intYrs(intCurMark)
  134.     txtDesc.Locked = False
  135.     txtDesc.Value = strDescs(intCurMark)
  136.     txtDesc.SelStart = 0
  137.     txtDesc.Locked = True
  138. end sub
  139.  
  140. 'Function InRect(x, y, Rect_x1, Rect_y1, Rect_x2, Rect_y2)
  141. '    Determines if input coords are in given rectangle
  142. Function InRect(x, y, Rect_x1, Rect_y1, Rect_x2, Rect_y2)
  143.     On Error Resume Next
  144.     InRect =  x > Rect_x1 And x < Rect_x2 And y > Rect_y1 And y < Rect_y2
  145. End Function
  146.  
  147. 'Function AlignCursor(ByVal X) 
  148. '    Aligns cursor to nearest date mark with milestone
  149. Function AlignCursor(ByVal X) 
  150.     On Error Resume Next
  151.     Dim intMark
  152.     intMark = int(X)
  153.     'stop at leftmost date
  154.     if intMark <= intMarks(0) then
  155.         AlignCursor = intMarks(0)
  156.         intCurMark = 0
  157.         exit function
  158.     end if
  159.     'stop at rightmost date
  160.     if intMark >= intMarks(intNumMarks) then
  161.         AlignCursor = intMarks(intNumMarks)
  162.         intCurMark = intNumMarks
  163.         exit function
  164.     end if
  165.     'loop through marks and set cursor to nearest one
  166.     for i = 0 to intNumMarks-1
  167.         if intMark < intMarks(i+1) then
  168.             if intMark <= intMarks(i) + int((intMarks(i+1) - intMarks(i))/2) then
  169.                 AlignCursor = intMarks(i)
  170.                 'AlignCursor = intMark
  171.                 intCurMark = i
  172.                 exit for
  173.             else
  174.                 AlignCursor = intMarks(i+1)
  175.                 'AlignCursor = intMark
  176.                 intCurMark = i+1
  177.                 exit for
  178.             end if
  179.         end if
  180.     next
  181. End Function
  182.  
  183. 'Sub tmrRot_Timer()
  184. '    rotate timeline images on timer event
  185. Sub tmrRot_Timer()
  186.     On Error Resume Next
  187.     if imgRot1.Visible then
  188.         imgRot1.Visible = False
  189.         imgRot2.Visible = True
  190.     elseif imgRot2.Visible then
  191.         imgRot2.Visible = False
  192.         imgRot3.Visible = True
  193.     else
  194.         imgRot3.Visible = False
  195.         imgRot1.Visible = True
  196.     end if        
  197. end sub
  198.  
  199. -->
  200. </SCRIPT>
  201. <DIV BACKGROUND="#999966" STYLE="LAYOUT:FIXED;WIDTH:548pt;HEIGHT:329pt;">
  202.     <OBJECT ID="imgBG"
  203.      CLASSID="CLSID:D4A97620-8E8F-11CF-93CD-00AA00C08FDF"
  204.          CODEBASE="../activate/setupalx.exe"
  205.          STYLE="TOP:10pt;LEFT:176pt;WIDTH:295pt;HEIGHT:287pt;ZINDEX:0;">
  206.         <PARAM NAME="PicturePath" VALUE="images/wel035.gif">
  207.         <PARAM NAME="AutoSize" VALUE="-1">
  208.         <PARAM NAME="BorderStyle" VALUE="0">
  209.         <PARAM NAME="Size" VALUE="10398;10134">
  210.         <PARAM NAME="VariousPropertyBits" VALUE="19">
  211.     </OBJECT>
  212.     <OBJECT ID="txtDesc"
  213.      CLASSID="CLSID:8BD21D10-EC42-11CE-9E0D-00AA006002F3" 
  214.          CODEBASE="../activate/setupalx.exe"
  215.          STYLE="TOP:109pt;LEFT:10pt;WIDTH:146pt;HEIGHT:192pt;TABINDEX:0;ZINDEX:1;">
  216.         <PARAM NAME="VariousPropertyBits" VALUE="-1467987949">
  217.         <PARAM NAME="BackColor" VALUE="16777215">
  218.         <PARAM NAME="ForeColor" VALUE="0">
  219.         <PARAM NAME="ScrollBars" VALUE="2">
  220.         <PARAM NAME="Size" VALUE="5151;6773">
  221.         <PARAM NAME="SpecialEffect" VALUE="0">
  222.         <PARAM NAME="FontName" VALUE="Garamond">
  223.         <PARAM NAME="FontHeight" VALUE="240">
  224.         <PARAM NAME="FontCharSet" VALUE="0">
  225.         <PARAM NAME="FontPitchAndFamily" VALUE="2">
  226.     </OBJECT>
  227.     <OBJECT ID="imgEagle"
  228.      CLASSID="CLSID:D4A97620-8E8F-11CF-93CD-00AA00C08FDF" 
  229.           CODEBASE="../activate/setupalx.exe"
  230.          STYLE="TOP:10pt;LEFT:10pt;WIDTH:41pt;HEIGHT:57pt;ZINDEX:2;">
  231.         <PARAM NAME="PicturePath" VALUE="images/wel004.gif">
  232.         <PARAM NAME="AutoSize" VALUE="-1">
  233.         <PARAM NAME="BorderStyle" VALUE="0">
  234.         <PARAM NAME="Size" VALUE="1455;2011">
  235.         <PARAM NAME="VariousPropertyBits" VALUE="19">
  236.     </OBJECT>
  237.     <OBJECT ID="lblYear"
  238.      CLASSID="CLSID:978C9E23-D4B0-11CE-BF2D-00AA003F40D0"          
  239.          CODEBASE="../activate/setupalx.exe"
  240.          STYLE="TOP:78pt;LEFT:10pt;WIDTH:88pt;HEIGHT:20pt;ZINDEX:3;">
  241.         <PARAM NAME="ForeColor" VALUE="0">
  242.         <PARAM NAME="VariousPropertyBits" VALUE="8388627">
  243.         <PARAM NAME="Size" VALUE="3104;706">
  244.         <PARAM NAME="FontName" VALUE="Garamond">
  245.         <PARAM NAME="FontEffects" VALUE="1073741825">
  246.         <PARAM NAME="FontHeight" VALUE="440">
  247.         <PARAM NAME="FontCharSet" VALUE="0">
  248.         <PARAM NAME="FontPitchAndFamily" VALUE="2">
  249.         <PARAM NAME="ParagraphAlign" VALUE="0">
  250.         <PARAM NAME="FontWeight" VALUE="700">
  251.     </OBJECT>
  252.     <OBJECT ID="imgRot1"
  253.      CLASSID="CLSID:D4A97620-8E8F-11CF-93CD-00AA00C08FDF"          
  254.          CODEBASE="../activate/setupalx.exe"
  255.          STYLE="TOP:13pt;LEFT:332pt;WIDTH:95pt;HEIGHT:133pt;ZINDEX:4;">
  256.         <PARAM NAME="PicturePath" VALUE="images/wel037.gif">
  257.         <PARAM NAME="AutoSize" VALUE="-1">
  258.         <PARAM NAME="BorderStyle" VALUE="0">
  259.         <PARAM NAME="Size" VALUE="3334;4683">
  260.         <PARAM NAME="VariousPropertyBits" VALUE="19">
  261.     </OBJECT>
  262.     <OBJECT ID="imgRot2"
  263.      CLASSID="CLSID:D4A97620-8E8F-11CF-93CD-00AA00C08FDF"          
  264.          CODEBASE="../activate/setupalx.exe"            STYLE="TOP:33pt;LEFT:165pt;WIDTH:116pt;HEIGHT:106pt;DISPLAY:NONEZINDEX:5;">
  265.         <PARAM NAME="PicturePath" VALUE="images/wel038.gif">
  266.         <PARAM NAME="AutoSize" VALUE="-1">
  267.         <PARAM NAME="BorderStyle" VALUE="0">
  268.         <PARAM NAME="Size" VALUE="4075;3731">
  269.         <PARAM NAME="VariousPropertyBits" VALUE="19">
  270.     </OBJECT>
  271.     <OBJECT ID="imgRot3"
  272.      CLASSID="CLSID:D4A97620-8E8F-11CF-93CD-00AA00C08FDF"         
  273.          CODEBASE="../activate/setupalx.exe"
  274.          STYLE="TOP:209pt;LEFT:205pt;WIDTH:197pt;HEIGHT:65pt;DISPLAY:NONEZINDEX:6;">
  275.         <PARAM NAME="PicturePath" VALUE="images/wel036.gif">
  276.         <PARAM NAME="AutoSize" VALUE="-1">
  277.         <PARAM NAME="BorderStyle" VALUE="0">
  278.         <PARAM NAME="Size" VALUE="6932;2302">
  279.         <PARAM NAME="VariousPropertyBits" VALUE="19">
  280.     </OBJECT>
  281.     <OBJECT ID="imgCursor"
  282.      CLASSID="CLSID:D4A97620-8E8F-11CF-93CD-00AA00C08FDF"         
  283.          CODEBASE="../activate/setupalx.exe" 
  284.          STYLE="TOP:123pt;LEFT:285pt;WIDTH:23pt;HEIGHT:32pt;ZINDEX:7;">
  285.         <PARAM NAME="PicturePath" VALUE="images/wel039.gif">
  286.         <PARAM NAME="AutoSize" VALUE="-1">
  287.         <PARAM NAME="BorderStyle" VALUE="0">
  288.         <PARAM NAME="Size" VALUE="794;1111">
  289.         <PARAM NAME="VariousPropertyBits" VALUE="19">
  290.     </OBJECT>
  291.     <OBJECT ID="tmrRot"
  292.      CLASSID="CLSID:59CCB4A0-727D-11CF-AC36-00AA00A47DD2"
  293.      codebase="../activate/ietimer.ocx#version=4,70,0,1115" STYLE="TOP:10pt;LEFT:68pt;WIDTH:29pt;HEIGHT:29pt;TABINDEX:2;ZINDEX:8;">
  294.         <PARAM NAME="_ExtentX" VALUE="820">
  295.         <PARAM NAME="_ExtentY" VALUE="661">
  296.         <PARAM NAME="Interval" VALUE="10000">
  297.     </OBJECT>
  298. </DIV>
  299.  
  300.  
  301.  
  302.