<div class="portletBody">
	<h3>
		$tlang.getString("newtop.crenewtop")
	</h3>
		#if ($alertMessage)<div class="alertMessage">$tlang.getString("gen.alert") $validator.escapeHtml($alertMessage)</div>#end
		<div class="clear"></div>
		<script type="text/javascript">
			focus_path = [ "newcategory" ];
			if (parent) if (parent.parent) parent.parent.window.scrollTo(0,400);
		</script>
		<p class="instruction">
			$tlang.getString("newtop.comthefor")
		</p>
		<h4>
			$tlang.getString("gen.mes")
		</h4>	
		<form action="#toolForm($action)" method="post">
			#set ($catCount =0)
			#foreach ($c in $categories)
				#set ($catCount = ($catCount + 1))
			#end
				#if ($catCount > 0)
					<p class="shorttext">
					<span class="reqStar">*</span>
						<label for="category">							
							$tlang.getString("gen.cat2")
						</label>
						<select name="category" id="category"   onchange="blur()">
							<option value="">$tlang.getString("newtop.selcat")</option>
							#foreach ($c in $categories)
								#if ($c.equals($category))
									<option value="$validator.escapeHtml($c)" selected>$validator.escapeHtml($c)</option>
								#else
									<option value="$validator.escapeHtml($c)">$validator.escapeHtml($c)</option>
								#end
							#end
						</select>
					</p>	
					<p class="shorttext">
						<label for="newcategory">					
							<span style="padding-left:2em">$tlang.getString("newtop.oradd")</span>
						</label>	
							#if ($!newcategory)
								<input type="text" name="newcategory" size ="25" id="newcategory" value="$validator.escapeHtml($category)" 
							#else
								<input type="text" name="newcategory" size ="25"  id="newcategory" value=""
							#end
							onkeydown="if ((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13)){return false}"
							/>
						</p>	
				#else
					<p class="shorttext">
						<span class="reqStar">*</span>
						<label for="newcategory">							
							$tlang.getString("gen.cat")
						</label>	
						#if ($!newcategory)
							<input type="text" name="newcategory" size ="25"  id="newcategory" value="$validator.escapeHtml($category)" 
						#else
							<input type="text" name="newcategory" size ="25"  id="newcategory" value="" 
						#end
							onkeydown="if ((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13)){return false}"
							/>
					</p>						
				#end	
				<p class="shorttext">
					<span class="reqStar">*</span>
					<label for="subject">
						$tlang.getString("newtop.toptit")
					</label>	
					<input type="text" id="subject" size ="25"  name="subject" value="$!newtopicsubject"
						onkeydown="if ((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13)){return false}"
					/>
				</p>
				<p class="labelindnt">$date.toStringLocalFullZ()</p>
				<h4>
					$tlang.getString("newtop.reptyp")
				</h4>
				#if ($!newtopicreplystyle.equals("star"))
					<p class="checkbox"><input type="radio" name="style" value="thread" id="styleThread" /><label for="styleThread">$tlang.getString("newtop.allrep1")</label></p>
					<p class="checkbox"><input type="radio" name="style" value="star" id="styleStar" checked="checked" /><label for="styleStar">$tlang.getString("newtop.allrep2")</label></p>
				#else
					<p class="checkbox"><input type="radio" name="style" value="thread" checked="checked" id="styleThread" /><label for="styleThread">$tlang.getString("newtop.allrep1")</label></p>
					<p class="checkbox"><input type="radio" name="style" value="star" id="styleStar" /><label for="styleStar">$tlang.getString("newtop.allrep2")</label></p>
				#end
				
					<h4>
						$tlang.getString("gen.mes")
					</h4>	
				<table border="0" summary="layout"><tr><td>
				<textarea name="body" id="body" cols="80" rows="30" wrap="virtual">$validator.escapeHtmlFormattedTextarea("$!newtopicbody")</textarea>
				#chef_setupformattedtextarea("body")
				</td></tr></table>
				<h4>
					$tlang.getString("gen.att")
				</h4> 
				#set ($size = 0)
				#set ($props = false)
				#foreach ($attachment in $attachments) 
					#set ($props = $attachment.Properties) 
					#if ($!props)
						#set ($size = $size + 1)
					#end
				#end
				#if ($size == 0)
					$tlang.getString("gen.noatt")
					<div class="act">
						<input type="submit" name="eventSubmit_doAttachments" value="$tlang.getString("gen.addatt")" />
					</div>
				#else
					<ul class="attachList indnt1">
						#foreach ($attachment in $attachments) 
							#set ($props = false)
							#set ($props = $attachment.Properties) 
							#if ($!props)
								<li>
									#if ($props.getBooleanProperty($props.NamePropIsCollection))
										<img src = "#imageLink($contentTypeImageService.getContentTypeImage("folder"))" border="0" alt="$tlang.getString("gen.folatt")" />
									#else
										<img src = "#imageLink($contentTypeImageService.getContentTypeImage($props.getProperty($props.NamePropContentType)))" border="0" alt="$tlang.getString("gen.filatt")" />
									#end
									<a href="$attachment.Url" target="_blank">$validator.escapeHtml($props.getPropertyFormatted($props.NamePropDisplayName))</a>						
									#if (!$props.getBooleanProperty($props.NamePropIsCollection))
										($props.getPropertyFormatted($props.NamePropContentLength))
									#end
								</li>
							#end
						#end
					</ul>
					<div class="act">
						<input type="submit" name="eventSubmit_doAttachments" value="$tlang.getString("gen.addrem")" />
					</div>
				#end							
			<div class="act">
				<input type="submit"  accesskey="s"  class="active"  name="eventSubmit_doNew_topic" value="$tlang.getString("newtop.addtop")" />
				<input type="submit" accesskey="d"  name="eventSubmit_doNew_topic" value="$tlang.getString("gen.savdra")" />
				<input type="submit" accesskey="x"  name="eventSubmit_doCancel_new_topic" value="$tlang.getString("gen.can")" />
			</div>
		</form>
	</div>

