[% title = view.title %]


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

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

[% IF view.data.search_fields %]
<div class="box">
    <!-- ADD the search form generation code here -->
</div>
[% END %]
[%- IF self.fish_config( 'show_dev_navigation' ) %]
<table class="dev_nav">
    <tr>
    <td>
        
        <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>    
        
        [%- IF view.data.livesearch %]
        <input type="text"   name="livesearch" id="livesearch" value="" />
        <input type="button" name="search" value="search"
            onclick="javascript: livesearch();">
        [%- END %]
    </td>
</tr>
</table>	
[%- END %]

<div class="box">       
	<table id="results" class="results">
		<tr>
			[% 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>
