function calculate() {
    // Get the user's input from the form. Assume it is all valid.
    var quantity = document.prodDetailOrder.quantity.value;
	var prodCost = document.prodDetailOrder.prodCost.value;
	
	// compute the cost
	var totalCost = round((prodCost*quantity));

    // Check that the result is a finite number. If so, display the results
    if (!isNaN(totalCost) && 
        (totalCost != Number.POSITIVE_INFINITY) &&
        (totalCost != Number.NEGATIVE_INFINITY)) {

        document.prodDetailOrder.displayCost.value = totalCost;
    }
    // Otherwise, the user's input was probably invalid, so don't
    // display anything.
    else {
        document.prodDetailOrder.cost.value = "";
    }
}

// This simple method rounds a number to two decimal places.
function round(x) {
	var num = Math.round(x*100)/100;
	var result = num.toFixed(2);
	return result;
}

function clearSKU() {
	document.skuSearch.sku.value = "";
}
