// JavaScript Document
	function CalculateVolume()
	{
		//check if data is null
		if (ValidateBlankInput() && ValidateNumericInput())
		{
			//do the calcuation
			document.CalculationForm.ResultTextbox.value = Math.round(
				(document.CalculationForm.WidthTextbox.value * document.CalculationForm.LengthTextbox.value * (document.CalculationForm.ThinknessTextbox.value * 0.0833333333)  * 0.037037037) * 10) / 10;
		}
	}
	
	function ValidateBlankInput()
	{
		if (document.CalculationForm.WidthTextbox.value == "")
		{
			alert("Please enter a value for the width.");
			document.CalculationForm.WidthTextbox.style.backgroundColor = 'yellow';
			document.CalculationForm.WidthTextbox.focus();
			return false;
		}
		else if (document.CalculationForm.LengthTextbox.value == "")
		{
			document.CalculationForm.WidthTextbox.style.backgroundColor = 'white';
			alert("Please enter a value for the length.");
			document.CalculationForm.LengthTextbox.style.backgroundColor = 'yellow';
			document.CalculationForm.LengthTextbox.focus();
			return false;
		}
		else if (document.CalculationForm.ThinknessTextbox.value == "")
		{
			document.CalculationForm.LengthTextbox.style.backgroundColor = 'white';
			alert("Please enter a value for the length.");
			document.CalculationForm.ThinknessTextbox.style.backgroundColor = 'yellow';
			document.CalculationForm.ThinknessTextbox.focus();
			return false;
		}
		
		document.CalculationForm.WidthTextbox.style.backgroundColor = 'white';
		document.CalculationForm.LengthTextbox.style.backgroundColor = 'white';
		document.CalculationForm.ThinknessTextbox.style.backgroundColor = 'white';
		return true;
	}
	
	function ValidateNumericInput()
	{
		if (!IsNumeric(document.CalculationForm.WidthTextbox.value))
		{
			alert("Please enter a numeric value for the width.");
			document.CalculationForm.WidthTextbox.style.backgroundColor = 'yellow';
			document.CalculationForm.WidthTextbox.focus();
			return false;
		}
		else if (!IsNumeric(document.CalculationForm.LengthTextbox.value))
		{
			document.CalculationForm.WidthTextbox.style.backgroundColor = 'white';
			alert("Please enter a numeric value for the length.");
			document.CalculationForm.LengthTextbox.style.backgroundColor = 'yellow';
			document.CalculationForm.LengthTextbox.focus();
			return false;
		}
		else if (!IsNumeric(document.CalculationForm.ThinknessTextbox.value))
		{
			document.CalculationForm.LengthTextbox.style.backgroundColor = 'white';
			alert("Please enter a numeric value for the length.");
			document.CalculationForm.ThinknessTextbox.style.backgroundColor = 'yellow';
			document.CalculationForm.ThinknessTextbox.focus();
			return false;
		}
		
		document.CalculationForm.WidthTextbox.style.backgroundColor = 'white';
		document.CalculationForm.LengthTextbox.style.backgroundColor = 'white';
		document.CalculationForm.ThinknessTextbox.style.backgroundColor = 'white';
		return true;
	}
	
	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;
	}
