function paging_text_control(idPrefix,linkPrefix,maxPage,previousButton,nextButton,selected_page_color,page_color)
{
	this.idPrefix = idPrefix;
	this.linkPrefix = linkPrefix;
	this.maxPage = maxPage;

	this.previousButton = previousButton;
	this.nextButton = nextButton;

	this.selected_page_color = selected_page_color;
	this.page_color = page_color;

	this.currentPage = 1;
	this.newPage = 1;

	this.locked = false;

	oTC = this;
	
	this.next = function()
	{
		oTC.newPage = oTC.currentPage + 1;
		if( oTC.newPage > maxPage )
		{
			oTC.newPage = 1;
		}
		
		oTC.hidePage(oTC.newPage,oTC.currentPage);
	}

	this.previous = function()
	{
		oTC.newPage = oTC.currentPage - 1;
		if( oTC.newPage < 1 )
		{
			oTC.newPage = oTC.maxPage;
		}

		oTC.hidePage(oTC.newPage,oTC.currentPage);
	}

	this.choosePage = function(idNumber)
	{		
		$(oTC.linkPrefix+idNumber).blur();

		if( idNumber != oTC.currentPage )
		{
			oTC.hidePage(idNumber,oTC.currentPage);
		}
	}

	this.showPage = function(showP)
	{
		Effect.Appear(oTC.idPrefix+showP, {duration:0.6});
		oTC.locked = false;
	}

	this.hidePage = function(showP,hideP)
	{
		if(oTC.locked == false)
		{
			//change which link is highlighted.
			$(oTC.linkPrefix+oTC.currentPage).style.color = oTC.page_color;
			$(oTC.linkPrefix+showP).style.color = oTC.selected_page_color;

			oTC.processButton(showP);

			oTC.currentPage = showP;
			oTC.locked = true;
			Effect.Fade(oTC.idPrefix+hideP, {duration:0.6});
			setTimeout("oTC.showPage('"+showP+"')",700);
		}
	}

	this.processButton = function(showP)
	{
		if( showP > 1 )
		{
			$(oTC.previousButton).style.display = '';
		}
		else
		{
			$(oTC.previousButton).style.display = 'none';
		}

		if( showP >= oTC.maxPage )
		{
			$(oTC.nextButton).style.display = 'none';
		}
		else
		{
			$(oTC.nextButton).style.display = '';
		}
	}

}