var rezise_font = function( sign )
{
	$$( '#contenido p, #contenido a' ).each(
		function( item )
		{
			fSize = $( item ).getStyle( 'font-size' ).toInt();
			if( sign == "+" )
			{
				fSize += ( fSize < 22 ?  1 : 0 );
			}
			else
			{
				fSize -= ( fSize > 9 ? 1 : 0 );
			}
			$( item ).setStyle( 'font-size', fSize );
		}
	);
}

var print_page = function()
{
	window.print();
}

window.addEvent( 
	'domready',
	function(){
		$( 'newsletter_link' ).addEvent( 
			'click',
			function()
			{
				new Request.JSON(
					{	'url' : 'qv3_newsletter.php',
						'onSuccess' : function( obj )
						{
							$( 'newsletter_email' ).set( 'value', '' );
							if( obj.error )
							{
								alert( obj.error );
							}
							else
							{
								alert( obj.mensaje );
							}
						}
					}
				).post( { 'action' : 'register', 'email' : $( 'newsletter_email' ).get( 'value' ) });
			} 
		);
		if( $( 'nota_prev' ) && $( 'nota_sig' ) )
		{
		new Request({
			'url' : '/rss/portada.rss',
			'onSuccess' : function( txt, rss )
			{
				var item = rss.getElementsByTagName( 'item' );
				var nodo = new parseXMLNode();
				var currId = 0;
				var id_sig = 1;
				var id_ant = 0;
				if( item.length > 0 )
				{
					for( i = 0; i < item.length; i++ )
					{
						var news = nodo.node2json( item[i] );
						link = news.link.value;
						//link = link.replace("www","qv3" );  ////  TEMPORAL PARA PRUEBAS
						if( link == window.location )
						{
							currId = i;
							break;
						}
					}
					if( currId == 0 ) 
					{
						id_sig = 1; id_ant = ( item.length - 1 );
					}else if( currId == ( item.length - 1) ) 
					{
						id_sig = 0; id_ant = ( currId -1 );
					}else
					{
						id_sig = ( currId + 1  );
						id_ant = ( currId - 1 );
					}
					siguiente = nodo.node2json( item[ id_sig ] ).link.value;
					anterior  = nodo.node2json( item[ id_ant ] ).link.value;

					$( 'nota_sig' ).set( 'href', siguiente );  //quitar el replace cuando ya este
					$( 'nota_prev' ).set( 'href', anterior );  //quitar el replace cuando ya este
				}
			}
		}).get();
	}
	}
);
