<?php
 $section = $db->name;
 $pagetitle  = $db->name;
 if(empty($pagetitle))
 $pagetitle = $site_title;
 $description  = $db->description;
?>
<script>
function gotolink(u,sec_id,subsec_id)
{
	document.getElementById("subsecid").value=subsec_id;
	document.searchfrm.action = u;
	document.searchfrm.secid.value = sec_id;
	document.searchfrm.submit();
}
</script>
<form name="searchfrm" id="searchfrm" action="<?php echo $page_name?>" method="post" enctype="multipart/form-data">
<input type="hidden" name="secid" id="secid" value="" />
<input type="hidden" name="subsecid" id="subsecid" value="" />
<table width="99%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="left"><span class="td"><a href="index.php" class="bnav">Home</a> &raquo; <?php echo $section?></span></td>
                </tr>
              <tr>
                <td>&nbsp;</td>
                </tr>
              <tr>
                <td><h2><?php echo $section?></h2></td>
                </tr>
              <tr>
                <td><h3 style="color:red"><?php echo $error_msg;?></h3></td>
                </tr>
              <tr>
                <td>
                  <?php echo $description?>
                </td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td align="center"><table border="0" width="100%">
				
				 <?php
								$i=0;						
								foreach($sdb as $s)
								 {
								 	if($s->pagelink != ""){
										$onClick_subsec = " href=\"#\" onClick=\"location.href='".$s->pagelink."'\"";
									}else{
										if($s->page_alias!=''){
											$onClick_subsec = " href=\"#\" onClick=\"location.href='".$s->page_alias.".html'\"";
										}else{
											$onClick_subsec = " href=\"#\" onClick=\"gotolink('subsectioncontent','".$db->id."','".$s->id."','')\"";
										}
									}
								 	if($i%3==0)
									{
										echo "<tr>";
									}
									echo '<td style="background-color:#42C6F9; padding:5px; text-transform: uppercase; font-family:Trebuchet MS,Arial,Helvetica,sans-serif;" width=33% height=40><a href="#" '.$onClick_subsec.' style="color: #333333; text-decoration: none">'.$s->name."</a></td>";
									$i++;
								 }
                            ?>
				</table></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td align="center">&nbsp;</td>
              </tr>
              </table>
</form>
