function calculate() {	
    // Get the user's input from the form. Assume it is all valid
	if (document.priceCalculation.width.value == ""){
		alert("Please enter a width");
		}
	else if (IsNumeric(document.priceCalculation.width.value) == false) {
      	alert("Please check - Width is a non numeric value!");
      	}
	else if (document.priceCalculation.height.value == ""){
		alert("Please enter a height");
		}
	else if (IsNumeric(document.priceCalculation.height.value) == false) {
      	alert("Please check - Height is a non numeric value!");
      	}
	else {
    	var height = document.priceCalculation.height.value;
    	var width = document.priceCalculation.width.value;
    	var size = (height*width);
	
    	// Now compute all quotes.
		document.priceCalculation.a.value = formatCurrency((size/1000000)*355);
		document.priceCalculation.b.value = formatCurrency((size/1000000)*330);
		document.priceCalculation.c.value = formatCurrency((size/1000000)*295);
		document.priceCalculation.d.value = formatCurrency((size/1000000)*265);
		document.priceCalculation.e.value = formatCurrency((size/1000000)*205);
		}

		// This simple method rounds a number to two decimal places
		function formatCurrency(num) {
    	num = isNaN(num) || num === '' || num === null ? 0.00 : num;
    	return parseFloat(num).toFixed(2);
		}
		
		function IsNumeric(strString)
		   //  check for valid numeric strings	
		   {
		   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;
		   }
		
		  // -->
}
