var Result=0;
var Operator=0;
var Second=0;
var Ready=0;
var Done=1;
var Complete=0;
var Integer;
var CurrentValue;

function switchCalc(obj) {
	var el = document.getElementById(obj);
	imgout=new Image(9,9);
	imgin=new Image(9,9);
	imgout.src="/images/calc_open.gif";
	imgin.src="/images/calc_close.gif";

	function filter(imagename,objectsrc){
		if (document.images){
			testval = eval(objectsrc+".src");
			document.images[imagename].src=eval(objectsrc+".src");
		}
	}
	
	if ( el.style.display != 'none' ) {
		el.style.display = 'none';
		filter(("img"+obj),'imgout');
		document.getElementById(obj).style.display = 'none';
	}
	else {
		el.style.display = '';
		document.getElementById(obj).style.display = 'block';
		filter(("img"+obj),'imgin');
	}
}

function getinput(func) {
		var a = document.calculator.total;
        var b = document.calculator.memory1;
        var c = document.calculator.memory2;

        if (document.calculator.mode[0].checked) {
                var mode = 1 //screen prompts help mode
        } else {
                var mode = 0 //no prompts mode
        }

        if (func==power) {
                return power(mode, a)
        }

        if (func==equa) {
                return equa(mode)
        }

        if (func==xpower) {
             return xpower(mode, a)
        }

        if (func==percentage) {
                return percentage(mode, a)
        }
		window.alert("try here in cropcalc.js");
        if (func==cubed) {
                return cubed(mode, a)
        }

        if (func==squared) {
                return squared(mode, a)
        }

        if (func=="mem1") {
               return mem(mode, a, b)
        }

        if (func=="mem2") {
                return mem(mode, a, c)
        }

        if (func=="rcl1") {
                return rcl(mode, b, a)
        }

        if (func=="rcl2") {
                return rcl(mode, c, a)
        }

        if (func==logarithm) {
               return logarithm(mode, a)
        }

        if (func==sine) {
                return sine(mode, a)
        }

        if (func==cosine) {
                return cosine(mode, a)
        }

        if (func==tangent) {
                return tangent(mode, a)
        }

        if (func==squareroot) {
                return squareroot(mode, a)
        }

        if (func==fractions) {
                return fractions(mode, a)
        }

        if (func==negpos) {
                return negpos(mode, a)
        }

        if (func==mc) {
                return mc(mode, b, c)
        }

        if (func==scinot) {
                return scinot(mode, a)
        }

        if (func==noscin) {
                return noscin(mode, a)
        }
}
//end of variables assignment
//evaluate the value in the total display window

function calc(obj, objw) {
        if (objw.value=="") {
                objw.value=''
        }
        objw.value = eval(obj.value)
}

//add more characters to the total display window
function more(obj, where) {
        if (where.value=="" || where.value=="0") {
                where.value = obj
        } else {
                where.value += obj
        }

}

//clear the total display window value and start with this new character
function calculateit(obj, where) {
        where.value = obj
}

//clear the value
function cleart(obj) {
        obj.value = '0'
}

//backspace
function less(obj) {
        obj.value = obj.value.substring(0, obj.value.length - 1)
 }

//powers to any given number
function power(mode, obj) {
        if (mode==1) {
                alert("Power allows application of powers to any given number.")
        }
        if (obj.value!="" && obj.value!="0") {
                aa = prompt("Do you want to use the number in the total display window as the base number?", "y or n");
                if (aa=="y") {
                        a = obj.value
                } else {
                        a = prompt("Enter a base number:", "")
                }
                b = prompt("Enter an exponent:", "");
                if (aa=="y") {
                        calculateit(Math.pow(a, b), obj)
                } else {
                        more('(' + Math.pow(a, b) + ')', obj)
                }
       } else {
                a = prompt("Enter a base:", "");
                b = prompt("Enter an exponent:", "");
                calculateit(Math.pow(a, b), obj)
       }
}

