<?php
   session_start(); //Iniciamos la session
   if(!isset($_SESSION['user'])) {
     header("location: login.php");
   }
   else{
	  if( ($_SESSION['user'] != 'root') && ($_SESSION['user'] != 'lorenzon')) {
	     header("location: index.php");
	  }
   }
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="Description" content="CECONEA - UNNE" />
<title>HPC-CECONEA</title>
  
<!-- // FANCY BOX!!!! -->
	<script type="text/javascript" src="js/jquery-1.10.1.min.js"></script>
	<script type="text/javascript" src="js/jquery.fancybox.js?v=2.1.5"></script>
	<link rel="stylesheet" type="text/css" href="css/jquery.fancybox.css?v=2.1.5" media="screen" />

	<script type="text/javascript">
		$(document).ready(function() {
			$('.fancybox').fancybox();
		});
	</script>

<!-- // FANCY BOX!!!! -->

	<script type="text/javascript">
		function modificar(x){
				formux = "formu"+x;
				//document.forms[formux]["tituloxxx"].style.display= 'block';
				//document.forms[formux]["tituloxxx"].style.display= 'block';
				
				document.forms[formux]["iddescripcion"+x].style.color="#000000";
				document.forms[formux]["idpagina"+x].style.color="#000000";
				document.forms[formux]["idtitulo"+x].style.color="#000000";
				
				document.forms[formux]["iddescripcion"+x].readOnly=false;
				document.forms[formux]["idpagina"+x].readOnly=false;
				document.forms[formux]["idtitulo"+x].readOnly=false;
				
				document.getElementById("idocultar1"+x).removeAttribute("disabled");
				document.getElementById("idocultar2"+x).removeAttribute("disabled");
				document.getElementById("idlinkpagina"+x).removeAttribute("href");
				document.getElementById("idlinkpagina"+x).removeAttribute("class");
				document.forms[formux]["idmodif"+x].style.display= 'none';
				document.forms[formux]["idguardar"+x].style.display= 'block';
			}
			
		function guardar(x){
				formux = "formu"+x;
				
				document.getElementById("idocultar1"+x).disabled = true;
				document.getElementById("idocultar2"+x).disabled = true;
				document.forms[formux]["idmodif"+x].style.display= 'block';
				document.forms[formux]["idguardar"+x].style.display= 'none';
				document.forms[formux]["iddescripcion"+x].style.color="#666666";
				document.forms[formux]["idpagina"+x].style.color="#666666";
				document.forms[formux]["idtitulo"+x].style.color="#666666";
				document.forms[formux]["iddescripcion"+x].readOnly=true;
				document.forms[formux]["idpagina"+x].readOnly=true;
				document.forms[formux]["idtitulo"+x].readOnly=true;
				
				document.getElementById("idlinkpagina"+x).href = document.forms[formux]["pagina"+x].value;
				document.getElementById("idlinkpagina"+x).className = "fancybox fancybox.iframe";
		}
		
		function mostrar_insertar(){
				document.forms["insert_formu"].style.display= 'block';
				document.getElementById("show_insert_button").style.display= 'none';
				show_insert_button
		}
		
	</script>

<style type="text/css">
.nobord { border-style: solid; border-width: 0; padding: 0 }
</style>

<style media="all" type="text/css">
@import url("./css/estiloP.css");
@import url("./css/fuentes.css");
@import url("./css/menu.css");
</style>

<style media="all" type="text/css">
#link{
  text-decoration:none;
  color: #ACACAC;
}
</style>

<script type="text/javascript">
var numero = 0;

// Funciones comunes
c= function (tag) { // Crea un elemento
   return document.createElement(tag);
}
d = function (id) { // Retorna un elemento en base al id
   return document.getElementById(id);
}
e = function (evt) { // Retorna el evento
   return (!evt) ? event : evt;
}
f = function (evt) { // Retorna el objeto que genera el evento
   return evt.srcElement ?  evt.srcElement : evt.target;
}

addField = function () {
   container = d('files');
   
   span = c('SPAN');
   span.className = 'file';
   span.id = 'file' + (++numero);

   field = c('INPUT');   
   field.name = 'archivos[]';
   field.type = 'file';
   
   a = c('A');
   a.name = span.id;
   a.href = '#';
   a.onclick = removeField;
   a.innerHTML = 'Quitar';

   span.appendChild(field);
   span.appendChild(a);
   container.appendChild(span);
}
removeField = function (evt) {
   lnk = f(e(evt));
   span = d(lnk.name);
   span.parentNode.removeChild(span);
}
</script>



</head>

<body bgcolor="#5C6350">
<table id="tabla" align="center" cellspacing="0" cellpadding="0"  >
  <tr>
    <td>
       <?php
	 include "titulo.php";
      ?>
    </td>
  </tr>
  <tr>
    <td valign="bottom">
      <?php
         if(isset($_SESSION['user'])) {
	   include "menulogueado.php";
	 }
         else{
	   include "menu.php";
         }
      ?>
    </td>
  <tr>
    <td padding="10px" margin="3px" bgcolor="#FFFFFF">
	<?php
	   include "admin_novedades_contenido.php";
	?>
    </td>
  </tr>
  <tr>
    <?php
       include "bottom.php";
    ?>
  </tr>
</table>
	      
</body>
</html>
