title: VBScript alternative/conversion?
body: <p>I have a piece of code from a long time ago and am trying to integrate it into HTML5. It's written in VBScript, which is no longer supported, and I want to change it into something understood by modern browsers. This was originally part of an HTA file, but everything in it works fine in HTML5 except this script. Any help would be appreciated.</p>
  
  <p>The code:</p>
  
  <pre class="lang-vb prettyprint-override"><code>&lt;/style&gt;
  &lt;font color="#FF0000" size="+3"&gt;&lt;marquee&gt;Marquee Text Here&lt;/marquee&gt;&lt;/font&gt;
  &lt;script language="vbscript"&gt;
  Public n, iTimerID, MyTitle, colnum, carset
  ReDim M(1,1)
  ReDim SpecCar(64)
  SpecCar(0)="&amp;permil;" 
  SpecCar(1)="&amp;fnof;"   : SpecCar(11)="&amp;Omega;"   : SpecCar(21)="&amp;lambda;" : SpecCar(31)="&amp;phi;"
  SpecCar(2)="&amp;Gamma;"  : SpecCar(12)="&amp;alpha;"   : SpecCar(22)="&amp;mu;"     : SpecCar(32)="&amp;psi;"
  SpecCar(3)="&amp;Delta;"  : SpecCar(13)="&amp;beta;"    : SpecCar(23)="&amp;nu;"     : SpecCar(33)="&amp;omega;"
  SpecCar(4)="&amp;Theta;"  : SpecCar(14)="&amp;delta;"   : SpecCar(24)="&amp;xi;"     : SpecCar(34)="&amp;trade;"
  SpecCar(5)="&amp;Lambda;" : SpecCar(15)="&amp;epsilon;" : SpecCar(25)="&amp;pi;"     : SpecCar(35)="&amp;larr;"
  SpecCar(6)="&amp;Xi;"     : SpecCar(16)="&amp;zeta;"    : SpecCar(26)="&amp;rho;"    : SpecCar(36)="&amp;uarr;"
  SpecCar(7)="&amp;Pi;"     : SpecCar(17)="&amp;eta;"     : SpecCar(27)="&amp;sigmaf;" : SpecCar(37)="&amp;rarr;"
  SpecCar(8)="&amp;Sigma;"  : SpecCar(19)="&amp;iota;"    : SpecCar(29)="&amp;tau;"    : SpecCar(39)="&amp;harr;"
  SpecCar(10)="&amp;Psi;"   : SpecCar(20)="&amp;kappa;"   : SpecCar(30)="&amp;upsilon;": SpecCar(40)="&amp;radic;"
  SpecCar(41)="&amp;infin;" : SpecCar(46)="&amp;there4;"  : SpecCar(51)="&amp;ge;"     : SpecCar(56)="&amp;clubs;"
  SpecCar(42)="&amp;ang;"   : SpecCar(47)="&amp;asymp;"   : SpecCar(52)="&amp;oplus;"  : SpecCar(57)="&amp;hearts;"
  SpecCar(43)="&amp;cap;"   : SpecCar(48)="&amp;ne;"      : SpecCar(53)="&amp;perp;"   : SpecCar(58)="&amp;diams;"
  SpecCar(44)="&amp;cup;"   : SpecCar(49)="&amp;equiv;"   : SpecCar(54)="&amp;loz;"    : SpecCar(59)="&amp;OElig;"
  SpecCar(45)="&amp;int;"   : SpecCar(50)="&amp;le;"      : SpecCar(55)="&amp;spades;" : SpecCar(60)="&amp;dagger;"
  SpecCar(61)="&amp;Dagger;": SpecCar(62)="&amp;euro;"    : SpecCar(63)="&amp;oelig;"  : SpecCar(64)="&amp;Scaron;"
  
  Sub window_onLoad()
      n = 48
      colnum = 100
      carset = 1
      ReDim M(colnum,1)
      ' Set a random number for the first character 
      ' to be written on the screen for each column 
      ' (div). This is useful to avoid all the
      ' column to start at the same place 
      For i=1 To colnum
          Randomize                                   '---This formula doesn't accept variables
          M(i,0) = Int(n*Rnd)                         '--- M(i,0) contains the number of the character to be written
          t = ""
                                                      '--- Fill the column with white space
          For j=1 To n
              t = t &amp; "&amp;nbsp;&lt;br&gt;"
          Next
          M(i,1) = t                                  '--- M(i,1) contains the html of the column
      Next
      iTimerID = window.setInterval("Progress", 300)
  End Sub
  
  Sub Progress
      For i=1 To colnum
          l = Split(M(i,1), "&lt;br&gt;")                   '--- split by each character in the column
          cpos = M(i,0)                               '--- position of the character to be written on the screen at this time
                                                      '--- write a random ascii or a character from the array 
          Randomize
          If Int(carset) = 1 Then
              l(cpos) = "&lt;span style=""color:GreenYellow""&gt;" &amp; Chr( 32 + Int(223*Rnd) ) &amp; "&lt;/span&gt;"
              carset = carset +0.25
          ElseIf Int(carset) = 2 Then
              l(cpos) = "&lt;span style=""color:GreenYellow""&gt;" &amp; SpecCar( Int(64*Rnd) )  &amp; "&lt;/span&gt;"
              carset = 1
          End If
                                                      '--- scale down to dark the previous characters
          y = -1
          For j = cpos-1 To cpos-11 Step -1
              tempj = j
              If j &lt; 0 Then                           '--- when we start from the top, darken characters at the bottom
                  j = UBound(l) +j +1
              End If
              y = y + 1
              Select Case y
                  Case 0 color="LawnGreen"
                  Case 1 color="LawnGreen"
                  Case 2 color="LimeGreen"
                  Case 3 color="LimeGreen"
                  Case 4 color="ForestGreen"
                  Case 5 color="ForestGreen"
                  Case 6 color="Green"
                  Case 7 color="Green"
                  Case 8 color="DarkGreen"
                  Case 9 color="DarkGreen"
                  Case 10 color=""
              End Select
              clj = l(j)
              If InStr(1, clj, "&lt;span", 1) &gt; 0 Then   '--- isolate the character from the span tag
                  clj = Left(clj, InStrRev(clj, "&lt;") - 1)
                  clj = Mid(clj, InStr(clj, "&gt;") + 1)
              End If
              If color &lt;&gt; "" Then                     '--- set a span with a color style only if necessary
                  l(j) = "&lt;span style=""color:" &amp; color &amp; """&gt;" &amp; clj &amp; "&lt;/span&gt;"
              Else
                  l(j) = clj
              End If
              j = tempj
          Next
          t = Join(l, "&lt;br&gt;")
          M(i,1) = t                                  '--- M(i,1) contains the html of the column
          cpos = cpos +1
          If cpos &gt; UBound(l) Then
              cpos = 0
          End If
          M(i,0) = cpos                               '--- M(i,0) contains the number of the character to be written
          id("col" &amp; i).innerHTML = t                 '--- Show the result for this the column on the screen
      Next
  End Sub
  
  Sub ExitMatrix
      window.clearInterval(iTimerID)                  '---You must always clear the intervals before leaving
      window.close
  End Sub
  
  Function id(o)
      Set id = document.getElementById(o)
  End Function
  &lt;/script&gt;
  </code></pre>