<title>{$lang['edit_subject']} : {$SubjectInfo['title']}</title>
<script language="javascript">
function ShowPollTable()
{
	if ($("#poll_id").is(":checked"))
	{
		$("#poll_table").fadeIn();
	}
	else
	{
		$("#poll_table").fadeOut();
	}
}



function AddMoreAnswers(x)
{

	x += 1;
	var answers_max = 100;


	$("#poll_answers_count_id").val(x);
	$(".more_tr").hide();
	$("#poll_question_answers").append('<tr align="center"><td class="row1 rows_space">{$lang['answers_number']}' + x + '</td><td class="row1 rows_space"><input name="answer[]" type="text" id="answer' + x + '" /></td></tr>');
	$("#poll_question_answers").append('<tr align="center" class="more_tr"><td class="row1 rows_space" colspan="2"><input type="button" name="more_answers" class="more_answers_class" value="{$lang['more_answers']}" /></td></tr>');

     $("#answer" + x).focus();

 	       $(".more_answers_class").click(function() { AddMoreAnswers(x) });

        if (function() { AddMoreAnswers(x) })
		{
		$(".more_tr").stopPropagation();

		}

}

function Ready()
{
	$("#poll_table").hide();
	$("#poll_id").click(ShowPollTable);
	$(".more_answers_class").click(function() { AddMoreAnswers(2) });


}

function displaylimit(thename, theid, thelimit){
var theform=theid!=""? document.getElementById(theid) : thename;
var limit_text='<font class="smallfont">{$lang['number_of_characters_remaining']} <span style="font-weight:900;" id="'+theform.toString()+'">'+thelimit+'</span></font>';
if (document.all||ns6)
document.write(limit_text)
if (document.all){
eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}
}
else if (ns6){
document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true);
document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true);
}
}
$(document).ready(Ready);

</script>
{template}address_bar_part1{/template}
<?php $PowerBB->_CONF['template']['SubjectInfo']['title'] = $PowerBB->Powerparse->censor_words($PowerBB->_CONF['template']['SubjectInfo']['title']); ?>
<?php $PowerBB->_CONF['template']['SubjectpreviewInfo']['title'] = $PowerBB->Powerparse->censor_words($PowerBB->_CONF['template']['SubjectpreviewInfo']['title']); ?>
<a href="index.php?page=forum&amp;show=1&amp;id={$SubjectInfo['section']}{$SubjectpreviewInfo['section']}
{$password} ">
{$section_info['title']} </a>
{$_CONF['info_row']['adress_bar_separate']}
<a href="index.php?page=topic&amp;show=1&amp;id={$SubjectInfo['id']}{$SubjectpreviewInfo['id']}
{$password}">
{$SubjectInfo['title']}
{$SubjectpreviewInfo['title']}
</a>
{$_CONF['info_row']['adress_bar_separate']}
{$lang['edit_subject']}
{template}address_bar_part2{/template}
{template}preview{/template}
<form name="topic" method="post" action="{$edit_page}">
<input name="poll_answers_count" id="poll_answers_count_id" type="hidden" value="2">

<table border="0" cellspacing="1" width="98%" class="border" align="center">
	<tr>
		<td class="tcat" colspan="2">
		{$lang['text_Topic']}
		</td>
	</tr>
	<tr align="center">
		<td class="row1 rows_space" align="right">
				{if {$section_info['active_prefix_subject']}}
				{$lang['prefix_subject']}
		               <?php
		    			$excludedWords = array();
						$doubleAr = $PowerBB->_CONF['template']['section_info']['prefix_subject'];
						$doubleAr = str_replace($PowerBB->_CONF['template']['prefix_subject_prev'],'',$doubleAr);
						$doubleAr = str_replace($PowerBB->_CONF['template']['SubjectInfo']['prefix_subject'],'',$doubleAr);
						$prefix_subject = preg_split("#[\n]+#", $doubleAr, -1, PREG_SPLIT_NO_EMPTY);
						$excludedWords = array_merge($excludedWords, $prefix_subject);
						?>
						<select name="prefix_subject" style="font-weight: bold">
						<option value="">{$lang['no_prefix_subject']}</option>
						{if {$prefix_subject_prev} !=''}
						<option value="{$prefix_subject_prev}" selected='selected'>{$prefix_subject_prev}</option>
						{/if}
						{if {$SubjectInfo['prefix_subject']} !=''}
						<option value="{$SubjectInfo['prefix_subject']}" selected='selected'>{$SubjectInfo['prefix_subject']}</option>
						{/if}
						<?php
						for ($x = 0; $x < @count($excludedWords); $x++)
						{
						$excludedWords[$x] = @trim($excludedWords[$x]);
						$excludedWords[$x] = "<option value=".$excludedWords[$x].">".$excludedWords[$x]."</option>";

						echo $excludedWords[$x];
						}
						 echo '</select>';
						?>
				{/if}
			{$lang['subject_title']} :
			<input name="title" id="title" type="text" value="{$SubjectInfo['title']}{$title_prev}" size="40"
			onKeyDown="textCounter(this,'progressbar1',{$_CONF['info_row']['post_title_max']})"
