[%- title = view.title %]

[% colspan = ( view.data.headings.size || 0 ) 
     + ( view.data.header_options.size || 0 ) %]

[% IF view.data.overheading %]
    <h3>[% view.data.overheading %]</h3>
[% END %]

<dl class="dev_nav">
    [%- IF self.fish_config( 'show_dev_navigation' ) %]
    <dd>
        <select id="linkMenu" 
            onchange="window.location = this.options[this.selectedIndex].value">
            [%- FOREACH page IN self.site_links.sort( 'label' ) %]
            <option value='[% page.link %]'
                [% page.link == self.location ? 'selected="selected"' : '' %]>
                [%- page.label %]</option>
            [%- END %]
        </select>    
    </dd>
    [%- END %]
    
    [%- IF view.data.livesearch %]
    <dd>
        <input type="text"   name="livesearch" id="livesearch" value="" />
        <input type="button" name="search" value="search"
            onclick="javascript: livesearch();">
    </dd>
    [%- END %]
</dl>

<div class="results-box">       
	<table id="results" class="results">
		<tr class="heading">
			[% FOREACH heading IN view.data.headings %]
			<td class="hdr">[% heading %]</td>
			
				[% IF loop.last %]
					<td class="rhdr">
					[% FOREACH option IN view.data.header_options %]
                        [% "[" IF loop.first %]
						<a href="[% option.link %]">[% option.text %]</a>
						[% "|" IF ! loop.last %]
                        [% "]" IF loop.last %]
					[% END %]
					</td>
				[% END %]
									
			[% END %]
		</tr>	  	
		
		[% FOREACH row IN view.data.rows %]
		<tr class="results-row">
			[% FOREACH elem IN row.data %]
				<td class="dta">[% elem %]</td>							
			
				[% IF loop.last %]
					<td class="rdta">
					[% FOREACH option IN row.options %]
                        [% "[" IF loop.first %]
						<a href="[% option.link %]">[% option.text %]</a>
						[% "|" IF ! loop.last %]
                        [% "]" IF loop.last %]
					[% END %]
					</td>
				[% END %]				
			[% END %]
		</tr>
		[% END %]
		
		[% IF view.data.rows == '' %]
			<tr><td colspan="[% colspan %]">No Data</td></tr>	
		[% END %]
		
	</table>

	[% INCLUDE paging.ttc %]

</div>