<a name="insert"></a>
<script type="text/javascript" charset="utf-8" src="<?php echo $this->SYSTEM->sys_dirs['js']?>form.js"></script>
<form method="post" action="<?php echo $this->script_name, (($_GET['do'] == 'write' or $_GET['do'] == 'read' /* Comment System */) ? 'do=write' : "do={$_GET['do']}&id={$_GET['id']}&from={$_GET['from']}") ?>" accept-charset="utf-8" enctype="multipart/form-data" onsubmit="return insert_submit(this)" onreset="return insert_reset(this)">
<fieldset>
<table cellspacing="1">
<?php if ($_GET['do'] != 'reply'): ?>
<tr>
<td class="fieldname">
<label for="name"><?php echo $this->say['name']?></label>
</td>
<td class="fieldvalue">
<input type="text" name="name" id="name" class="text" value="<?php echo $this->SYSTEM->entry->detail['name']?>" dir="<?php echo ( $_GET['do'] != 'write' ? $this->SYSTEM->entry->detail['dir'] : $this->langdir)?>" maxlength="<?php echo $this->SYSTEM->settings->param['namelen']?>" tabindex="1" />
</td>
</tr>
<tr>
<td class="fieldname">
<label for="country"><?php echo $this->say['country']?></label>
</td>
<td class="fieldvalue">
<?php echo $this->list_countries( ($_GET['do'] != 'write' ? $this->SYSTEM->entry->detail['country'] : ''/*$this->SYSTEM->user->get_country()*/) )?>
</td>
</tr>
<tr>
<td class="fieldname">
<label for="email"><?php echo $this->say['email']?></label>
</td>
<td class="fieldvalue">
<input type="text" name="email" id="email" class="text" value="<?php echo $this->SYSTEM->entry->detail['email']?>" tabindex="3" />
</td>
</tr>
<tr>
<td class="fieldname">
<label for="web"><?php echo $this->say['web']?></label>
</td>
<td class="fieldvalue">
<input type="text" name="web" id="web" class="text" value="<?php echo $this->SYSTEM->entry->detail['web']?>" tabindex="4" />
</td>
</tr>
<?php echo $this->block_messenger()?>
<?php echo $this->block_avatar()?>
<?php echo $this->block_rating()?>
<tr>
<td class="fieldname" style="vertical-align: top">
<label for="message"><strong><?php echo $this->say['msg']?></strong></label>
</td>
<td class="fieldvalue" style="text-align: left">
<div id="texteditor">
<div id="textformat">
<input type="button" name="l2r" class="small" value="⺠¶" tabindex="8" onclick="text_align('ltr');" />
<input type="button" name="r2l" class="small" value="¶ â¹" tabindex="9" onclick="text_align('rtl');" />
<input type="hidden" name="dir" id="dir" value="<?php echo ( $_GET['do'] != 'write' ? $this->SYSTEM->entry->detail['dir'] : $this->langdir)?>" />
<input type="text" id="counter_chars" class="dynbox" value="<?php echo /*$_GET['do'] != 'write' ? max(strlen($this->SYSTEM->entry->detail['message']), $this->SYSTEM->settings->param['msglen']) : */$this->SYSTEM->settings->param['msglen'] ?>" readonly="readonly" />
<?php if ($this->SYSTEM->settings->param['emoticons']): ?>
<input type="text" id="counter_emoticons" class="dynbox" value="<?php echo $this->SYSTEM->settings->param['emoticons']?>" readonly="readonly" />
<?php endif ?>
<!--
<input type="text" id="counter_chars" name="counter_chars" class="small" disabled="disabled" value="<?php echo $this->SYSTEM->settings->param['msglen']?>" />
<input type="text" id="counter_emoticons" name="counter_emoticons" class="small" disabled="disabled" value="<?php echo $this->SYSTEM->settings->param['emoticons']?>" />
-->
</div>
<textarea name="message" id="message" cols="50" rows="6" dir="<?php echo ( $_GET['do'] != 'write' ? $this->SYSTEM->entry->detail['dir'] : $this->langdir)?>" tabindex="10"
onfocus="text_storecaret();" onblur="text_checklength();" onselect="text_storecaret();" onclick="text_storecaret();"
ondblclick="text_storecaret();" onkeyup="text_storecaret(); text_checklength(); emoticons_write_left();"
onkeydown="text_storecaret(); text_checklength(); emoticons_write_left();"><?php if ($_GET['do'] != 'write') echo $this->SYSTEM->entry->detail['message'] ?></textarea>
<?php echo $this->block_emoticons()?>
</div>
</td>
</tr>
<tr>
<td class="fieldname">
<label for="pvt"><?php echo $this->say['pvt']?></label>
</td>
<td class="fieldvalue">
<input type="checkbox" name="pvt" id="pvt" value="1" tabindex="11"<?php echo ($this->SYSTEM->entry->detail['pvt'] ? ' checked="checked"' : '')?> />
</td>
</tr>
<?php else: ?>
<tr>
<td class="fieldname" style="vertical-align: top">
<label for="reply"><?php echo $this->say['msg']?></label>
</td>
<td class="fieldvalue">
<div id="texteditor">
<textarea name="reply" id="reply" cols="67" rows="6" tabindex="12"><?php echo $this->SYSTEM->entry->detail['reply'] ?></textarea>
</div>
</td>
</tr>
<?php endif ?>
</table>
<div class="buttons">
<?php if ((!$this->SYSTEM->user->get('admin') or mjguest_debugmode) and ($_GET['do'] == 'write') and $this->SYSTEM->settings->param['captcha']):?>
<img src="<?php echo $this->SYSTEM->sys_files['captcha']?>" id="captcha_image" alt="captcha" title="<?php echo $this->say['alert_empty_captcha']?>" />
<input type="text" name="captcha" id="captcha" value="" title="" dir="ltr" maxlength="5" tabindex="12" onkeyup="check_captcha();" />
<?php endif ?>
<input type="hidden" id="entrycode" name="entrycode" autocomplete="off" value="<?php $this->SYSTEM->user->set('entrycode', md5(uniqid(rand(), true))); echo $this->SYSTEM->user->get('entrycode')?>" />
<input type="submit" tabindex="13" />
<input type="reset" tabindex="14" />
</div>
</fieldset>
</form>