<%
Dim AdminAction
AdminAction = request.QueryString("AdminAction")
Select Case AdminAction
    Case "Out"
        Call OutLogin()
    Case Else
        Call Login()
End Select

Sub Login()
    If session("UserName") = "" Or session("GroupPurview")="" or session("LoginSystem") <> "Succeed" Then
        Response.Redirect SysRootDir&"Login.Asp"
        Response.End
    End If
End Sub

Sub OutLogin()
  session.contents.remove "UserName"
  session.contents.remove "GroupPurview"
  session.contents.remove "LoginSystem"
  session.contents.remove "GroupID"
  session.Contents.RemoveAll()
    'Response.Cookies("Crmsystem")("UserName") = ""
	'Response.Cookies("Crmsystem")("GroupID") = ""
    'Response.Cookies("Crmsystem")("GroupPurview") = ""
    'Response.Cookies("Crmsystem")("LoginSystem") = ""
    'Response.Cookies("Crmsystem")("LoginIP") = ""
    Response.Redirect("Login.Asp")
End Sub
%>