{include file="header.html"}
<script type="text/javascript" src="index.php?act=jslang"></script>

<script type="text/javascript" src="{res file=js/navigation.js}" charset="utf-8"></script>
<script type="text/javascript">
$(function(){
       $('#navigation_form').validate({
        errorPlacement: function(error, element){
            $(element).next('.field_notice').hide();
            $(element).after(error);
        },
        success       : function(label){
            label.addClass('right').text('OK!');
        },
        rules : {
            title : {
                required : true
            },
            sort_order:{
               number   : true
            }
        },
        messages : {
            title : {
                required : '{$lang.title_empty}'
            },
            sort_order  : {
                number   : '{$lang.number_only}'
            }
        }
    });
      $('#diy').click (
        function()
        {
            on('diy');
            $('#link').attr('disabled',false);
            $('#link').val("{$navigation.link|escape}");
            $('#gcategory_cate_id').val('');
        }
    );
});

</script>
<div id="rightTop">
    <p>{$lang.navigation}</p>
    <ul class="subnav">
        <li><a class="btn1" href="index.php?app=navigation">{$lang.manage}</a></li>
        {if $navigation.nav_id}
        <li><a class="btn1" href="index.php?app=navigation&amp;act=add">{$lang.add}</a></li>
        {else}
        <li><span>{$lang.add}</span></li>
        {/if}
    </ul>
</div>

<div class="info">
    <form method="post" enctype="multipart/form-data" id="navigation_form">
        <table class="infoTable">
            <tr>
                <th class="paddingT15">
                    {$lang.nav_type}</th>
                <td class="paddingT15 wordSpacing5">
                    <input id="diy" type="radio" name="nav_type" value="diy" checked="checked" /><label for="diy">{$lang.diy}</label>
                    <input id="gcategory" type="radio" name="nav_type" value="gcategory" />
                    <label for="gcategory">{$lang.gcategory}</label>
                    <input type="hidden" id="gcategory_cate_id" name="gcategory_cate_id" class="mls_id" />
                    <span id='select_gcategory'>
                    <select><option value="">{$lang.select_pls}</option>{html_options options=$gcategory_options}</select>
                    </span>
                    <input id="acategory" type="radio" name="nav_type" value="acategory" />
                    <label for="acategory">{$lang.acategory}</label>
                    <select id="acategory_cate_id" name="acategory_cate_id"><option value="">{$lang.select_pls}</option>{html_options options=$acategory_options}</select>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.title}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="mls_name infoTableInput2" id="title" type="text" name="title" value="{$navigation.title|escape}" />
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.link}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableInput" id="link" type="text" name="link" value="{$navigation.link|escape}" />
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    <label for="type">{$lang.type}:</label></th>
                <td class="paddingT15 wordSpacing5">
                    {html_radios options=$type checked=$navigation.type name=type}
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    <label>{$lang.open_new}:</label></th>
                <td class="paddingT15 wordSpacing5">
                    {html_radios options=$open_new checked=$navigation.open_new name=open_new}
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.sort_order}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="sort_order" id="sort_order" type="text" name="sort_order" value="{$navigation.sort_order}" />
                </td>
            </tr>
        <tr>
            <th></th>
            <td class="ptb20">
                <input class="formbtn" type="submit" name="Submit" value="{$lang.submit}" />
                <input class="formbtn" type="reset" name="Submit2" value="{$lang.reset}" />
            </td>
        </tr>
        </table>
    </form>
</div>
{include file="footer.html"}
