 	  	

	/*
	 * Clase noticias
	 * ---------------
	 *  - Almacena los datos de las noticias recibiendo un JSON a traves de PHP.
	 *  - Aņade funcionalidades de visualizacion
	 * 
	 */
  
  	var Articulo = new Class({
  		initialize : function(objeto){
  			this.id = objeto.id;
  			this.titulo = objeto.titulo;
  			this.cuerpo	= $ZVK.sinQuots(objeto.cuerpo);
  			this.fecha = objeto.fecha;
  			this.categoria = objeto.categoria;
  			this.web = objeto.web;
  			this.autor = objeto.autor;
  			},
  		
  		extracto : function(){

			if(this.cuerpo.length<410){return this.cuerpo; }
			else { return $ZVK.sinTags(this.cuerpo.substr(0,410)+'[...]')}
  			},
  			
  		verFecha : function(){
			var fecha = this.fecha;
			
			arrafecha = fecha.split('-');
			
			ano = arrafecha[0];
			
			mes = arrafecha[1];
			if (mes.substr(0,1)=='0') mes = mes.substr(1,1);
			
			mes = arraymeses[mes];				
			dia = arrafecha[2];
			if (dia.substr(0,1)=='0') dia = dia.substr(1,1);
					
			fecha = mes+' de '+ano;
			return fecha;
			}
  			
  		});
	
	
	/********************************************/
	/* Carga de datos							*/
	/*											*/
	
	arraynoticias = $ZVK.toJason(arraynoticias);
	principal = new Articulo(arraynoticias[principal]);
  	
  	
  	/********************************************/
	/* On load									*/
	/*											*/
		
	window.addEvent('domready', function() {
		
		
		/* 
		 *  1 - Carga el listado de noticias en memoria 
		 *  2 - Despliega los accesos a las noticias anterios.
		 *  3 - Carga los comportamientos de lacciones Imprimir, ver listado y leer completa
		 * 
		 */

		/* -- 1 -- */
		
		
		/* -- 2 -- */
					 
		
				
		/* -- 3 -- */
		
		$ZVK.leermas();
				
		$('listar').addEvent('click',function(event){
			event.stop();
			$ZVK.subir('anteriores');
			});
			
		$('imprimir').addEvent('click',function(event){
			event.stop();
			window.print();
			});
		
		});
