<html>
<head>
<title>calculate</title>
<script language="javascript">
function calculate(operator) {
var var1 = frmcal.var1.value;
var var2 = frmcal.var2.value;
if (operator=='+') {
var result = parseFloat(var1) + parseFloat(var2);
}
if (operator=='-') {
var result = parseFloat(var1) - parseFloat(var2);
}
if (operator=='*') {
var result = parseFloat(var1) * parseFloat(var2);
}
if (operator=='/') {
var result = parseFloat(var1) / parseFloat(var2);
}
frmcal.result.value = result;
return false;
}
</script>
</head>