<!-- Page top and bottom -->
{TEMPLATE top}
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <HEAD>
        <title>{IF $CNCAT[page][cid] > 0}{cn_str($CNCAT[page][cat][title])} / {ENDIF}{cn_str($CNCAT[page][title])}</title>
        <META http-equiv="Content-Type" content="text/html; charset={$CNCAT[lang][charset]}">
        {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}
        <LINK rel="stylesheet" type="text/css" href="{$THEMEURL}styles.css" />
    </HEAD>
    <BODY>
{/TEMPLATE}

{TEMPLATE bottom}
    <hr>
    <table border="0" cellspacing="0" cellpadding="0" width="100%">
    <tr>
        <td>{cn_copyright(1)}</td>
        <td align="right">
            {IF $CNCAT[banner][page_bottom]}
                {$CNCAT[banner][page_bottom]}
            {ENDIF}
        </td>
    </tr>
    </table>

    </BODY>
    </HTML>    
{/TEMPLATE}

<!-- Main menu -->
{TEMPLATE menu}
    <table border="0" cellspacing="0" cellpadding="0" width="100%">
    <tr>
        <td align="left">
            {$SYS[php_version]} <span class="sitetitle">{cn_str($CNCAT[config][catalog_title])}</span>
        </td>
        <td align="right">
            <a href="{$CNCAT[abs]}"><strong>{$CNCAT[lang][menu_main]}</strong></a> | 
            {IF !$CNCAT[config][add_disable]}<a href="{$CNCAT[abs]}cncat_add.php"><strong>{$CNCAT[lang][menu_add_item]}</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_map.php"><strong>{$CNCAT[lang][menu_map]}</strong></a> |
            <a href="{$CNCAT[abs]}cncat_admin/">{$CNCAT[lang][menu_admin]}</a><br>
        </td>
    </tr>
    </table>
    {IF $CNCAT[banner][page_top]}
        <center>{$CNCAT[banner][page_top]}</center>
    {ENDIF}

    <br>
{/TEMPLATE}

<!-- Search form -->
{TEMPLATE searchform}
    <center>
    <table class="search">
    <tr>
        <td align="left">
        </td>
        <td align="right">
            <table width="300">
            <tr>
                <td>
                    <form style="margin:0px" action="{$CNCAT[abs]}cncat_search.php">    
                    <table width="300" border="0" cellspacing="1" cellpadding="0">
                        <tr>
                            <td><input value="{cn_str($CNCAT[page][search_query])}" type="text" name="q" class="searchtext"></td>
                            <td><input type="submit" value="   {$CNCAT[lang][search_submit]}   " class="searchbutton"></td>
                        </tr>
                    </table>
                    </form>
                </td>
            </tr>
            </table>
        </td>
    </tr>
    </table>
    </center>
{/TEMPLATE}

<!-- Sorting controls -->
{TEMPLATE sort_top}
    <div align="right">
        {$CNCAT[lang][sort_by]}: 
{/TEMPLATE}

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

{TEMPLATE sort_delim} | {/TEMPLATE}

{TEMPLATE sort_bottom}
    </div>
{/TEMPLATE}

<!-- Page navigation controls   -->

{TEMPLATE pagenav_top}                                                                                                                                                            
	<center>
	<form action="" style="margin:0px" onSubmit="
        if ((this.elements[0].value-1)>{$CNCAT[pagenav][pagecount]} || this.elements[0].value<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]}" class="pagenav"></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>
    </center>
{/TEMPLATE}

<!-- Filters -->


{TEMPLATE filters_top}
    <br>
    <table class="{IF $CNCAT[page][filter_used]}filters1{ELSE}filters0{ENDIF}">
    <tr>
        <td align="left">
            <form style="margin:0px" action="">
            <table border="0" cellspacing="0" cellpadding="0">
            <tr>
{/TEMPLATE}

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


{TEMPLATE filter_top}
                <td valign="top">
                    <b>{$CNCAT[filter][title]}</b><br>
{/TEMPLATE}

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

{TEMPLATE filtval_delim}{/TEMPLATE}

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

{TEMPLATE filters_delim}
                <td style="border-right:1px solid #CCCCCC">
                    &nbsp;&nbsp;
                </td>
                <td>
                    &nbsp;&nbsp;
                </td>
{/TEMPLATE}


{TEMPLATE filters_end}
                {if $CNCAT[page][filter_used]}
                    <td style="border-right:1px solid #CCCCCC">
                        &nbsp;&nbsp;
                    </td>
                    <td>
                        &nbsp;&nbsp;
                    </td>
                    <td>
                        <input type="reset" onClick="javascript:for (i=0;i<form.length;i++){form.elements[i].checked=0};form.submit();">
                    </td>
                {endif}
    
            </tr>
            </table>
            </form>
        </td>
    </tr>
    </table>
{/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}
