function SelectPage(Filename, Count, Choose)
{
	var Nought;
	document.write("<select language='JavaScript' name='Page' size='1' class='Dotted-Line' onChange='location.href=this.options[this.selectedIndex].value;'>");

	for (i = 1; i <= Count; i++)
	{
		if (i <= 9) Nought = 0;

		if (i == Choose) {
			document.write("<option value='" + i + "' selected>目前第 " + Nought + i + " 頁</option>");
		}
		else {
			document.write("<option value='" + Filename + "&Page=" + i + "'>翻到第 " + Nought + i + " 頁</option>");
		}

		Nought = '';
	}

	if (Count == 0) document.write("<option value='null' selected>無任何頁數</option>");
}

function HorizontalPage(Filename, Count, Choose)
{
	if (Count == 0)
	{
		document.write("無任何頁數");
	}
	else
	{
		var PreviousPage	= '';
		var NextPage		= '';
		var LastChange		= (Math.ceil(Choose / 10)) * 10;
		var FirstChange		= LastChange - 9;

		if (LastChange > Count) LastChange = Count;
		if (FirstChange > 10)  PreviousPage = "<a href='" + Filename + "&Page=" + (FirstChange - 10) + "' class='link2'>【前 10 頁】</a>"

		var PageLess = Count - LastChange;
		if (PageLess >= 1)
		{
			if (PageLess > 10) PageLess = 10;
			NextPage = "<a href='" + Filename + "&Page=" + (LastChange + 1) + "' class='link2'>【下 "+ PageLess +" 頁】</a>"
		}

		document.write(PreviousPage);

		for (i = FirstChange; i <= LastChange; i++)
		{
			if (i == Choose)
			{
				document.write("【" + i + "】");
			}
			else
			{
				document.write("<a href='" + Filename + "&Page=" + i + "' class='link2'>【" + i + "】</a>");
			}
		}

		document.write(NextPage);
	}
}

function MultiPage(Filename, Count)
{
	if (Count > 8)
	{
		var PageCount = Math.ceil(Count / 8);
		document.write("( <img src='/Images/Option/MultiPage.gif' align='absmiddle'>");

		for (i = 1; i <= PageCount; i++)
		{
			if (i < 6)
			{
				document.write("<a href='" + Filename + "&Page=" + i + "'>" + i + "</a> ");
			}
			else
			{
				document.write("...");
				document.write("<a href='" + Filename + "&Page=" + PageCount + "'>" + PageCount + "</a>");
				break;
			}
		}
		document.write(" )");
	}
}