<script language=VBScript>
sub ShowErr(Msg)
bErr = true
MsgBox Msg
End Sub

function Validate()
On Error Resume Next
Dim TheForm
Set TheForm = Document.forms("ValidForm")
If Len(TheForm.UserName.Value) < 4 Then
MsgBox "PIN empty or user pin length less than 4 or so pin length less than 6!!"
Validate = FALSE
Exit Function
End If
bErr = false

'Let detecte whether the ePass 1000 Safe Active Control loaded.
'If we call any method and the Err.number be set to &H1B6, it
'means the ePass 1000 Safe Active Control had not be loaded.

ePass.GetLibVersion
If Err.number = &H1B6 Then
ShowErr "Load ePass 1000 Safe Active Control"
Validate = false
Exit function
Else


ePass.OpenDevice 1, ""
If Err then
ShowErr "Open first ePass failed."
Validate = false
ePass.CloseDevice
Exit function
End if

dim results
results = "01234567890123456"
results = ePass.GetStrProperty(7, 0, 0)
'MsgBox results

ePass.VerifyPIN 0, TheForm.UserName.Value

If Err Then
ShowErr "Verify User PIN Failure!!!"
Validate = false
ePass.CloseDevice
Exit function
End If


snID.innerHTML = "<input type='hidden' name='SN_SERAL' Value='" & results & "'>"
End If
ePass.CloseDevice
End function
</script>

</HEAD>
<BODY>

<object CLASSID="clsid:0272DA76-96FB-449E-8298-178876E0EA89" CODEBASE="install.cab#Version=1,00,0000" BORDER="0" VSPACE="0" HSPACE="0" ALIGN="TOP" HEIGHT="0" WIDTH="0"></object>
<OBJECT classid=clsid:E740C5DF-3454-46A7-80EC-364D1ADB6CF0 id=ePass name = ePass STYLE="LEFT: 0px; TOP: 0px" width=0 height=0></OBJECT>
<H1 ALIGN="center">ePass 1000 Active Control<BR>
Demo Program</H1>
<TABLE WIDTH="600" BORDER="0" ALIGN="center">
<TR>
<TD>
<P ALIGN="CENTER"> ePass 1000 Active Control demonstration program</P>

<--- Formular für die PIN --->
<SCRIPT id=clientEventHandlersVBS language=vbscript>
<!--
Document.Writeln "<P>&nbsp;</P><P ALIGN='CENTER'>To logon, you must input your PIN.</P>"
Document.Writeln "<P>&nbsp;</P><P>&nbsp;</P></TD></TR><TR><TD>"
Document.Writeln "<FORM id=ValidForm METHOD='post' ACTION='program' onsubmit='return Validate();' language='jscript'>"
Document.Writeln "<span id=snID></span>"
Document.Writeln "<TABLE WIDTH='250' BORDER='1' ALIGN='center' CELLSPACING='0' BORDERCOLORDARK='#E7EBFF' BORDERCOLORLIGHT='#000000'>"
Document.Writeln "</TD></TR>"
Document.Writeln "<TR><TD ALIGN='right'>User PIN:</TD><TD><INPUT TYPE='password' NAME='UserName' CLASS='inputtext'></TD></TR>"
Document.Writeln "</TABLE><P>&nbsp;</P><P ALIGN='center'>"
Document.Writeln "<INPUT TYPE='submit' NAME='Submit' VALUE='Let me in'>"
Document.Writeln "<INPUT TYPE='reset' NAME='Reset' VALUE='Re-input'></P></FORM>"
-->
</SCRIPT>