<!--
function doPrice() {

with(document.myForm)
    {

	if (brixSize.value == 4.5) {brixCost.value = 12;}
	if (brixSize.value == 2.25) {brixCost.value = 16;}
	if (brixSize.value == 2) {brixCost.value = 20;}
    }

  }

function doTotals() {

//with(document.myForm)
//    {
//    //brixQuant.value = projSqft.value * brixSize.value;
//    projTotal.value = Currency(brixCost.value * brixQuant.value);
//    projDon.value = Currency(brixPrice.value * brixQuant.value);
//    projProfit.value = Currency(filterNum(projDon.value) - filterNum(projTotal.value));
//    }

//  }

with(document.myForm)
    {
    //brixQuant.value = projSqft.value * brixSize.value;
    projTotal.value = Currency((fourCost.value * fourQuant.value) + (eightCost.value * eightQuant.value));
    projDon.value = Currency((fourPrice.value * fourQuant.value) + (eightPrice.value * eightQuant.value));
    projProfit.value = Currency(filterNum(projDon.value) - filterNum(projTotal.value));
    }

  }

function Currency(anynum) {

        //returns number as string in $xxx,xxx.xx format.
        anynum = "" + eval(anynum)  //evaluate (in case an expression sent)
        intnum = parseInt(anynum)  //isolate integer portion
        intnum = Math.abs(intnum)
        intstr = ""+intnum
        //add comma in thousands place.
        if (intnum >= 1000) {
                intlen = intstr.length
                temp1=parseInt(""+(intnum/1000))
                temp2=intstr.substring(intlen-3,intlen)
                intstr = temp1+","+temp2

        }
        if (intnum >= 1000000) {
                intlen = intstr.length
                temp1=parseInt(""+(intnum/1000000))
                temp2=intstr.substring(intlen-7,intlen)
                intstr = temp1+","+temp2

        }

        decnum = Math.abs(parseFloat(anynum)-parseInt(anynum)) //isolate decimal portion
        decnum = decnum * 100 // multiply decimal portion by 100.
        decstr = "" + Math.abs(Math.round(decnum))
        if (decstr.length>2) {decstr=decstr.substring(0,2)}
        while (decstr.length < 2) {decstr="0"+decstr}
        retval = intstr + "." + decstr 
        if (anynum < 0) {
                retval="("+retval+")"
        }
        return "$"+retval
}

function filterNum(str) {

re = /^\$|,/g;
// remove "$" and ","
return str.replace(re, "");

}
function ShowHide(id, visibility) {
    divs = document.getElementsByTagName("div");
    divs[id].style.visibility = visibility;
}
// -->