var NewsManager = 
{	
	actual_news_id: 0,
	news_count: 0,
	
	initNews: function(news_count)
	{	
		this.news_count = news_count -1;		
	},
	
	showNext: function ()
	{	
		if (this.actual_news_id < this.news_count)
		{
			this.hideActual();			
			this.actual_news_id ++;
			this.showAll();
		}
	},
	
	showLast: function ()
	{
		this.hideActual();
		this.actual_news_id = this.news_count;		
		this.showAll();
	},
	
	showPrevious: function ()
	{		
		if (this.actual_news_id > 0)
		{
			this.hideActual();			
			this.actual_news_id --;
			this.showAll();
		}
	},
	
	showFirst: function ()
	{	
		this.hideActual();
		this.actual_news_id = 0
		this.showAll();
	},
	
	hideActual: function ()
	{
		document.getElementById('news_' + this.actual_news_id).style.display = 'none';	
	},
	
	showAll: function ()
	{
		this.showActual();
		this.showActiveRightArrows();
		this.showActiveLeftArrows();
	},
	
	showActual: function ()
	{
		document.getElementById('actual_news').innerHTML = this.actual_news_id + 1;
		document.getElementById('news_' + this.actual_news_id).style.display = 'block';
	},
	
	showActiveLeftArrows: function()
	{
		if (this.actual_news_id == 0)
		{
			document.getElementById('left_arrows_active').style.display = 'none';
			document.getElementById('left_arrows_not_active').style.display = 'block';
		}
		else
		{
			document.getElementById('left_arrows_active').style.display = 'block';
			document.getElementById('left_arrows_not_active').style.display = 'none';
		}
	},
	
	showActiveRightArrows: function()
	{
		
		if (this.actual_news_id == this.news_count)
		{
			document.getElementById('right_arrows_active').style.display = 'none';
			document.getElementById('right_arrows_not_active').style.display = 'block';			
		}
		else
		{
			document.getElementById('right_arrows_active').style.display = 'block';		
			document.getElementById('right_arrows_not_active').style.display = 'none';
		}
		
	}	
	
}