//solve for unknown variable ("x") in any given expression
function equa(mode) {
        if (mode==1) {
                alert("Equation\+ is a utility that will solve for \"x\" in any expression. Example: 5*x=10, it will alert you this result, x=2. However, you must express exactly what you want. Operation is what property of math you will be using. In particular, addition, subtraction, division, or multiplication. Use these characters as operators: *=multiplication, /=division, \+=addition, and -=subtraction.")
        }

        a = prompt("What operation will you be using? Choices: \/, *, +, or -", "");
        if (a=="/") {
                f = prompt("Is \"x\" being divided?", "y or n")
                if (f=="y") {
                        b = prompt("\"x\" is being divided by what?", ""); 
                        c = prompt("And what is the answer?", "");
                        d = c*b;
               } else {
                        b = prompt("What number is being divided by \"x\"?", "");
                        c = prompt("And what is the answer?", "");
                        d = b/c;
               }
        }
        if (a=="*") {
                b = prompt("What is being multiplied by \"x\"?", "");
                c = prompt("And what is the answer?", "");
                d = c/b;
        }
        if (a=="+") {
                b = prompt("What is being added to \"x\"?", "");
                c = prompt("And what is the answer?", "");
                d = c-b
        }
        if (a=="-") {
                f = prompt("Is \"x\" being subtracted?", "y or n")
                if (f=="y") {
                        b = prompt("\"x\" is being subtracted from what?", ""); 
                        c = prompt("And what is the answer?", "");
                        d = b-c
                } else {
                        b = prompt("What number is being subtracted from \"x\"?", "");
                        c = prompt("And what is the answer?", "");
                        d = (b*1)+(c*1)
                }
        }
        if (a=="") {
                d = 0
        }
        alert("x = "+d+"")
}

//multiply any number, by any number, any number of times
function xpower(mode, obj) {
        if (mode==1) {
                alert("XPower is a utility that allows multiplication of a number by another number, any number of times. It is similar to powers, except that in powers, a number is multiplied by itself any number of times. This function allows multiplication of any number, by any number, any number of times.")
        }
       if (obj.value!="" && obj.value!="0") {
                aa = prompt("Do you want to use the number in the total display window as the first number?", "y or n") 
                if (aa=="y") {
                        a = obj.value
                } else {
                        a = prompt("A number please as the first number:", "")
                }
                b = prompt("And you want to multiply the number by what number?", "");
                c = prompt("And how many times will you being multiplying the first by the second?", "");
                d = Math.pow(b,c);
                if (aa=="y") {
                        calculateit(a*d, obj)
                } else {
                        more('(' + a*d + ')', obj)
                }

        } else {
                a = prompt("A number please as the first number:", "");
                b = prompt("And you want to multiply the number by what number?", "");
                c = prompt("And how many times will you being multiplying the first by the second?", "");
                d = Math.pow(b,c);
                calculateit(a*d, obj)
        }
}

//cube any given number
function cubed(mode, obj) {
        if (mode==1) {
                alert("Cubed allows any given number to be cubed.")
        }
        if (obj.value!="" && obj.value!="0") {
                aa = prompt("Do you want to cube the current number in the total display window?", "y or n");
                if (aa=="y") {
                        calculateit(Math.pow(obj.value, 3), obj)
                } else {
                        a = prompt("Enter a number to cube:", "");
                        more('(' + Math.pow(a, 3) + ')', obj)
                }
       } else {
                a = prompt("Enter a number to cube:", "");
                calculateit(Math.pow(a, 3), obj)
        }
}

//square any given number
function squared(mode, obj) {
        if (mode==1) {
                alert("Squared allows any given number to be squared.")
        }
        if (obj.value!="" && obj.value!="0") {
                aa = prompt("Do you want to square the current number in the total display window?", "y or n");
                if (aa=="y") {
                        calculateit(Math.pow(obj.value, 2), obj)
               } else {
                        a = prompt("Enter a number to be squared:", "");
                        more('(' + Math.pow(a, 2) + ')', obj)
               }
        } else {
                a = prompt("Enter a number to square:", "");
                calculateit(Math.pow(a, 2), obj)
        }
}

//store any number in memory
function mem(mode, obj, where) {
        if (mode==1) {
                alert("Pressing the memory button allows retention of the current number in the total display window for later use. You can recall the remembered number by pressing the R1 or R2 button. Memory registers can store simple formulae also. Example: 5*4*8*2 can be stored in either memory.")
        }
        where.value = obj.value
}

//recall any numbers in memory
function rcl(mode, obj, where) {

        if (mode==1) {
                alert("R1 and R2 are interactive functions that work with memory. Each recalls and returns the number saved in the corresponding memory, M1 or M2. Memory registers can store simple formulae also. Example: 5*4*8*2 can be stored in either memory.")
        }
        if (obj.value=="") {
                more('', where)
        } else {
                more('(' + obj.value + ')', where)
        }
}

