

function swapDiv(origDiv, newDiv)
{
	var nDiv = document.getElementById(newDiv);
	nDiv.style.display = 'block';
	nDiv.style.visibility = 'visible';

	var oDiv = document.getElementById(origDiv);
	oDiv.style.display = 'none';
	oDiv.style.visibility = 'hidden';
}

function toggleVisibility(id, linkID)
{
	var myDiv = document.getElementById(id);
	var myLink = document.getElementById(linkID);
	if (myDiv.style.display == 'none'){
		myDiv.style.display		= 'block';
		myDiv.style.visibility	= 'visible';
		myLink.innerHTML		= '[-] Show Fewer';
	} else {
		myDiv.style.display		= 'none';
		myDiv.style.visibility	= 'hidden';
		myLink.innerHTML		= '[+] Show All';
	}
}

function verifyPage(pageLimit, myForm)
{
	var pageValue = myForm.pg.value;
	var isValidValue = false;

	if ((pageValue.length > 0) && (pageValue <= pageLimit) && (pageValue > 0) && IsNumeric(pageValue))
		isValidValue = true;
	if (isValidValue == false)
		alert('Please choose a page between 1 and ' + pageLimit + ".");
	return isValidValue;
}

function IsNumeric(strString)
{
   var strValidChars = "0123456789";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
}