<%
If Request.Cookies("adminname")="" Then
   Response.Write("<script>top.location.href='admin_login.asp';</script>")
   Response.End()
End If

Dim AdminSkin
AdminSkin = Request.Cookies("admin_skin")
If Not IsNumeric(AdminSkin) Then
	AdminSkin = 1
End If
If AdminSkin = 0 Then
	AdminSkin = 1
End If

ChkUser()

Sub ChkUser()
    Dim rs
	opendb
	Set rs=conn.execute("Select * from "&predb&"Admin where adminname='"&replace(Request.Cookies("adminname"),"'","''")&"' and adminpsd='"&replace(Request.Cookies("adminpass"),"'","''")&"'")
    IF rs.bof and rs.eof then
    Response.Write("<script>top.location.href='admin_login.asp';</script>")
    Response.End()
	End IF
	set rs=nothing
	closedb
End Sub
%>