onKeyUp="textCounter(this,'progressbar1',{$_CONF['info_row']['post_title_max']})"
onFocus="textCounter(this,'progressbar1',{$_CONF['info_row']['post_title_max']})" />
<script>
zextCounter(document.getElementById("title"),"progressbar1",{$_CONF['info_row']['post_title_max']})</script>
<script type='text/javascript'>
displaylimit("title","title",{$_CONF['info_row']['post_title_max']})
</script>
	</td>
		{if {$_CONF['info_row']['subject_describe_show']} == 1}
		<td class="row1 rows_space" align="right">
			{$lang['subject_describe']}:
			 <input name="describe" type="text" value="{$SubjectInfo['subject_describe']}{$describe_prev}" size="40" />
						<font class="smallfont">{$lang['Optional']}</font>
		</td>
		{/if}
	</tr>
	<tr>
		<td class="row1" colspan="2">

<div id="none">
	<div align="center">
	<table border="0" cellspacing="0" class="border" width="100%">
	<tr>
		<td class="editortoolbar" valign="top">
		{template}editor_js{/template}
       <!-- action_find_addons_3 -->
<textarea name="text" id="box_text" style="display:block;" class="editoriframe" tabindex="3">{$GetSubjectInfo}
{$prev}</textarea>
   <script type="text/javascript">
<!--
    comm._toggle();
    var smiley_wysiwyg = true;
    -->
</script>

		</td>
		<div style="border-style: solid; border-width: 0px; width:70px; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px ; ">
		<td class="editortoolbar" valign="top" width="50" align="center">
		<br />
		<br />
		<br />
		<br />
		<br />
		<br />
		<br />

		<table align="center" border="0" cellspacing="1" cellpadding="4" cellspacing="0" >
			<tr valign="bottom" align="center">
				<td class="editortoolbar" align="center">
           {template}smilebox{/template}</td>
			</tr>
		</table>
</div></td>
	</tr>
	<tr>
		<td class="editoricon" valign="top" colspan="2">
<fieldset>
<legend>{$lang['reason_edit']}</legend>
<input name="reason_edit" type="text" value="{$reason_edit}" size="50" />
</fieldset>
{template}iconbox{/template}
</td>
	</tr>
</table></div>
</div>
		</td>
	</tr>
     {if {$_CONF['info_row']['allowed_emailed']} == '1' AND {$_CONF['member_permission']}}
    <tr>
       <td class="row1" colspan="2">
          <input name="emailed" id="emailed_id" type="checkbox" {if {$IsSubscribed}}checked="checked"{/if}/> <label for="emailed_id">{$lang['Enabled_to_be_notified_by_the_existence_of_new_replies']}</a>
       </td>
    </tr>
    {/if}
	{if {$write_poll}}
		<tr>
		<td class="row1" colspan="2">
			<input name="poll" id="poll_id" type="checkbox" /> <label for="poll_id">{$lang['add_polls']}</a>
		</td>
	</tr>
	{/if}
        </table>

<br />
<table border="0" cellspacing="1" width="98%" class="border" align="center">
<tr>
        <td colspan="2" align="center" class="tcat">
{$lang['attachments']}
</td>
      </tr>
<tr>
 <td colspan="2" align="center" class="row1">
<INPUT name="attach" type="button" value="{$lang['manage_attachments']}"
 onClick="window.open('index.php?page=attachments&amp;edit_attach=1&amp;subject_id={$subject_id}','mywindow','scrollbars=yes,width=500,height=600')">
</td>
      </tr>
</table>
{if {$Admin}}
<br />
<table border="0" cellspacing="1" width="98%" class="border" align="center">
    <tr>
       <td class="tcat" colspan="2">
       {$lang['Management_options_subject']}
       </td>
    </tr>
    <tr>
       <td class="row2" colspan="2" align="right">
          {if {$SubjectInfo['stick']}}
          <input name="unstick" id="stick_id" type="checkbox" /> <label for="stick_id">
          {$lang['unstick_Subject']}
          </label>
          {else}
          <input name="stick" id="stick_id" type="checkbox" /> <label for="stick_id">
          {$lang['Sticky_Topic']}
          </label>
          {/if}
          <br />
          {if {$SubjectInfo['close']}}
          <input name="unclose" id="close_id" type="checkbox" /> <label for="close_id">
          {$lang['open_Subject']}
          </label>
          {else}
          <input name="close" id="close_id" type="checkbox" /> <label for="close_id">
          {$lang['locked_Topic']}
          </label>
          {/if}


       </td>
    </tr>
</table>

{/if}
<br />
<table border="0" cellspacing="1" width="98%" class="border" align="center">
	<tr align="center">
		<td class="row1 rows_space" >
					<input class="button" name="insert" type="submit" value="{$lang['Count']}" onClick="comm._submit();" />
					<input class="button" type="submit" value="{$lang['Preview']}" name="preview" onclick="comm._submit();" />
			</td>
	</tr>
</table>
<div id="poll_table">
{template}add_poll_table{/template}
</div>
</form>


<br />
