{if $ajax eq 0}{include file="$admingentemplates/admin_top.tpl"}{/if}
<script>
{literal}
var tab_last = '1';
{/literal}
</script>
{if $ajax eq 0}
<div class="error_message"></div>
<div class="show_help" style="display: none;">&nbsp;</div>
<div class="red_header">{$info.name}</div>
<div class="cr">&nbsp;</div>
<div class="cr">&nbsp;</div>
    <div class="help_text" style="display:block;">
        <div class="close_help">
            <img src="{$site_root}{$template_root}/images/close_help.png" alt="">
        </div>
        <div class="help_body">
            <span class="help_title">{$lang.help}:</span>{$lang.admin_help.badwords_file}
        </div>
    </div>
<ul class="tabs">
    <li>
        <a {if $info.active == "reports"} class="current" {else} href="admin_abuse_reports.php"  {/if}>{$lang.admin_abuse_reports.razdel_name} ({$count.new_abuse}/{$count.all_abuse})</a>
    </li>
    <li>
        <a {if $info.active == "bad_words"} class="current" {else} href="admin_badwords.php" {/if}>{$lang.admin_menu.bad_words} ({$count.badwords})</a>
    </li>
    <li>
        <a {if $info.active == "ip_check"} class="current" {else} href="admin_block_ip.php" {/if}>{$lang.admin_menu.block_ip} ({$count.ip})</a>
    </li>
    <li>
        <a {if $info.active == "approve"} class="current" {else} href="admin_upload.php" {/if}>{$lang.admin_menu.uploads_approve} ({$count.approve})</a>
    </li>
</ul>
<div id="show_block" style="display:table;width:100%;">
{/if}
<div class="user_operation_line" style="height:4px;font-size:0px;"> </div>
<div class="cr"></div>

<div onclick="ShowEditor('1','admin_badwords.php?ajax=1');" id="tab_1" class="user_status_elem" width="80px">
    <a>{$lang.admin_menu.bad_words_alert} ({$badwords_count})</a>
</div>
<div onclick="ShowEditor('2','admin_badwords.php?sel=fileform&ajax=1');" id="tab_2" class="user_status_elem_active" width="80px">
    {$lang.admin_menu.bad_words_file} 
</div>

<!--div class="user_status_elem" width="80px">
    <a href="admin_badwords.php" >{$lang.admin_menu.bad_words_alert} ({$badwords_count})</a>
</div>
<div class="user_status_elem_active" width="80px">
    {$lang.admin_menu.bad_words_file}
</div-->  
	<div class="panel_subtabs" style="width: 100%">
                    <form id="file_form" name="file_form" action="{$form.action}" method="post">
					{$form.hiddens_edit}
        <table border=0 cellspacing=1 cellpadding=5 width="97%">                               
                    <tr valign=top >
                        <td align="left" width="30%" style="padding-left: 10px;padding-top:10px;" class="fl">{$lang.badwords.edit_file}:&nbsp;</td>
                    </tr>
                    <tr valign="top">
                        <td class="main_content_text" width="100%" align="left" ><textarea style="width:100%;" rows="15" name="content">{$data.content}</textarea></td>
                    </tr>                    
                    <tr height="10" >
                        <td colspan=2 align="left" class="main_content_text">
                        	<a class="admin_button_major" onclick="javascript: document.file_form.submit();" name="search_submit">{$lang.button.save}<span>&nbsp;</span></a>
                        </td>
						<td align="left" >&nbsp;</td>
                    </tr>
        </table>
					</form>
                    <form name="upload_form" id="upload_form" action="{$form.action}" method="post" enctype="multipart/form-data">
					{$form.hiddens_upload}
        <table border=0 cellspacing=1 cellpadding=5 width="97%">                    
                    
                    <tr valign=top >
                        <td  width="30%">
                            <div style="margin-top: 0;padding-left: 5px;padding-bottom:10px;width:100%;" class="fl">
                                {$lang.badwords.upload_file}:&nbsp;&nbsp;&nbsp;
                                <input type=file name=upload_file id="upload_file"  onchange="AddFile()" style="display: none;" />
                                <a id="upload_file2" class="admin_button btn_upload" onclick="document.getElementById('upload_file').click()" name="upload">{$lang.badwords.choose_file}<span>&nbsp;</span></a>
                                 &nbsp;&nbsp;&nbsp;&nbsp;
                            </div>
                            <div>                               
                                <input type=radio name=upload_type value=1/>&nbsp;{$lang.badwords.replace}&nbsp;<br>
                                <input type=radio name=upload_type value=2 checked="" />&nbsp;{$lang.badwords.add}  
                            </div>
                            <div style="margin-left: 230px; margin-top: -27px; margin-bottom: 30px;">OR</div>
                            
                        </td>
                    </tr>                                     
		
					</table>
					</form>
</div></div>{if $ajax eq 0}</div>
 <div class="cr">&nbsp;</div>
{include file="$admingentemplates/admin_bottom.tpl"}{/if}

<script type="text/javascript">
{literal}
	
if(window.opera != null){
	$('#upload_file').show();
	$('#upload_file2').hide();
}

function AddFile(){
     document.getElementById('upload_form').submit();
}
$(document).ready(function(){ 
		var err = "{/literal}{$form.err}{literal}";
		if (err){
			$(".error_message").html("{/literal}{$form.err}{literal}");
			$(".error_message").fadeIn(500);
			setTimeout('$(".error_message").fadeOut(500);', 5000);  
		}
		});

{/literal}
</script>