{TEMPLATE top}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" lang="ru">
    <head>
        <title>{IF $CNCAT[page][cid] > 0}{cn_str($CNCAT[page][cat][title])} - {ENDIF}{cn_str($CNCAT[page][title])}</title>
        <meta name="Content-Type" content="text/html; charset={$CNCAT[lang][charset]}" />
        <link rel="stylesheet" type="text/css" media="all" href="{$THEMEURL}style.css" />
        {IF $CNCAT[page][keywords]}<meta name="keywords" content="{cn_str($CNCAT[page][keywords])}" />{ENDIF}
        {IF $CNCAT[page][description]}<meta name="description" content="{cn_str($CNCAT[page][description])}" />{ENDIF}
        {IF $CNCAT[page][cid] > 0}
            {IF $CNCAT[page][show_rss]}<link rel="alternate" type="application/rss+xml" title="{cn_str($CNCAT[config][rss_title])}" href="{$CNCAT[abs]}cncat_rss.php?c={$CNCAT[page][cid]}" />{ENDIF}
        {ENDIF}
    </head>
    <body>
{/TEMPLATE}

{TEMPLATE bottom}
    <table id="bottom" width="100%">
        <tr><td class="copyright">
            {cn_copyright(1)}
        </td>
        {IF $CNCAT[banner][page_bottom]}
            <td align="right" style="padding-right: 20px;">{$CNCAT[banner][page_bottom]}</td>
        {ENDIF}
        </tr>
    </table>
    </body>
</html>  
{/TEMPLATE}

<!-- Main menu -->
{TEMPLATE menu}
    <table id="top" width="100%">
        <tr><td id="title">
            {cn_str($CNCAT[config][catalog_title])}
        </td><td id="control">
            <form action="{$CNCAT[abs]}cncat_search.php" method="get">
                <a href="{$CNCAT[abs]}">{$CNCAT[lang][menu_main]}</a> |
                {IF !$CNCAT[config][add_disable]}<a href="{$CNCAT[abs]}cncat_add.php"><strong>{$CNCAT[lang][menu_add_link]}</strong></a> |{ENDIF}
                {IF $CNCAT[config][add_article_enable]}<a href="{$CNCAT[abs]}cncat_add_article.php"><strong>{$CNCAT[lang][menu_add_article]}</strong></a> |{ENDIF}
                <a href="{$CNCAT[abs]}cncat_admin">{$CNCAT[lang][menu_admin]}</a> |
                <a href="{$CNCAT[abs]}cncat_map.php">{$CNCAT[lang][menu_map]}</a>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <input type="text" name="q" size="20" class="text" value="{cn_str($CNCAT[page][search_query])}" />
                <input type="submit" value="{$CNCAT[lang][search_submit]}" class="submit" />
            {IF $CNCAT[user][id]}
                <br />{$CNCAT[lang][you_login_as]} <a href="{$CNCAT[abs]}cncat_admin/index.php?act=logout">{$CNCAT[lang][logout]}</a>
            {ENDIF}
            </form>
        </td></tr>
    </table>
    {IF $CNCAT[banner][page_top]}
        <center>{$CNCAT[banner][page_top]}</center>
    {ENDIF}
{/TEMPLATE}

<!-- Search form -->
{TEMPLATE searchform}
{/TEMPLATE}

<!-- Sorting controls -->
{TEMPLATE sort_top}
                    {$CNCAT[lang][sort_by]}: 
{/TEMPLATE}

{TEMPLATE sort}
                    {IF $CNCAT[page][sort_order]==$CNCAT[sort][id]}
                        <strong>{cn_str($CNCAT[sort][title])}</strong>
                    {ELSE}
                        <a href="{cn_str($CNCAT[sort][url])}">{cn_str($CNCAT[sort][title])}</a>
                    {ENDIF}
{/TEMPLATE}

{TEMPLATE sort_delim} | {/TEMPLATE}

{TEMPLATE sort_bottom}
{/TEMPLATE}

<!-- Page navigation controls   -->

