function Navigation( leftButtonID, rightButtonID, leftImageID, rightImageID, slideboxID )
{
	this.leftButton = document.getElementById( leftButtonID );
	this.leftImage = document.getElementById( leftImageID );
	this.rightButton = document.getElementById( rightButtonID );
	this.rightImage = document.getElementById( rightImageID );
	this.countArticles = document.getElementById( slideboxID ).childNodes.length;
	this.currentArticleNum = 1;
	
	this.moveLeft = function(count)
	{
		if(this.currentArticleNum-count > 0)
		{
			this.currentArticleNum-=count;
			this.UpdateButtonStates( );
			return true;
		}
		return false;
	};
	
	this.moveRight = function(count)
	{
		if(this.currentArticleNum+count <= this.countArticles)
		{
			this.currentArticleNum+=count;
			this.UpdateButtonStates( );
			return true;
		}
		return false;
	};
	
	this.boxLeftClicked = function( )
	{
		return this.moveLeft(1);
	};
	
	this.boxRightClicked = function( )
	{
		return this.moveRight(1);
	};
	
	this.SetButtonState = function( button, state )
	{
		if( button == this.rightButton )
		{
			if(button.className != "right" + state)
				button.className="right" + state;
			return true;
		}
		
		if( button == this.leftButton )
		{
			if(button.className != "left" + state)
				button.className="left" + state;
			return true;
		}
		return false;
	};
	
	this.UpdateButtonStates = function( )
	{
		if( this.currentArticleNum == 1 )
			this.SetButtonState( this.leftButton, "inactive" );
		else
			if( this.countArticles > 1 )
				this.SetButtonState( this.leftButton, "active" );
		if( this.currentArticleNum == this.countArticles )
			this.SetButtonState( this.rightButton, "inactive" );
		else
			if( this.countArticles > 1 )
				this.SetButtonState( this.rightButton, "active" );
		return true;
	};
}
