$(document).ready(function() {

	var pager = $("#pager");
	var pages = 0;

	$("#text1").each(function () { pages++; });
	$("#text2").each(function () { pages++; });
	$("#text3").each(function () { pages++; });

	if(pages>1) {
		var html = "";
		html += "<a href='#' page='1'>1</a>";
		if(pages>1) html += "<a href='#' page='2'>2</a>";
		if(pages>2) html += "<a href='#' page='3'>3</a>";
		pager.html(html).find("a").click(function () {
			var n = $(this).attr("page");
			$(".tb").css("display", "none");
			$("#text"+n).css("display", "block");
			$("#pager a").css("text-decoration", "underline");
			$(this).css("text-decoration", "none");
		}).css("display", "inline");
		pager.find("a:gt(0)").css("text-decoration", "underline");
	}

});