Microsoft VBScript runtime error '800a0005'

Hi friends I am getting Error listed below

[FONT=Arial][SIZE=2]Microsoft VBScript runtime [/SIZE][/FONT][FONT=Arial][SIZE=2]error ‘800a0005’[/SIZE][/FONT][FONT=Times New Roman][SIZE=3] [/SIZE][/FONT][FONT=Arial][SIZE=2]Invalid procedure call or argument: ‘mid’[/SIZE][/FONT] [FONT=Arial][SIZE=2]/includedfiles/encriptdecript.asp[/SIZE][/FONT][FONT=Arial][SIZE=2], line 45[/SIZE][/FONT]

Asp File It was running in server 2000 fine but i migrtaed server2003 it is not running giving error like this.

I am using encrypt & decrypt in this page for employeers logon.

I checked some what but not usefule.

kindly rectify this error.

Code is below:

<%
Public Function encript(pass)
Dim temp, temp1
Dim pos, leng, dt, tim
Dim i, key
leng = Len(pass)
tim = Time
tim = Mid(tim, 1, Len(tim) - 3)
tim = Mid(tim, Len(tim) - 1, 2) * Int(Rnd * 100)
For i = 1 To Len(CStr(tim))
pos = pos + CInt(Mid(CStr(tim), i, 1))
Next
While pos > Len(pass)
pos = pos Mod 10 + Int(Rnd * 10)
If pos = 0 Then
pos = Len(pass) + 1
End If
Wend
If pos <= 2 Then
pos = 3
End If
key = Int((255 - 150 + 1) * Rnd + 150)
For i = 1 To Len(pass)
If Asc(Mid(pass, i, 1)) > key Then
temp = temp & Chr(CInt(Asc(Mid(pass, i, 1))) - key)
ElseIf Asc(Mid(pass, i, 1)) < key Then
temp = temp & Chr(key - CInt(Asc(Mid(pass, i, 1))))
Else
temp = temp & Chr(Asc(Mid(pass, i, 1)))
End If
Next
temp1 = Mid(temp, 1, pos) & Chr(key)
temp1 = temp1 & Mid(temp, pos + 1, Len(temp))
temp = Chr(pos + 150) & temp1
encript = temp
End Function

Public Function decript(pass)
Dim pos, key, temp
Dim i, temp1

//error line

pos = Int(Asc(Mid(pass, 1, 1))) - 150
key = Asc(Mid(pass, pos + 2, 1))
temp = Mid(pass, 1, pos + 1)

pass = temp & Mid(pass, pos + 3, Len(pass))
pass = Mid(pass, 2, Len(pass))
For i = 1 To Len(pass)
If Asc(Mid(pass, i, 1)) <> key Then
temp1 = temp1 & Chr(key - CInt(Asc(Mid(pass, i, 1))))
Else
temp1 = temp1 & Chr(Asc(Mid(pass, i, 1)))
End If
Next
decript = temp1
End Function
%>