OPTION EXPLICIT
Dim NOT_FOUND
NOT_FOUND = "NOT_FOUND"

Dim varLogin
varLogin = "Login"

Dim varEDGARLogin
varEDGARLogin = "EDGAR_Login"

Dim varUsername
varUsername = "User_Name"

Dim varPassword
varPassword = "Password"

Dim varAccess
varAccess = "Access_Level"

Dim varExpiry
varExpiry = "Expiry_Date"

Dim varComment
varComment = "Comment"

dim strCookieSeparator
strCookieSeparator = Chr(124)

Sub SetVariable(strVariableName, varVariableValue)
  Document.Cookie = strVariableName & "=" & varVariableValue
End Sub

Sub KillVariable(strVariableName)
  SetVariable strVariableName, "NULL;expires=Monday, 01-Jan-95 12:00:00 GMT"
End Sub

Function ReadVariable(strVariableName)
'these five variables are used in the string manipulation
'code that finds the variable in the cookie.
  Dim intLocation
  Dim intNameLength
  Dim intValueLength
  Dim intNextSemicolon
  Dim strTemp

  'calculate length and location of variable name
  intNameLength = Len(strVariableName)
  intLocation = Instr(Document.Cookie, strVariableName)

  'check for existence of variable name
  If intLocation = 0 Then
    'variable not found, so it can't be read
    ReadVariable = NOT_FOUND
  Else
    'get a smaller substring to work with
    strTemp = Right(Document.Cookie, Len(Document.Cookie) - intLocation + 1)

    'check to make sure we found the full string, not just a substring
    If Mid(strTemp, intNameLength + 1, 1) <> "=" Then
      'oops, only found substring, not good enough
      ReadVariable = NOT_FOUND

     'note that this will incorrectly give a not found result if and only if
     'a search for a variable whose name is a substring of a preceding
     'variable is undertaken.  For example, this will fail:
     '
     'search for:  MyVar
          'cookie contains:  MyVariable=2;MyVar=1
    Else
      'found full string
      intNextSemicolon = Instr(strTemp, ";")

      'if not found, then we need the last element of the cookie
      If intNextSemicolon = 0 Then intNextSemicolon = Len(strTemp) + 1
      'check for empty variable (Var1=;)
      If intNextSemicolon = (intNameLength + 2) Then
        'variable is empty
        ReadVariable = ""
      Else
        'calculate value normally
        intValueLength = intNextSemicolon - intNameLength - 2
        ReadVariable = Mid(strTemp, intNameLength + 2, intValueLength)
      End If
    End If
  End if
End Function

sub GotoNextPage(strValue)
		window.location.href = strValue			
	end sub
	