//find the logarithm of any given number
function logarithm(mode, obj) {

        if (mode==1) {
                alert("This function returns the natural logarithm of any given number")
        }
        if (obj.value!="" && obj.value!="0") {
                aa = prompt("Do you want to find the logarithm of the number in the total display window?", "y or n");
                if (aa=="y") {
                        calculateit(Math.log(obj.value), obj)
                } else {
                        a = prompt("Enter a number to find the logarithm of:", "");
                        more('(' + Math.log(a) + ')', obj)
                }
        } else {
                a = prompt("Enter a number to find the logarithm of:", "");
                calculateit(Math.log(a), obj)
        }
}

//find the sine of any given number

function sine(mode, obj) {
        if (mode==1) {
                alert("This function returns the sine of any given number")
        }
        if (obj.value!="" && obj.value!="0") {
                aa = prompt("Do you want to find the sine of the number in the total display window?", "y or n");
                if (aa=="y") {
                        calculateit(Math.sin(obj.value), obj)
                } else {
                        a = prompt("Enter a number to find the sine of:", "");
                        more('(' + Math.sin(a) + ')', obj)
                }
       } else {
                a = prompt("Enter a number to find the sine of:", "");
                calculateit(Math.sin(a), obj)
        }
}

//find the cosine of any given number
function cosine(mode, obj) {
        if (mode==1) {
                alert("This function returns the cosine of any given number")
        }

        if (obj.value!="" && obj.value!="0") {
                aa = prompt("Do you want to find the cosine of the number in the total display window?", "y or n");
                if (aa=="y") {
                        calculateit(Math.cos(obj.value), obj)
                } else {
                        a = prompt("Enter a number to find the cosine of:", "");
                        more('(' + Math.cos(a) + ')', obj)
                }

        } else {
                a = prompt("Enter a number to find the cosine of:", "");
                calculateit(Math.cos(a), obj)
        }
}

//find the tangent of any given number

function tangent(mode, obj) {
        if (mode==1) {
                alert("This function returns the tangent of any given number")
        }
        if (obj.value!="" && obj.value!="0") {
                aa = prompt("Do you want to find the tangent of the number in the total display window?", "y or n");
                if (aa=="y") {
                        calculateit(Math.tan(obj.value), obj)
               } else {
                        a = prompt("Enter a number to find the tangent of:", "");
                        more('(' + Math.tan(a) + ')', obj)
               }
       } else {
                a = prompt("Enter a number to find the tangent of:", "");
                calculateit(Math.tan(a), obj)
        }
}

//find the square root of any given number
function squareroot(mode, obj) {
        if (mode==1) {
                alert("This function gives you the square root of any given number")
        }
        if (obj.value!="" && obj.value!="0") {
                aa = prompt("Do you want to find the square root of the current number in the total text box?", "y or n");
                if (aa=="y") {
                        calculateit(Math.sqrt(obj.value), obj)
                } else {
                        a = prompt("Enter a number to find the square root of:", "");
                        more('(' + Math.sqrt(a) + ')', obj)
                }
       } else {
                a = prompt("Enter a number to find the square root of:", "");
                calculateit(Math.sqrt(a), obj)
        }
}

//fractions manipulation

function fractions(mode, obj) {
        if (mode==1) {
                alert("Fraction is a utility function that allows input of fractions. The script will convert the fraction input into an understandable and usable decimal. Proper input is required. In the fraction 5 and 3/4, 5 is the base, the 3 is the numerator, and 4 is the denominator. If there is no base number, leave the prompt box that asks for a base empty. Without a base you can just do simple fractions such as 3/4 when prompted.")
        }
        if (obj.value!="" && obj.value!="0") {
                aa = prompt("Do you want to use the number in the total display window as the base?", "y or n");
                if (aa=="y") {
                       a = obj.value
                } else {
                        a = prompt("Enter a base:", "");
                }
                b = prompt("Enter a numerator:", "");
                c = prompt("Enter a denominator", "");
                d = b/c;
                e = (d*1)+(a*1);
                if (aa=="y") {
                        calculateit(e, obj)
                } else {
                        more('(' + e + ')', obj)
                }
       } else {
                a = prompt("Enter a base:", "");
                b = prompt("Enter a numerator:", "");
                c = prompt("Enter a denominator:", "");
                d = b/c;
                e = (d*1)+(a*1);
                calculateit(e, obj)
       }

        if (e=="nullNaN") {
                more("", obj)
        }
        if (e=="NaN") {
                more("", obj)
        }
}

