function calc_se()
{

	var theForm=document.sForm;

  //SAMPLE SIZE
  if (theForm.ssize.value == "")
  {
    alert("Please enter a value for the \"Sample Size\" field.");
    theForm.ssize.focus();
    return (false);
  }

  var checkOK = "0123456789-.,";
  var checkStr = theForm.ssize.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only numeric digits in the \"Sample Size\" field.");
    theForm.ssize.focus();
    return (false);
  }

  if (decPoints > 1)
  {
    alert("Please enter a valid number in the \"Sample Size\" field.");
    theForm.ssize.focus();
    return (false);
  }

  var chkVal = allNum;
  var prsVal = parseFloat(allNum);
  if (chkVal != "" && !(prsVal > "0"))
  {
    alert("Please enter a value greater than \"0\" in the \"Sample Size\" field.");
    theForm.ssize.focus();
    return (false);
  }
  var numSSize = prsVal

  
  //SAMPLE VARIATION
  if (theForm.svalue.value == "")
  {
    alert("Please enter a value for the \"Sample Variation\" field.");
    theForm.svalue.focus();
    return (false);
  }

  checkOK = "0123456789-.,";
  checkStr = theForm.svalue.value;
  allValid = true;
  decPoints = 0;
  allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only numeric digits in the \"Sample Variation\" field.");
    theForm.svalue.focus();
    return (false);
  }

  if (decPoints > 1)
  {
    alert("Please enter a valid number in the \"Sample Variation\" field.");
    theForm.svalue.focus();
    return (false);
  }
  
  chkVal = allNum;
  prsVal = parseFloat(allNum);
  if (chkVal != "" && !(prsVal > "0" && prsVal < "100"))
  {
    alert("Please enter a value greater than \"0\" and less than \"100\" in the \"Sample Variation\" field.");
    theForm.svalue.focus();
    return (false);
  }
  var numSValue = prsVal



  //TOTAL POPULATION
  if (theForm.suniverse.value == "")
  {
     var numSUniverse = -1
  }
  else 
	{

	  checkOK = "0123456789-.,";
	  checkStr = theForm.suniverse.value;
	  allValid = true;
	  decPoints = 0;
	  allNum = "";
	  for (i = 0;  i < checkStr.length;  i++)
	  {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		  if (ch == checkOK.charAt(j))
			break;
		if (j == checkOK.length)
		{
		  allValid = false;
		  break;
		}
		if (ch == ".")
		{
		  allNum += ".";
		  decPoints++;
		}
		else if (ch != ",")
		  allNum += ch;
	  }
	  if (!allValid)
	  {
		alert("Please enter only numeric digits in the \"Total Population\" field.");
		theForm.suniverse.focus();
		return (false);
	  }

	  if (decPoints > 1)
	  {
		alert("Please enter a valid number in the \"Total Population\" field.");
		theForm.suniverse.focus();
		return (false);
	  }
  
	  chkVal = allNum;
	  prsVal = parseFloat(allNum);
	  if (chkVal != "" && !(prsVal > "0"))
	  {
		alert("Please enter a value greater than \"0\" in the \"Total Population\" field.");
		theForm.suniverse.focus();
		return (false);
	  }

	  if (chkVal != "" && !(prsVal >= numSSize))
	  {
		alert("The \"Sample Size\" must be less than or equal the value in the \"Total Population\" field.");
		theForm.suniverse.focus();
		return (false);
	  }
	  var numTUniverse = prsVal
	}

	
	//CALCULATE SAMPLING ERROR
	var numSError = (theForm.alpha.options[theForm.alpha.selectedIndex].value * Math.sqrt((numSValue / 100) * (1 - (numSValue / 100)))) / Math.sqrt(numSSize)

	if (numTUniverse > 0 && numTUniverse >= numSSize)
	{
		numSError = numSError * Math.sqrt((numTUniverse - numSSize) / (numTUniverse - 1))
	}

	theForm.serror.value = (Math.round(numSError * 1000) / 10) + "%"

	return (false);
}