<%
	Dim rsUser

	Command = Request.Querystring("Command")

	If Command = "LogIn" Then
		LogIn
	End If

	If Command = "LogOut" Then
		Session("IsAdminLogin") = False
		Response.Redirect "link_list.asp"
	End If



	Sub LogIn()
		OpenConnection
		Set rsUser = DBC.Execute("SELECT ID FROM Admin WHERE ID = 1 AND " & _
			"EGold = " & Str2Num(Request.Form("EGold")) & " AND " & _
			"Password = " & EscapeSQLData(Request.Form("Password")))

		Session("IsAdminLogin") = (Not rsUser.EOF)
	End Sub


	Sub PageLogin()
%>
		<form name=LF action="summary.asp?Command=LogIn" method="post" onsubmit="return EGoldPresent() &amp;&amp; PasswordPresent()">
		<table border="0" width="100%" cellpadding="1">
		<tr>
			<td align=center class=PageText>
				E-Gold
				<input name="EGold" size="15" maxlength="20" class="ClientText">
				&nbsp;&nbsp;
				Password
				<input type="Password" name="Password" size="15" maxlength="20" class="ClientText">
				&nbsp;&nbsp;
				<input type="submit" value="Log In" class="Button">
			</td>
		</tr>
		</table>
		</form>

		<p align=center>
			<a href="../">Home page</a>
		</p>

		<script language=JavaScript src="../common.js"></script>

		<script language="JavaScript" for="window" event="onload">
		<!--
		document.LF.EGold.focus();
		//-->
		</script>
<%
	End Sub


	Sub AdminPageBegin(AltTitle)

	Dim i, Alt(19, 2), AltClass, Spaces
%>
	<table border=0 width=100% cellspacing="0" cellpadding="2">
	<tr class=Odd>
		<td align=center width=130>
			<b><%= SiteName %></b>
		</td>
		<td align=center>
			<b><%= AltTitle %></b>
		</td>
	</tr>
	<tr valign=top>
		<td>
<%
		Alt(0, 0) = "summary.asp"
		Alt(0, 1) = "Summary"
		Alt(0, 2) = 0

		Alt(1, 0) = "commoninfo.asp"
		Alt(1, 1) = "Common Info"
		Alt(1, 2) = 0

		Alt(2, 0) = "member_list.asp"
		Alt(2, 1) = "Members"
		Alt(2, 2) = 0

		Alt(3, 0) = "member_list.asp"
		Alt(3, 1) = "Members List"
		Alt(3, 2) = 1

		Alt(4, 0) = "member_edit.asp"
		Alt(4, 1) = "Add Member"
		Alt(4, 2) = 1

		Alt(5, 0) = "duplicate_list.asp"
		Alt(5, 1) = "Duplicate Accounts"
		Alt(5, 2) = 1

		Alt(6, 0) = "link_list.asp"
		Alt(6, 1) = "Links"
		Alt(6, 2) = 0

		Alt(7, 0) = "link_list.asp"
		Alt(7, 1) = "Links List"
		Alt(7, 2) = 1

		Alt(8, 0) = "link_edit.asp"
		Alt(8, 1) = "Add Link"
		Alt(8, 2) = 1

		Alt(9, 0) = "banner_list.asp"
		Alt(9, 1) = "Banners"
		Alt(9, 2) = 0

		Alt(10, 0) = "banner_list.asp"
		Alt(10, 1) = "Banners List"
		Alt(10, 2) = 1

		Alt(11, 0) = "banner_edit.asp"
		Alt(11, 1) = "Add Banner"
		Alt(11, 2) = 1

		Alt(12, 0) = "msg_list.asp"
		Alt(12, 1) = "Messages"
		Alt(12, 2) = 0

		Alt(13, 0) = "msg_list.asp"
		Alt(13, 1) = "Message List"
		Alt(13, 2) = 1

		Alt(14, 0) = "msg_edit.asp"
		Alt(14, 1) = "Add Message"
		Alt(14, 2) = 1

		Alt(15, 0) = "news_list.asp"
		Alt(15, 1) = "News"
		Alt(15, 2) = 0

		Alt(16, 0) = "news_list.asp"
		Alt(16, 1) = "News List"
		Alt(16, 2) = 1

		Alt(17, 0) = "news_edit.asp"
		Alt(17, 1) = "Add News"
		Alt(17, 2) = 1

		Alt(18, 0) = "payouts.asp"
		Alt(18, 1) = "Waiting Payouts"
		Alt(18, 2) = 0

		Alt(19, 0) = "banner_list.asp?Command=LogOut"
		Alt(19, 1) = "Log Out"
		Alt(19, 2) = 0


		Response.Write "<table border=0 width=130 cellpadding=0 cellspacing=1 bgcolor=black>" & vbNewLine

		For i = 0 To UBound(Alt)
			Response.Write "<tr height=22>" & vbNewLine

			If Alt(i, 2) = 0 Then
				AltClass = IIf(LCase(AltTitle) = LCase(Alt(i, 1)), "SelectedParent", "Parent")
				Spaces = "&nbsp;"
			Else
				AltClass = IIf(LCase(AltTitle) = LCase(Alt(i, 1)), "SelectedChild", "Child")
				Spaces = "&nbsp;&nbsp;&nbsp;&nbsp;"
			End If

			Response.Write "<td class=" & AltClass & ">" & vbNewLine
			Response.Write Spaces & "<a href=" & Alt(i, 0) & " class=Menu>" & Alt(i, 1) & "</a></td>" & vbNewLine

			Response.Write "</tr>" & vbNewLine
		Next

		Response.Write "</table>" & vbNewLine
%>
			<br><a href="http://free-sign-up.com/LowCostScripts" target=_blank>Low Cost Scripts</a>
		</td>
		<td>
<%
	End Sub


	Sub AdminPageEnd()
%>
		</td>
	</tr>
	</table>
	<br>
	</body>
	</html>
<%
	End Sub


	Sub JS_IsNumber ()
%>
		function IsNumber (Obj, Msg)
		{
			if (Obj.value.length == 0)
			{
				alert(Msg);
				Obj.focus();
				return false;
			}
			else
			{
				if (isNaN(Obj.value))
				{
					alert(Msg);
					Obj.focus();
					return false;
				}
			}

			return true;
		}
<%
	End Sub
%>