//yield a percentage to the answer
function percentage(mode, obj) {
        if (mode==1) {
                alert("% allows multiplication by .01 to the answer in the display window, converting any number to a percentage. The process is multiplication by .01 (the same as dividing by 100), returning the result in the total display window, applying it to any other value that is already in there.")
        }
        obj.value *= (.01)
}

//change the sign of any given number, negation
function negpos(mode, obj) {
        if (mode==1) {
                alert("+/- allows negation, converting a negative(-) number to a positive(+) and a positive number to a negative. The process is multiplication by -1, returning the result in the total display window, applying it to any other value that is already in there.")
        }
        obj.value *= (-1)
}

//clear any numbers in memory
function mc(mode, obj1, obj2) {
        if (mode==1) {
                alert("Memory Clear is a simplistic function that sets the values of both memory registers to 0.")
        }
        obj1.value = '';
        obj2.value = ''
}

//convert any number into scientific notation
function scinot(mode, obj) {
        if (mode==1) {
                alert("SCINOT is a utility function that allows you to convert any given number into scientific notation. The format of the answer is as follows: Ex: input:120, output:1.2*10^2, would be 1.2 multiplied by 10 to the second power.")
        }
        if (obj.value!="" && obj.value!="0") {
                aa = prompt("Do you want to convert the current number in the total display window?", "y or n");
                if (aa=="y") {
                        a = obj.value
               } else {
                        a = prompt("Enter a number to convert:", "")
               }       
        } else {
                a = prompt("Enter a number to convert:", "")
        }
        var b = 0;
        while (a>10) {   //divide by ten until variable is no longer greater than 10
                a /= 10;
                b += 1
        }
        calculateit(a + '*10^' + b, obj)
}

//convert any number out of scientific notation to standard form
function noscin(mode, obj) {
        if (mode==1) {  
			alert("NOSCIN does the exact opposite utility function of SCINOT. It allows you to input  number in scientific notation and it will output the number in standard notation. Example: input:1.2*10^2, output:120")
        }
        a = prompt("Enter the number that is the decimal:", "");
        b = prompt("Enter the power that is given to 10:", "");
        c = Math.pow(10, b);
        d = a*c;
        if (obj.value!="" && obj.value!="0") {
                e = prompt("Do you want to use this result as a part of another calculation in the total display window?", "y or n");
                if (e=="y") {
                        more('(' + d + ')', obj)
                } else {
                        calculateit(d, obj)
                }
        } else {
                calculateit(d, obj)
        }
}

function helpround() {
        if (document.calculator.mode[0].checked) {
                alert("Round is a simplistic function that simply rounds the number in the total display window to the nearest whole integer number. 1/2 or greater rounds up, smaller than 1/2 rounds down.")
        }
}

function helppi () {
        if (document.calculator.mode[0].checked) {
                alert("PI is a simplistic function that returns PI to the capability of the browser. 3.14......")
        }
}

function clearForm(formName) 
{ 
  var form, elements, i, elm; 
  form = document.getElementById 
    ? document.getElementById(formName) 
    : document.forms[formNAme]; 

	if (document.getElementsByTagName)
	{
		elements = form.getElementsByTagName('input');
		for( i=0, elm; elm=elements.item(i++); )
		{
			if (elm.getAttribute('type') == "text" || elm.getAttribute('type') == "hidden")
			{
				elm.value = '';
			}
		}
	}

	// Actually looking through more elements here
	// but the result is the same.
	else
	{
		elements = form.elements;
		for( i=0, elm; elm=elements[i++]; )
		{
			if (elm.type == "text")
			{
				elm.value ='';
			}
		}
	}
}

/*function resetForm(formName) 
{ 
  var form, elements, i, elm; 
  form = document.getElementById 
    ? document.getElementById(formName) 
    : document.forms[formNAme]; 

	if (document.getElementsByTagName)
	{
		elements = form.getElementsByTagName('input');
		for( i=0, elm; elm=elements.item(i++); )
		{
			if (elm.getAttribute('type') == "text" || elm.getAttribute('type') == "hidden")
			{
				elm.value = document.getElementById(elm.id).value;
			}
		}
	}
}*/

