<% Option Explicit %>
<!--#include file="config.asp"-->
<!--#include file="common.asp"-->
<!--#include file="md5.asp"-->
<%
	Dim MsgCost

	If Str2Num(Session(Prefix & "MemberID")) = 0 Then
		' ne e lognat = non members
		MsgCost = FormatNumber(MsgCostNonMembers, 2)
	Else
		If Session(Prefix & "IsGold") Then
			MsgCost = FormatNumber(MsgCostGoldMembers, 2)
		Else
			MsgCost = FormatNumber(MsgCostFreeMembers, 2)
		End If
	End If


	PageBegin
	MsgForm
	PageEnd


	Sub MsgForm()
%>
		<form name=F action="msgaddpay.asp" method=POST onsubmit="return ValidateForm()">
		<input type=hidden name=Pal value=No>

		<span class="Title">Message</span><br><br>

		<table border=0 cellpadding="2" cellspacing="0">
		<tr class="Odd">
			<td colspan=2>
				Title<br>
				<input name="Title" size="60" maxlength="60" class="ClientText"><br><br>
			</td>
		</tr>
		<tr class="Odd">
			<td colspan=2>
				URL<br>
				<input name="URL" value="http://" size="60" maxlength="120" class="ClientText"><br><br>
			</td>
		</tr>
		<tr class=Odd>
			<td colspan=2>
				Description (no HTML tags, 255 max. chars)<br>
				<input name="Msg" size="60" maxlength=255 class="ClientText"><br>
			</td>
		</tr>
		<tr>
			<td colspan=2>
				<br>
			</td>
		</tr>
		<tr class=Odd>
			<td>Life-time fee</td>
			<td>
				<input type=checkbox class=ClientText checked disabled>
				($ <%= MsgCost %>)
			</td>
		</tr>
		<tr class=Odd>
			<td><b>Bold</b></td>
			<td>
				<input type=checkbox name=IsBold value="<%= MsgBoldCost %>" class=ClientText>
				($ <%= FormatNumber(MsgBoldCost, 2) %>)
			</td>
		</tr>
		<tr class=Odd>
			<td bgcolor=<%= MsgBoardHighlightedColor %>>Highlighted</td>
			<td>
				<input type=checkbox name=IsHighlight value="<%= MsgHighlightCost %>" class=ClientText>
				($ <%= FormatNumber(MsgHighlightCost, 2) %>)
			</td>
		</tr>
		<tr>
			<td colspan=2 align=center>
				<br><span class="Title">Payment Method</span><br><br>
			</td>
		</tr>
		<tr class=Odd height=45>
			<td>
				<input type=radio name=PaymentMethod value="EGold" checked> <img src="images/egold.gif" width="88" height="31" alt="Pay through e-gold" align=absmiddle>
			</td>
			<td valign=bottom>
<%
				If MemberID > 0 Then
					Response.Write "<input type=radio name=PaymentMethod value=MyEarnings> My earnings ($" & FormatNumber(Session(Prefix & "Cash"), 3) & ")<br><br class=HalfBreak>"
				End If
%>
			</td>
		</tr>
		<tr>
			<td colspan=2 align=center>
				<br><input type=submit name=Command value=Next>
			</td>
		</tr>
		</form>
		</table>

		<script language=JavaScript>
		<!--
		function ValidateForm()
		{
			if (document.F.Title.value.length < 3)
			{
				alert ('Please enter the Message Title.');
				document.F.Title.focus();
				return false;
			}

			if (document.F.URL.value.length < 10)
			{
				alert ('Please enter an URL.');
				document.F.URL.focus();
				return false;
			}

			return true;
		}
		//-->
		</script>
<% 
	End Sub
%>