<!-- #include file="functions.asp" -->

<% ' contentNew.asp
   ' This page displays a form, with the eWebEditorPro object.
   ' The page posts to actionNew.asp, which creates the
   ' database row.  %> 

<%  If Trim(Request.Form("submit")) = "Save" Then
		' Defines variables and retrieves SQL-safe data from the 
		' form using the SQLFilter function.
			
			dim edit_title, edit_html, SQL
			edit_title = SQLFilter(Request.Form("edit_title"))
			edit_html  = SQLFilter(Request.Form("edit_html"))

			If edit_title = "" then Response.Redirect("error.asp") 

		' Creates SQL statement, and then inserts it into the database
			SQL = "INSERT INTO wysiwyg_tbl (edit_title, edit_html, cat_id) Values ('" & edit_title & "','" & edit_html & "','" & cat_id & "')" 
			DBConnect SQL
		
			Response.Redirect(default_page)
	
	Else %>

	<html>
	<STYLE>
BODY {SCROLLBAR-FACE-COLOR: #5e5ebe; SCROLLBAR-HIGHLIGHT-COLOR: #5e5ebe; SCROLLBAR-SHADOW-COLOR: #5e5ebe; SCROLLBAR-3DLIGHT-COLOR: #5e5ebe; SCROLLBAR-ARROW-COLOR:  #6666CC; SCROLLBAR-TRACK-COLOR: #E3E3E3; SCROLLBAR-DARKSHADOW-COLOR: #666666; }
</STYLE>
<head>
		<title>Create New Document</title>
			<!-- #include virtual="/ewebeditpro/ewebeditpro.asp" -->
	</head>
		
	<body>
					
			<form name="frmName" action="new.asp" method="post">
			<table border=0 cellspacing=0 cellpadding=5 width=100%>
			<tr>
				<td colspan=3>
					<font face="Verdana" size="3">
						<b>Create New Document</b>
					</font>
				</td>
			</tr>
			<tr>
				<td>
					<font face="Verdana" size="2">
						Title:
					</font>
				</td>
		
				<td>
					<input type="text" maxlength=255 size=50 name="edit_title">
				</td>
				
				<td align=right>
					<input type=submit name="submit" value="Save">
					<input type="Button" name="btnCancle" value="Cancel" onclick="eWebEditPro.actionOnUnload=EWEP_ONUNLOAD_NOSAVE; location.href='index.asp';">
				</td>
			</tr>
	
			<tr>
				<td valign=top colspan=3> 
					<font face="Verdana" size="2">
						Body
					</font>
			</td>
			</table>
			
				<% ' The following line creates the an editor object, eWebEditPro.actionOnUnload = EWEP_ONUNLOAD_NOSAVE
				   ' specifying edit_html as the field to copy data into
				   ' once the submit button has been activated.  %>
			   
				<% =eWebEditProEditor("edit_html", "100%", "75%", "") %><br>
				<script language="JavaScript1.2">
				eWebEditPro.onready = "initTransferMethod(eWebEditPro.event.srcName)";
				function initTransferMethod(sEditor)
				{
					eWebEditPro[sEditor].MediaFile().setProperty("TransferMethod", "mediamanager.asp");
				}
				</script>
			</form>
	</body>		
	</html>

<% End If %>