function calcChange(initFld, acresFld, formName){
	var fldNum = initFld.substring(1);
	var fldId  = initFld.substr(0,1);
	var fldVal = document.getElementById(initFld).value;
	var acres  = document.getElementById(acresFld).value;
	var altFld = "";
	var aFld = ""; var tFld = ""; var acresT = ""; var acresP = "";
	
	if (formName == 'scn1') {
		aFld = "C45";
		tFld = "C46";
	} else {
		aFld = "S45";
		tFld = "S46";
	}
	
	if (fldId == 'P'){
		altFld = 'T' + fldNum;
		acresT = fldVal * acres;
		document.getElementById(altFld).value = acresT.toFixed(2);
	} else if (fldId == 'T') { //Field ID begins with T for total cost field.
		altFld = 'P' + fldNum;
		acresP = fldVal / acres;
		document.getElementById(altFld).value = acresP.toFixed(2);
	}
		
	sumAcreCosts(formName, aFld, tFld, acresFld);
	calcGross(formName, acresFld);
}

function recalcFlds(acresFld, formName, aFld, tFld) {
	var form, elements, i, elm, fldNum, fldID, iTotVal;
	form = document.getElementById 
    	? document.getElementById(formName) 
    	: document.forms[formNAme];
		
	if (document.getElementsByTagName)
	{
		elements = form.getElementsByTagName('input');
		for( i=0, elm; elm=elements.item(i++); )
		{
			if (elm.getAttribute('type') == "text" && elm.id.substr(0,1) == "P")
			{
				fldNum = elm.id.substring(1);
				if (elm.name == "paDep" || elm.name == "paLand") {
					fldID = 'T' + fldNum;
					iTotVal = (document.getElementById(fldID).value) / (document.getElementById(acresFld).value);
					fldID = 'P' + fldNum;
				} else {
					fldID = 'T' + fldNum;
					iTotVal = (document.getElementById(elm.id).value) * (document.getElementById(acresFld).value);
				}
				document.getElementById(fldID).value = iTotVal.toFixed(2);
			}
		}
	}
	sumAcreCosts(formName, aFld, tFld, acresFld);
	calcGross(formName, acresFld);
}

function sumAcreCosts(formName, aFld, tFld, acres){
	var form, elements, i, elm; 
	var pAcre = 0; var tAcre = 0;
	form = document.getElementById 
    	? document.getElementById(formName) 
    	: document.forms[formNAme];
		
	if (document.getElementsByTagName)
	{
		elements = form.getElementsByTagName('input');
		for( i=0, elm; elm=elements.item(i++); )
		{
			if (elm.getAttribute('type') == "text" && elm.id.substr(0,1) == "P")
			{
				pAcre += eval(document.getElementById(elm.id).value);
			}
		}
	}
	
	document.getElementById(aFld).value = pAcre.toFixed(2);
	var totalAcres = document.getElementById(acres).value;
	var totalCosts = pAcre * totalAcres;
	document.getElementById(tFld).value = totalCosts.toFixed(2);

	calcGross(formName, acres);
}

function calcGross(formName, acresFld) {
	var form, yield, yFld, totBushVal, totBushFld, type, totAcres, expMVFld, gPAcre, gTAcre;
	var expMktVal, G_PerAcre, G_TotAcre, basis, aNetProfit, tNetProfit, totAcreExp;
	form = document.getElementById 
    	? document.getElementById(formName) 
    	: document.forms[formNAme];
	
	if (acresFld == 'A1'){
		type = 'c';
		aExpFld = 'C45';
	} else {
		type = 's';
		aExpFld = 'S45';
	}
	
	yFld = type + 'Y';
	totBushFld = type + 'TB';
	expMVFld = type + 'MV';
	gPAcre = type + 'gpa';
	gTAcre = type + 'gTot';
	basisFld = type + 'Basis';
	nPAcre = type + 'npa';
	nTAcre = type + 'nta';

	yield = eval(document.getElementById(yFld).value);
	totAcres = eval(document.getElementById(acresFld).value);
	
	expMktVal = eval(document.getElementById(expMVFld).value);
	basis = eval(document.getElementById(basisFld).value);
	G_PerAcre = yield * (expMktVal + basis);
	G_TotAcre = G_PerAcre * totAcres;
	totBush = yield * totAcres;
	totAcreExp = eval(document.getElementById(aExpFld).value);
	aNetProfit = G_PerAcre - totAcreExp;
	tNetProfit = aNetProfit * totAcres;
	
	document.getElementById(totBushFld).value = totBush.toFixed(1);
	document.getElementById(gPAcre).value = G_PerAcre.toFixed(2);
	document.getElementById(gTAcre).value = G_TotAcre.toFixed(2);
	document.getElementById(nPAcre).value = aNetProfit.toFixed(2);
	document.getElementById(nTAcre).value = tNetProfit.toFixed(2);
	
	calcOptionPrice(formName, 'false');
}