{TEMPLATE pagenav_top}
	<form action="" onsubmit="
        if ((this.elements[0].value-1) &gt; {$CNCAT[pagenav][pagecount]} || this.elements[0].value &lt; 1) 
        {
            alert('{$CNCAT[lang][wrong_page_number]}');
            return false;
        } 
        url='{$CNCAT[pagenav][urltemplate]}'; 
        location.href = url.replace(new RegExp('{PAGE}', ''), this.elements[0].value-1);
        return false;
    " method="get">
    <table class="pagenav">
    <tr>
{/TEMPLATE}

{TEMPLATE pagenav_curpage}
        <td><input name="p" type="text" size="2" value="{$CNCAT[pagenav][curpage]}" /></td>
{/TEMPLATE}

{TEMPLATE pagenav_pageitem}
        <td><a href="{$CNCAT[pagenav][url]}">{$CNCAT[pagenav][curpage]}</a></td>
{/TEMPLATE}

{TEMPLATE pagenav_delim1}<td>&nbsp;</td>{/TEMPLATE}

{TEMPLATE pagenav_delim2}<td>&nbsp;&nbsp;...&nbsp;&nbsp;</td>{/TEMPLATE}

{TEMPLATE pagenav_bottom}
    </tr>
    </table>
    </form>
{/TEMPLATE}

<!-- Filters -->


{TEMPLATE filters_top}
    <form action="?" id="filters">
    <table id="filters">
        <tr>
{/TEMPLATE}

{TEMPLATE filter (FILTER[title])}{/TEMPLATE}

{TEMPLATE filter_top}
        <td class="filter">
            <table>
                <tr><td class="title" nowrap="nowrap">
                    {$CNCAT[filter][title]}
                </td><td class="clear"></td></tr>
                <tr><td colspan="2" class="values">
{/TEMPLATE}

{TEMPLATE filtval (FILTVAL[id,title])}
                    <input type="checkbox" name="f{$CNCAT[filtval][id]}" value="1" id="f{$CNCAT[filtval][id]}" onclick="form.submit()" {if $CNCAT[filtval][_checked]}checked="checked"{endif} /> <label for="f{$CNCAT[filtval][id]}">{$CNCAT[filtval][title]}</label>
{/TEMPLATE}

{TEMPLATE filtval_delim}{/TEMPLATE}

{TEMPLATE filter_bottom}
                </td></tr>
            </table>
        </td>
{/TEMPLATE}

{TEMPLATE filters_delim}
{/TEMPLATE}


{TEMPLATE filters_bottom}
            {IF $CNCAT[page][filter_used]}
            <td style="padding: 0 10px; vertical-align: bottom;">
                <a href="#" onclick="for(i = 0; i < document.getElementById('filters').length; i++) { document.getElementById('filters').elements[i].checked = 0; }; document.getElementById('filters').submit();" style="color: gray; text-decoration: none; padding: 1px 4px">x</a>
            </td>
            {ENDIF}
            <td class="free"></td>
        </tr>
    </table>
    {IF $CNCAT[config][url_style]==0}
        <input type="hidden" name="c" value="{$CNCAT[page][cid]}" />
        <input type="hidden" name="s" value="{$CNCAT[page][sort_order]}" />
        <input type="hidden" name="p" value="{$CNCAT[page][page_num]}" />
        {IF $CNCAT[page][item_type] >= 0}
            <input type="hidden" name="t" value="{$CNCAT[page][item_type]}" />
        {ENDIF}
    {ENDIF}
    </form>
{/TEMPLATE}

{TEMPLATE itemtypes_top}
	{$CNCAT[lang][itemtypes_show]}:
{/TEMPLATE}

{TEMPLATE itemtype}
        {IF $CNCAT[itemtype][id] == $CNCAT[page][item_type]}
            <strong>{cn_str($CNCAT[itemtype][title])}</strong>
        {ELSE}
            <a href="{cn_str($CNCAT[itemtype][url])}">{cn_str($CNCAT[itemtype][title])}</a>
        {ENDIF}
{/TEMPLATE}

{TEMPLATE itemtypes_delim} | {/TEMPLATE}

{TEMPLATE itemtypes_bottom}
{/TEMPLATE}
