function fnChangeOrder( psrtNewOrder )
{
	document.forms["mainForm"].elements["OrderList"].value	= psrtNewOrder;
	document.forms["mainForm"].elements["Page"].value		= 1;
	document.forms["mainForm"].submit();
}

function fnChangeDirection()
{
	document.forms["mainForm"].elements["DirectionList"].value	= ( document.forms["mainForm"].elements["DirectionList"].value == "ASC" ) ? "DESC" : "ASC";
	document.forms["mainForm"].elements["Page"].value			= 1;
	document.forms["mainForm"].submit();
}

function fnGoToPage( pintLastPage, pintValue )
{
	pintValue = Number ( isNull ( pintValue, -1 ) );
	
	var intPageToGo = 0;
	
	if ( pintValue == -1 )
	{
		intPageToGo = Number ( document.forms["mainForm"].elements["PageToGo"].value );
		
		if ( isNaN ( intPageToGo ) || ( intPageToGo < 1 ) || ( intPageToGo > pintLastPage ) )
		{
			alert("Attenzione!\nInserire un numero di pagina corretto.");
			document.forms["mainForm"].elements["PageToGo"].select();
		}
		else
		{
			document.forms["mainForm"].elements["Page"].value = document.forms["mainForm"].elements["PageToGo"].value;
			document.forms["mainForm"].submit();
		}
	}
	else
	{
		intPageToGo = pintValue;
		document.forms["mainForm"].elements["Page"].value = intPageToGo;
		document.forms["mainForm"].submit();
	}
}