function calcOptionPrice(formName, flag){
	var form, numLongs, longSrike, longVal, totTradeCost;
	var numShorts, shortStrike, shortVal, comm, mktValFld;
	var totOptions, curMktVal, adjMktVal;
	form = document.getElementById 
    	? document.getElementById(formName) 
    	: document.forms[formNAme];
	if (formName == 'scn1'){
		type = 'H';
		mktValFld = 'cMV';
	} else {
		type = 'HS';
		mktValFld = 'sMV';
	}
	
	numLongs = eval(document.getElementById(type+'1').value);
	longStrike = eval(document.getElementById(type+'2').value);
	longVal = eval(document.getElementById(type+'3').value);
	numShorts = eval(document.getElementById(type+'4').value);
	shortStrike = eval(document.getElementById(type+'5').value);
	shortVal = eval(document.getElementById(type+'6').value);
	comm = eval(document.getElementById(type+'7').value);
	curMktVal = eval(document.getElementById(mktValFld).value);
	
	totOptions = eval(numLongs + numShorts);
	totTradeCost = (totOptions * comm) + (numLongs * longVal) - (numShorts * shortVal);
	
	// Need to move decimal for longVal and shortVal
	longStrike = longStrike / 100;
	shortStrike = shortStrike / 100;

	if (longStrike <= curMktVal) {
		adjMktVal = 0;
	} else if (longStrike > curMktVal && shortStrike <= curMktVal) {
		adjMktVal = ((longStrike - curMktVal) * 5000) * numLongs;
	} else {
		adjMktVal = (((longStrike - curMktVal) * 5000) * numLongs) - (((shortStrike - curMktVal) * 5000) * numShorts);
	}
	document.getElementById(type+'8').value = totTradeCost.toFixed(2);
	document.getElementById(type+'9').value = adjMktVal.toFixed(2);
	
	if (flag == "true") {
		window.alert("When changing Strike prices of options, be sure to change the value of the option that corresponds to the updated strike.");
	}
	
	calcNetProfit(formName);
}

function calcNetProfit(formName) {
	var NPAcreFld, NPTotFld, type, NPAcreVal, NPTotVal;
	var type, totCostAcreVal, totCostTotVal, acres;
	var NetAcreVal, NetTotVal, NetAcreFld, NetTotFld;
	var OptCostFld, OptCostVal, OptValue, OptValFld;
	form = document.getElementById 
    	? document.getElementById(formName) 
    	: document.forms[formNAme];
	if (formName == 'scn1'){
		type = 'c';
		OptCostFld = 'H8';
		OptValFld = 'H9';
		acreFld = 'A1';
	} else {
		type = 's';
		OptCostFld = "HS8";
		OptValFld = "HS9";
		acreFld = "A2";
	}
	
	NetTotFld  = type + 'nta';

	NetTotVal  = eval(document.getElementById(NetTotFld).value);
	OptCostVal = eval(document.getElementById(OptCostFld).value);
	acres = eval(document.getElementById(acreFld).value);
	OptValue = eval(document.getElementById(OptValFld).value);
	
	NPAcreFld = type + 'AProf';
	NPTotFld  = type + 'TProf';
	
	NPTotVal  = eval(NetTotVal) - eval(OptCostVal) + eval(OptValue);
	NPAcreVal = NPTotVal / acres;
	
	document.getElementById(NPAcreFld).value = NPAcreVal.toFixed(2);
	document.getElementById(NPTotFld).value  = NPTotVal.toFixed(2);
}
