//ÀÌÀüÆäÀÌÁö, ´ÙÀ½ ÆäÀÌÁö, Ã¹ÆäÀÌÁö, ¸¶Áö¸· ÆäÀÌÁö¸¦ º¸¿©ÁØ´Ù. 
function GoToPage(strPage, strActionASPName)
{
	var intPageNo = parseInt(document.forms[0].PageNo.value, 10);
	var intCurrPageNo = intPageNo;
	
	if (strPage == "+")
		intPageNo = intPageNo + 1;
	else if (strPage == "-")	
		intPageNo = intPageNo - 1;
	else if (strPage == "first")
		intPageNo = 1;		
	else if (strPage == "last")
		intPageNo = intLastPageNo;	
	
	if (intCurrPageNo == intPageNo)
		return;
	else if (intPageNo <= 0)
	{
		alert(lngAlertFirstPage);
		return;
	}
	else if (intPageNo > intLastPageNo)	
	{
		alert(lngAlertLastPage);
		return;
	}
	else if (intPageNo >= 1 && intPageNo <= intLastPageNo)
	{
		with (document.forms[0])
		{
			PageNo.value = intPageNo;
			target = self.name;
			action = strActionASPName;
			submit();
		}
	}

}

//ÆäÀÌÁö º¸±â ¹öÆ°À» ´­·¶À» ¶§, Æ¯Á¤ÇÑ ÆäÀÌÁö¸¦ º¸¿©ÁØ´Ù.	
function GoToSelectedPage(strActionASPName)
{
	if (selectedPageNoCheck(strActionASPName) == true)
		document.forms[0].submit();
	else
		return;
}

function GoToSelectedPage2(intPageNo, strActionASPName)
{
	//if (selectedPageNoCheck(strActionASPName) == true)
	//{
	with (document.forms[0])
	{
		//selectedPageNo.value = intPageNo;
		PageNo.value = intPageNo;
		target = self.name;
		action = strActionASPName;
		submit();
	}
	//}
	//else
	//	return;
}

function selectedPageNoCheck(strActionASPName)
{
	var strPageNo = document.forms[0].selectedPageNo.value;
	for (i=0;i<strPageNo.length;i++)
	{
		charCode = strPageNo.charCodeAt(i)
		if (charCode<48 || charCode>57)
		{
			alert(lngNotCorrectPage);
			with (document.forms[0])
			{
				selectedPageNo.value = "";
				selectedPageNo.focus();
			}
			return false;
		}
	}
	var intPageNo = parseInt(strPageNo, 10);
	if (intPageNo == parseInt(document.forms[0].PageNo.value, 10))
		return false;
	else if (intPageNo >= 1 && intPageNo <= intLastPageNo)
	{
		with (document.forms[0])
		{
			PageNo.value = intPageNo;
			target = self.name;
			action = strActionASPName;
			return true;
		}
	}
	else
	{
		alert(lngOutOfRangePage);
		with (document.forms[0])
		{
			selectedPageNo.value = "";
			selectedPageNo.focus();
		}
		return false;
	}
}

