{include file="$incpath/forums/user_panel_forums.tpl"}
{literal}
<script language="javascript" type="text/javascript">
<!-- //
var ie  = document.all  ? 1 : 0;
function high(kselect)
{
   if (ie)
   {
	   while (kselect.tagName != "TR")
	   {
		   kselect = kselect.parentElement;
	   }
   }
   else
   {
	   while (kselect.tagName != "TR")
	   {
		   kselect = kselect.parentNode;
	   }
   }
}
function off(kselect) {
   if (ie)
   {
	   while (kselect.tagName != "TR")
	   {
		   kselect = kselect.parentElement;
	   }
   }

}
function changesel(kselect) {
   if (kselect.checked)
   {
	   high(kselect);
   }
   else
   {
	   off(kselect);
   }
}

function selall(kselect) 
{
	var fmobj = document.kform;
	for (var i=0;i<fmobj.elements.length;i++) {
		var e = fmobj.elements[i];
		if ((e.name != 'allbox') && (e.type=='checkbox') && (!e.disabled)) {
			e.checked = fmobj.allbox.checked;
			if (fmobj.allbox.checked)
			{
			   high(e);
			}
			else
			{
			   off(e);
			}
		}
	}
}
// -->
</script>
{/literal}
<table width="100%"  border="0" cellpadding="5" cellspacing="1" class="forum_tableborder">
  <tr>
    <td class="forum_info_main">
	<strong>{#PN_PeronalMessages#}: </strong>&nbsp;
      <a href="index.php?p=pn&amp;goto=inbox">{#PN_inbox#}</a> | <a href="index.php?p=pn&amp;goto=outbox">{#PN_outbox#}</a> | <a href="index.php?p=pn&amp;action=new">{#PN_newpn#}</a><a href="index.php?p=pn&amp;action=new"></a>    </td>
  </tr>
</table>
<!-- // INBOX / OUTBOX -->
<!-- // NO MESSAGES -->
{if !$table_data && $smarty.request.action!='message' && $outin == 1 || $nomessages==1}
<table width="100%"  border="0" cellspacing="1" cellpadding="4">
  <tr>
    <td align="center"> 
      {#PN_nopns#}
    </td>
  </tr>
</table>
{/if}
<!-- NO MESSAGES // -->
{if $smarty.request.action!='new'}

<div class="forum_header_bolder" style="margin-top:5px;margin-bottom:5px">
 {if $smarty.request.goto=='outbox'}
<h3>{#PN_outbox#}</h3>
{else}
<h3>{#PN_inbox#}</h3>
{/if} 
</div>

{/if}
{if $outin == 1}

<table width="100%"  border="0" cellpadding="0" cellspacing="1" class="forum_tableborder">
  
  <tr>
    <td valign="top">
        <table width="100%" border="0" align="center" cellpadding="4" cellspacing="0">
          <tr>
            <td width="1%" class="forum_form_left"><table width="15%" border="0"  cellpadding="2" cellspacing="0" class="">
                <tr>
                  <td nowrap="nowrap"><div align="center">0 % </div></td>
                </tr>
              </table></td>
            <td width="70%"  align="left" class="forum_form_right">
              <table width="{$inoutwidth|numf}%"  border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td style="background:url({$imgpath_forums}pn_bar.gif) repeat-x" background="" ><img src="{$imgpath_forums}pn_bar.gif" alt="" /></td>
                </tr>
            </table></td>
            <td width="1%" class="forum_form_left"><table width="15%" border="0"  cellpadding="2" cellspacing="0" class="">
                <tr>
                  <td nowrap="nowrap"><div align="center">100 % </div></td>
                </tr>
              </table></td>
          </tr>
        </table>       </td>
    <td width="35%" align="right" valign="middle" class="forum_info_main">
	 {$pnioutnall} ({$inoutpercent}%) {$pnmax} <span class="errorfont">!{$warningpnfull}</span>	</td>
  </tr>
</table>
<br />
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td ><table width="100%" border="0" cellpadding="5" cellspacing="1" class="forum_tableborder">
        <tr class="box_innerhead">
          <td colspan="4" align="center" class="forum_header">
            <!-- ANZAHLWAHL -->
            <form  method="post" action="index.php?p=pn" name="psel" id="psel">
			<input type="hidden" name="goto" value="{$goto}" />
			<input type="hidden" name="page" value="1" />
              <select name="pp" class="input" id="pp">{$pp_l}</select>
              <select name="porder" class="input" id="porder">{$sel_topic_read_unread}</select>
              <select name="sort" class="input" id="sort">
              <option value="DESC" {$sel1}>{#desc_t#} </option>
              <option value="ASC" {$sel2}>{#asc_t#}</option>
              </select>
              <input type="submit" class="button" value="{#Forums_ShowButton#}" />
              <input name="page" type="hidden" id="page" value="{$page}" />
            </form>
			<!-- ANZAHLWAHL -->
			</td>
        </tr>
        <form  method="post" action="index.php?del=yes&p=pn" name="kform" id="kform" onsubmit="return confirm('{$pndel_confirm}');">
          <tr class="forum_form_right">
            <td width="20" colspan="2" class="forum_form_right">
            <input name="allbox" type="checkbox" id="d" onclick="selall();" value="" /></td>
            <td colspan="2" align="right"  nowrap="nowrap" class="forum_form_right"> <a href="{$normmodus_link}">
              {#PN_ListNorm#}</a> | <a href="{$katmodus_link}">
              {#PN_ListCateg#}
              </a> </td>
          </tr>
          {foreach from=$table_data item=data}
          {$data.tbody_start}
          <tr>
            <td width="20" align="center" class="forum_info_meta">              
            <input name="pn_{$data.pnid}" type="checkbox" id="d" value="1" />            
            </td>
            <td class="forum_info_meta" nowrap="nowrap"><div align="center">
                {$data.icon}
            </div></td>
            <td class="forum_info_main" width="100%" nowrap="nowrap"><a class="forum_links" href="{$data.mlink}">{$data.title|escape:html|sslash}
              </a>
              <br />
             
           
            <a class="forum_links_small" href="{$data.toid}">{$data.von}</a>
            
            </td>
            <td align="right" nowrap="NOWRAP" class="forum_info_meta">
              {$data.pntime|date_format:$config_vars.DateFomat}            
              </td>
          </tr>
          {$data.tbody_end}
          {/foreach}
          
          <tr>
            <td colspan="4" align="center" nowrap="nowrap" class="forum_info_meta" >
            
              <input name="goto" type="hidden" id="goto" value="{$goto}" />              
              <input type="submit" class="button" value="{#PN_delmarked#}" />            </td>
          </tr>
        </form>
      </table>
	  <table width="100%" border="0" cellpadding="0" cellspacing="0">
	  <tr>
	  <td>{if $nav}
	  <p>
	  {$nav}
	  </p>
	  {/if}</td>
	  <td align="right">{$dlpnas} <a href="{$pndl_text}">{$pndl_text_link}</a> | <a href="{$pndl_html}">{$pndl_html_link}</a></td>
	  </tr>
	  </table>
	  
    </td>
  </tr>
</table>
{/if}
<!-- INBOX / OUTBOX // -->
<!-- // NEW MESSAGE -->
{if $neu == 1}

<br />
<script language="javascript" src="{$jspath}/jvalidate.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
{include file="$incpath/other/koobicode.js"}
{include file="$incpath/other/validate_conf.tpl"}

{literal}
$(document).ready(function() {
	var validator = $("#f").validate(
	{ 
		rules: 
		{ 
			tofromname: {required: true},
			title: {required: true,minLength:4},
			text: {required: true, minLength:4, maxLength:{/literal}{$max_post_length}{literal}}
			{/literal}
			{if $use_code==1}
			//,scode:{ldelim}required: true{if !get_active('img_captcha')},number:true, remote: "index.php?do=checkuserdata&p=register"{/if}{rdelim}
			{/if}
			{literal}
		},
		messages: 
		{
			scode: {remote:'{/literal}{#Validate_wrong#}{literal}'}
		},
			
		submitHandler: function() 
		{ 
			document.forms['f'].submit();
		},
		
		success: function(label) 
		{
			label.html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;").addClass("checked");
		}
	});
});
{/literal}
//-->
</script>
{if $preview == 1}
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td ><table width="100%"  border="0" cellpadding="5" cellspacing="1" class="forum_tableborder">
        <tr>
          <td class="forum_header">{#PN_Preview#}</td>
        </tr>
        <tr>
          <td class="forum_post_first">{$preview_text|sslash}</td>
        </tr>
      </table></td>
  </tr>
</table>
<br />
{/if}

<form  method="post" action="index.php?p=pn&amp;action=new" name="f" id="f">
<div class="box_innerhead">{if $smarty.request.forward == 2}<strong>{#PN_reply#}</strong>{else}{#PN_newpn#}{/if}</div>
<br />
{if $iserror == 1}
<div class="error_box">
{$title_error}
<ul>
{$error}
</ul>
</div>
<br />
{/if}
<fieldset>
<p><label><input type="text" class="input" name="tofromname" value="{$tofromname}" size="40" /> {#to_t#}</label> <input onclick="open_window('index.php?p=misc&do=searchuser','PnUser','450','400',1);" type="button" class="button" value="{#PN_SearchUser#}" /></p>
<p><label><input name="title"  type="text" class="input" value="{$title}" size="40" /> {#PN_Subject#}</label></p>
<p>{if $smilie == 1}{$listemos}{/if}{include file="$incpath/comments/format.tpl"}</p>
<div style="height:275px">
<textarea class="input" name="text" id="msgform"  rows="15" style="width:99%; height:250px" onfocus="getActiveText(this)" onclick="getActiveText(this)"  onchange="getActiveText(this)">{$text|sslash}</textarea>
</div>

<p><label><input name="use_smilies" type="checkbox" id="use_smilies" value="yes" checked="checked" /> {#PN_UseSmilies#}</label></p>
<p><label><input name="parseurl" type="checkbox" id="parseurl" value="yes" checked="checked" /> {#PN_URLParse#}</label></p>
<p><label><input name="savecopy" type="checkbox" id="savecopy" value="yes" checked="checked" /> {#PN_SaveCopy#}</label></p>
<p><label><input type="radio" name="send" value="2" checked="checked" /> {#PN_SendNow#}</label></p>
<p><label><input type="radio" name="send" value="1" /> {#PN_Preview#}</label></p>

<input type="submit" class="button"   value="{#PN_SendNow#}" />
</fieldset>
</form>
{/if}
<!-- NEW MESSAGE // -->
<br />
{if $showmessage == 1}
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td ><table width="100%"  border="0" cellpadding="5" cellspacing="1" class="forum_tableborder">
        <tr>
          <td colspan="2" class="forum_header"><strong>{$pntitle}</strong></td>
        </tr>
        <tr>
          <td width="150" class="forum_form_left"><a class="forum_links"  href="{$tofromname_link}">
            {$tofromname}
            </a></td>
          <td class="forum_form_right">{#send_dt#}:
            <span class="time">
            {$pntime|date_format:$config_vars.DateFomat}            </span></td>
        </tr>
        <tr valign="top">
          <td width="150" height="120" class="forum_form_left">{$posts}:
            {$posts_num}
            <br />
            {$membersince}:
            {$membersince_date|date_format:$config_vars.DateFomatSimple} </td>
          <td class="forum_form_right">{$message}</td>
        </tr>
        <tr valign="top">
          <td class="forum_form_left">&nbsp;</td>
          <td class="forum_form_right">
		 
<form  name="answer_f" method="post" action="index.php">
<input type="hidden" name="p" value="pn" />
<input type="hidden" name="action" value="new" />
<input type="hidden" name="forward" value="2" />
<input type="hidden" name="id" value="{$pn_id}" />
<input type="hidden" name="subject" value="{$pn_subject}" />
<input type="hidden" name="aut" value="{$pn_aut}" />
<input type="hidden" name="goto" value="{$pn_goto}" />
<input type="hidden" name="date" value="{$pn_date}" />
<input type="hidden" name="text" value="{$pn_text|escape:html}" />
</form>

<form  name="forward_f" method="post" action="index.php">
<input type="hidden" name="p" value="pn" />
<input type="hidden" name="action" value="new" />
<input type="hidden" name="forward" value="1" />
<input type="hidden" name="id" value="{$pn_id}" />
<input type="hidden" name="subject" value="{$pn_subject}" />
<input type="hidden" name="aut" value="{$pn_aut}" />
<input type="hidden" name="goto" value="{$pn_goto}" />
<input type="hidden" name="date" value="{$pn_date}" />
<input type="hidden" name="text" value="{$pn_text|escape:html}" />
</form>
		  {if $answerok == 1}<div class="forum_buttons_small"><a href="javascript:document.forms['answer_f'].submit();"><img src="{$imgpath_forums}reply_small.png" border="0" alt="" />{#PN_reply#}</a></div>{/if}
			<div class="forum_buttons_small"><a href="javascript:document.forms['forward_f'].submit();" target="_self"><img src="{$imgpath_forums}reply_small.png" border="0" alt="" />{#PN_forward#}</a></div>
			<div class="forum_buttons_small"><a href="{$delpn}" target="_self" onclick="return confirm('{#delpn_t#}');"><img src="{$imgpath_forums}delete_small.png" border="0" alt="" />{#PN_delete#}</a></div>
			
		  </td>
        </tr>
      </table></td>
  </tr>
</table>
{/if}
{include file="$incpath/forums/forums_footer.tpl"}