<%
Function GetCardType(cc)
Dim CardType

If Not Trim(cc) = "" Then
	If Len(cc) = 16 Or Len(cc) = 13 Then
		If Left(cc, 1) = 4 Then CardType = 1
	End If

	If (Len(cc) = 15 And Int(Left(cc, 1)) = 5 And (Int(Mid(cc, 2, 1)) >= 1 Or Int(Mid(cc, 2, 1)) <= 5)) Then
		CardType = 2
	End If

	If (Len(cc) = 15 And Int(Left(cc, 1)) = 3 And (Int(Mid(cc, 2, 1)) = 4 Or Int(Mid(cc, 2, 1)) = 7)) Then
		CardType = 3
	End If

	If Len(cc) = 16 And Int(Left(cc, 4)) = 6011 Then
		CardType = 4
	End If
End If

GetCardType = CardType

End Function






%>