{{assign var=theLinks value=$links.links}}
{{if $theLinks|@count gt 1}}
{{if $links.pagePrevious neq false}}
	<a href="javascript: window.GalleryPageNum= 1; getMedia('mediaList' );"  style="text-decoration:none; ">First</a>  
{{/if}}
{{if $links.pagePrevious neq false}}
	<a href="javascript: window.GalleryPageNum= {{$links.pagePrevious}}; getMedia('mediaList' );"  style="text-decoration:none; "><<</a>  
{{/if}}
{{foreach from=$theLinks item=v key=k name=n}}
	{{if $v eq true}}
		{{$k}}
	{{else}}
		<a href="javascript: window.GalleryPageNum= {{$k}}; getMedia('mediaList' ); " >{{$k}}</a>
	{{/if}}
	{{if !$smarty.foreach.n.last}} | {{/if}}
{{/foreach}}
{{if $links.pageNext neq false}}
	  <a href="javascript: window.GalleryPageNum= {{$links.pageNext}}; getMedia('mediaList' );" style="text-decoration:none; ">>></a>
{{/if}}
{{if $links.pageNext neq false}}
	  <a href="javascript:  window.GalleryPageNum= {{$links.pageLast}}; getMedia('mediaList' );" style="text-decoration:none; ">Last</a>
{{/if}}

{{/if}}
<div><img src="/images/sep.gif" height="5"/></div>
{{if $table|@count eq 0}}
<center>There are no pictures into this category</center>
{{else}}

{{assign var=Tnail value='Collection_'|concat:$collectionID|concat:'_'|concat:$TnailColumn}}
{{assign var=Image value='Collection_'|concat:$collectionID|concat:'_'|concat:$ImageColumn}}
{{assign var=Alt   value='Collection_'|concat:$collectionID|concat:'_'|concat:$AltColumn}}
{{assign var=ID   value='Collection_'|concat:$collectionID|concat:'_ID'}}

				<table cellpadding="0" cellspacing="0" border="0" {{if $table|@count gt 7}}width="100%"{{/if}}>
				<tr valign="top">
				{{foreach from=$table item=v key=k name=n}}					
					{{if $smarty.foreach.n.index % 7 eq 0 and $smarty.foreach.n.iteration gt 1}}</tr><tr valign="top">{{/if}}
					<td>
						<img src="{{$v.$Tnail}}" id="image_{{$smarty.foreach.n.index}}" title="{{$v.$Alt}}" class="gallery" onClick="showBigImage('{{$v.$Image}}' , '{{$v.$Alt}}' , {{$smarty.foreach.n.index}} )" />
					</td>
				{{/foreach}}
				</tr>
				</table>
				{{assign var=v value=$table[0]}}
				<div id="gallerybigimage">
				{{assign var=imageWidth value=$v.$Image|getWidth}}
				<img src="{{$v.$Image}}" title="{{$v.$Alt}}" id="galleryselectedimage" {{if $imageWidth gt 780}} width="780"{{/if}}/>
				</div>
				<input type="hidden" name="gallerypicturesnumber" value="{{$table|@count}}"/>
{{/if}}

