<?php
require_once 'include.php';

//si no es numero sali
if(!is_numeric($_GET['ng'])) exit("acepto solo numeros");

$aNoticiasAnio = darNoticiasDelGrupoPorAnio($_GET['ng']);
$aGrupo = darDatosGrupoNovedad($_GET['ng']);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<?php echo URL_SITIO ?>">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Centro de Formaci&oacute;n Judicial</title>
<script type="text/javascript" src="js/sdmenu.js">
		/***********************************************
		* Slashdot Menu script- By DimX
		* Submitted to Dynamic Drive DHTML code library: http://www.dynamicdrive.com
		* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
		***********************************************/
	</script>
	<script type="text/javascript">
<!--
// <![CDATA[
	var myMenu;
	window.onload = function() {
		myMenu = new SDMenu("my_menu");
		myMenu.init();
}
	// ]]>
//-->
</script>
<link href="css/sdmenu-nuevo.css" rel="stylesheet" type="text/css" />
<link href="css/cfj.css" rel="stylesheet" type="text/css" />
</head>

<body bgcolor="#E2E2E2">
<table width="970" border="0" align="center" cellpadding="0" cellspacing="0" class="fondo">
  <tr>
    <td colspan="5" valign="top" bgcolor="#E2E2E2"><?php require_once 'encabezado.php'; ?></td>
  </tr>
  <tr>
    <td colspan="5" bgcolor="#E2E2E2" class="pixel">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="5">&nbsp;</td>
  </tr>
  <tr>
    <td width="194" valign="top"><?php require_once 'botonera.php'; ?></td>
    <td width="20">&nbsp;</td>
    <td width="542" valign="top" bgcolor="#FFFFFF"><table width="542" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td colspan="3" class="barra_navegacion">
            <a href="index.php" class="btnPath">Inicio</a> > 
            <span class="btnPath"><?=$aGrupo['gno_nombre']?></span>
            <br /><br />
        </td>
      </tr>
      <tr>
        <td colspan="3"><h1><?=$aGrupo['gno_nombre']?></h1><span class="listado"><?=$aGrupo['gno_texto']?></span></td>
      </tr>
      <tr>
        <td width="20">&nbsp;</td>
        <td valign="top"><table width="502" border="0" cellspacing="0" cellpadding="0">

          <tr>
            <td width="465" height="25">&nbsp;</td>
            <td width="37">&nbsp;</td>
          </tr>
        <?php
	    foreach ($aNoticiasAnio as $iAnio => $aNoticias) {
	    ?>
	        
	        <?php
	        if ($_GET['ng'] != 17 && $_GET['ng'] != 19 && $_GET['ng'] != 16 && $_GET['ng'] != 9 && $_GET['ng'] != 7) {
	        ?>
    	        <tr>
                    <td class="listado" colspan="2" align="center" style="background-color: #e0e8f3;"><h3><?=$iAnio?></h3></td>
                </tr>
            <?php
            }
            ?>
        
            <?php
    	    foreach ($aNoticias as $aNoticia) {
    	        $sLink = 'vermas-noticias.php?n='.$aNoticia['nov_id'];
    	        $sTarget = '_self';
    	        if (!empty($aNoticia['nov_link'])) {
    	            $sLink = $aNoticia['nov_link'];
    	            $sTarget = '_blank';
    	        } elseif ($aNoticia['nov_url']) {
                    $sLink = 'noticia/'.$aNoticia['nov_url'];
                }
    	    ?>
              <tr>
                <td class="listado"><?=$aNoticia['nov_titulo']?></td>
                <td align="center"><a href="<?=$sLink?>" target="<?=$sTarget?>"><img src="img/ver-mas-circulo.jpg" width="20" height="21" border="0" /></a></td>
              </tr>
              <tr>
                <td height="11" colspan="2"><img src="img/pixel-transp.jpg" width="1" height="1" /></td>
                </tr>
              <tr>
                <td height="1" colspan="2" bgcolor="#6796C8"><img src="img/pixel-transp.jpg" width="1" height="1" /></td>
              </tr>
              <tr>
                <td height="11" colspan="2"><img src="img/pixel-transp.jpg" width="1" height="1" /></td>
              </tr>
            <?php
            }
            ?>
            
        <?php
        }
        ?>
        </table>        
        <h3><span class="descripcion"><br />
        </span></h3>
          </td>
        <td width="20">&nbsp;</td>
      </tr>
      <tr>
        <td colspan="3">&nbsp;</td>
        </tr>
    </table></td>
    <td width="20">&nbsp;</td>
    <td width="194" valign="top"><?php require_once 'lat-derecho.php'; ?></td>
  </tr>
  <tr>
    <td colspan="5" valign="bottom"><?php require_once 'pie.php'; ?></td>
  </tr>
</table>
</body>
</html>
