<% 
	option explicit 
	Response.Buffer = true
	if session("company_id") <> "" then
%>
		<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
		<script language='vbscript'>
		sub DataCheck()
			if myform.press_release_date.value = empty then
				msgbox "Please enter the news date",64
				exit sub
			end if
			if myform.press_release_title.value = empty then
				msgbox "Please enter the news title",64
				exit sub
			end if
			if len(trim(myform.press_release_image.value)) > 0 then
				dim fext
				fext = lcase(right(myform.press_release_image.value,3))
				if fext = "jpg" or fext = "gif" or fext = "png" then
					'images format correct
				else
					msgbox "Image only support JPG, GIF, PNG format" 
					exit sub
				end if
			end if
			myform.submit
		end sub
		</script>
		<link rel="stylesheet" type="text/css" href="../../default.css" />
		<body topmargin='0'>
		<form method="post" action="insert_news.asp" name='myform' enctype="multipart/form-data">
		<table border="0" width="100%" cellspacing="0" cellpadding="2">
			<tr>
				<td colspan="2" height='30' valign='middle' class="label">
					<font style='color:#b50000'>
					<b>
					NEW PRESS RELEASE
					</font>
				</td>
			</tr>
			<tr>
				<td align="right"><font face="Verdana" class="label">NEWS DATE : </font></td>
				<td><input name="press_release_date" size='60' style="font-family: Arial; font-size: 8pt; font-weight: bold"></td>
			</tr>
			<tr>
				<td align="right"><font face="Verdana" class="label">NEWS TITLE : </font></td>
				<td><input name="press_release_title" size='60' style="font-family: Arial; font-size: 8pt; font-weight: bold"></td>
			</tr>
			<tr>
				<td align="right" valign='top'><font face="Verdana" class="label">NEWS DETAILS : </font></td>
				<td><textarea rows="15" name="press_release_details" cols='62' style="font-family: Arial; font-size: 8pt; font-weight: bold"></textarea></td>
			</tr>
			<tr>
				<td align='right'><font face="Verdana" class="label">IMAGE : </font></td>
				<td><input type='file' name="press_release_image" size='27' style="font-family: Arial; font-size: 8pt; font-weight: bold"></td>
			</tr>
			<tr>
				<td colspan='2' height='10'></td>
			</tr>
			<tr>
				<td align='right' valign='middle' colspan='2'>
					<input type="submit" value="SAVE" style="font-size: 7pt; font-family: verdana; font face:bold; width: 60px; height:20">
					<input type="reset" value="RESET" style="font-size: 7pt; font-family: verdana; font face:bold; width: 60px; height:20">
				</td>
			</tr>
		</table>
		</form>
		</body>
<%	
	else
		Response.Redirect "../../index.asp"
	end if
%>