{{function name="countPages" iPages=1 iPageNumber=1 sUrl="" sUrl2=""}}
	{{if $iPageNumber > 1}}
		<a href="{{$sUrl}}{{if $iPageNumber > 2}}&amp;iPage={{$iPageNumber - 1}}{{/if}}{{$sUrl2}}">&laquo;&nbsp;{{$lang.pages_prev}}</a>
	{{/if}}
	{{$iPaginationSpacer = false}}
	{{section name=pages start=1 loop=$iPages+1 step=1}}
		{{if $smarty.section.pages.index != $iPageNumber && (abs($smarty.section.pages.index - $iPageNumber) <= $config.pagination_counter_admin || $smarty.section.pages.index <= $config.pagination_counter_admin || $smarty.section.pages.index >=  + $iPages - $config.pagination_counter_admin + 1)}}
			<a href="{{$sUrl}}{{if $smarty.section.pages.index > 1}}&amp;iPage={{$smarty.section.pages.index}}{{/if}}{{$sUrl2}}">{{$smarty.section.pages.index}}</a>
		{{$iPaginationSpacer = false}}
		{{elseif $smarty.section.pages.index == $iPageNumber}}
			<strong>{{$smarty.section.pages.index}}</strong>
		{{else}}
			{{if $iPaginationSpacer === false}}
			<strong>...</strong>
			{{$iPaginationSpacer = true}}
			{{/if}}
		{{/if}}
	{{/section}}
	{{if $iPageNumber < $iPages}}
		<a href="{{$sUrl}}&amp;iPage={{$iPageNumber + 1}}{{$sUrl2}}">{{$lang.pages_next}}&nbsp;&raquo;</a>
	{{/if}}
{{/function}}
<script type="text/javascript">
	$(document).ready(function(){
		{{if isset( $smarty.get.activeTabId )}}$('ul.tab-headers li a[href="#{{$smarty.get.activeTabId}}"]').trigger('click');{{/if}}
	});
</script>
<form action="?p=attributes-list" method="post">
	<fieldset class="tabbed">
		<div class="clear"></div>
		<ul class="tab-headers">
			<li><a href="#attributes">{{$lang.Attributes}}</a></li>
			<li><a href="#attributes_groups">{{$lang.Attributes_groups}}</a></li>
		</ul>
		<h1>{{$lang.Attributes}}</h1>
		<div class="tab" id="attributes">
			<h2>{{$lang.Attributes}}</h2>
			<a href="?p=attributes-form" class="new_element">{{$lang.New_attribute}}</a>
			<div class="filter attributes-filter">
				<div id="attributes-search-form">
					<fieldset>
						<div class="field">
							<label for="attribute-search">{{$lang.search}}</label><br/>
							<input id="attribute-search" type="text" name="sPhrase" value="{{$_POST.sPhrase}}" class="input" size="25" /><img class="tTip info" src="templates/images/info.png"  title="{{$lang.help_products_list_searcher}}" />
						</div>
						<div class="field">
							<input type="submit" class="submit" value="{{$lang.search}}" />
						</div>
					</fieldset>
				</div>
			</div>
			{{if count( $aAttributes ) > 0}}
				<table class="list" id="attributes">
					<thead>
						<tr><td colspan="5" class="pages">{{if $aAttributes.aPagesCountData.iCount > 1}}{{$lang.Pages}}: {{countPages iPages=$aAttributes.aPagesCountData.iCount iPageNumber=$aAttributes.aPagesCountData.iPageNumber sUrl='admin.php?p=attributes-'|cat:$a sUrl2=$sUrlExt}}{{/if}}</td></tr>
						<tr><th class="id">{{$lang.Id}}</th><th class="name">{{$lang.Name}}</th><th class="position">{{$lang.Position}}</th><th class="actions">{{$lang.Actions}}</th></tr>
					</thead>
					<tbody>
						{{foreach from=$aAttributes.aList item=aAttribute}}
							<tr>
								<td class="id">{{$aAttribute.iAttribute}}</td>
								<td class="name"><a href="?p={{$aActions.f}}-form&amp;iAttribute={{$aAttribute.iAttribute}}">{{$aAttribute.sName}}</a></td>
								<td class="position"><input name="aAttributesPositions[{{$aAttribute.iAttribute}}]" value="{{$aAttribute.iPosition}}" class="position" /></td>
								<td class="actions">
									<a href="?p={{$aActions.f}}-form&amp;iAttribute={{$aAttribute.iAttribute}}"><img src="{{$config.dir_templates}}admin/images/ico/edit.png" alt="{{$lang.Edit}}" title="{{$lang.Edit}}" /></a>
									<a href="?p={{$aActions.f}}-delete_attribute&amp;iAttribute={{$aAttribute.iAttribute}}" class="delete"><img src="{{$config.dir_templates}}admin/images/ico/delete.png" alt="{{$lang.Delete}}" title="{{$lang.Delete}}"/></a>
								</td>
							</tr>
						{{/foreach}}
					</tbody>
					<tfoot>
						<tr><td colspan="5" class="pages">{{if $aAttributes.aPagesCountData.iCount > 1}}{{$lang.Pages}}: {{countPages iPages=$aAttributes.aPagesCountData.iCount iPageNumber=$aAttributes.aPagesCountData.iPageNumber sUrl='admin.php?p=attributes-'|cat:$a sUrl2=$sUrlExt}}{{/if}}</td></tr>
					</tfoot>
				</table>
			{{/if}}
		</div>
		<div class="tab" id="attributes_groups">
			<h2>{{$lang.Attributes_groups}}</h2>
			<a href="?p=attributes-groups_form" class="new_element">{{$lang.New_attributes_group}}</a>
			{{if count( $aAttributesGroups ) > 0}}
				<table class="list">
					<thead>
						<tr>
							<th class="id">{{$lang.Id}}</th><th class="name">{{$lang.Name}}</th><th class="actions">{{$lang.Actions}}</th>
						</tr>
					</thead>
					<tbody>
						{{foreach from=$aAttributesGroups item=aAttributesGroup}}
							<tr>
								<td class="id">{{$aAttributesGroup.iGroup}}</td><td class="name"><a href="?p={{$aActions.f}}-groups_form&amp;iGroup={{$aAttributesGroup.iGroup}}">{{$aAttributesGroup.sName}}</a></td>
								<td class="actions">
									<a href="?p={{$aActions.f}}-groups_form&amp;iGroup={{$aAttributesGroup.iGroup}}"><img src="{{$config.dir_templates}}admin/images/ico/edit.png" alt="{{$lang.Edit}}" title="{{$lang.Edit}}" /></a>
									<a href="?p={{$aActions.f}}-groups_delete&amp;iGroup={{$aAttributesGroup.iGroup}}" class="delete" onclick="return del( );"><img src="{{$config.dir_templates}}admin/images/ico/delete.png" alt="{{$lang.Delete}}" title="{{$lang.Delete}}"/></a>
								</td>
							</tr>
						{{/foreach}}
					</tbody>
				</table>
			{{else}}
				<div class="msg" id="error">
					<img src="{{$config.dir_templates}}admin/images/ico/msg_error.png" class="imgv" alt="" /> {{$lang.Data_not_found}}
				</div>
			{{/if}}	
		</div>
		
		<div class="save float"><div class="save floatcontainer">
			<input type="submit" class="submit" value="{{$lang.Save}} &raquo;" name="sOption" />
		</div></div>
	
	</fieldset> <!-- end div tabbed -->
</form>
<div class="clear"></div>