function initialize() {
	document.write("This form requires Netscape Navigator 3.0.")
}

function  doMath() {

var grandTot=0;

var one=new Array(13);
var two=new Array(13);
var prod=new Array(13);
one[1] = document.form1.BFPpric.value;
two[1] = document.form1.BFPquantity.value;
one[2] = document.form1.BFTTpric.value;
two[2] = document.form1.BFTTquantity.value;
one[3] = document.form1.GPpric.value;
two[3] = document.form1.GPquantity.value;
one[4] = document.form1.OBPpric.value;
two[4] = document.form1.OBPquantity.value;
one[5] = document.form1.OBTTpric.value;
two[5] = document.form1.OBTTquantity.value;
one[6] = document.form1.PPpric.value;
two[6] = document.form1.PPquantity.value;
one[7] = document.form1.PTTpric.value;
two[7] = document.form1.PTTquantity.value;
one[8] = document.form1.FPpric.value;
two[8] = document.form1.FPquantity.value;
one[9] = document.form1.FTTpric.value;
two[9] = document.form1.FTTquantity.value;
one[10] = document.form1.WPpric.value;
two[10] = document.form1.WPquantity.value;
one[11] = document.form1.WTTpric.value;
two[11] = document.form1.WTTquantity.value;
one[12] = document.form1.RGPpric.value;
two[12] = document.form1.RGPquantity.value;
one[13]= document.form1.RGTTpric.value;
two[13] = document.form1.RGTTquantity.value;


for (var i = 1; i < 14; i++) {

prod[i] = one[i]  *   two[i];
grandTot += prod[i];
//subTotal += (form.Total[i].value != "") ? parseFloat(form.Total[i].value) : 0
}

//var grandTot = parsefloat(prod[1]) + parsefloat(prod[2] + parsefloat(prod[3] + parsefloat(prod[4] + parsefloat(prod[5] + prod[6] + prod[7] + prod[8] + prod[9] + prod[10] + prod[11] + prod[12] + prod[13]); 
if (grandTot > 0) {
document.form1.grandTotal.value= formatNum(grandTot,2)
	} else {
		document.form1.grandTotal.value = ""
	}

if (document.form1.checkbox.checked ) {
	       tax=.07 * grandTot
           document.form1.salestax.value=formatNum(tax,2)
} else {
	tax=0
	document.form1.salestax.value=""
}
totalenclosed = grandTot+tax 

if (totalenclosed > 0) {
document.form1.totalenclosed.value= formatNum(totalenclosed,2)
	} else {
		document.form1.totalenclosed.value = ""
	}

if (prod[1] > 0) {
document.form1.BFPtotal.value=formatNum(prod[1],2)
		 } else {
			 document.form1.BFPtotal.value=""
		 }
if (prod[2] > 0) {
document.form1.BFTTtotal.value=formatNum(prod[2],2)
		  } else {
			  document.form1.BFTTtotal.value=""
		  }
if (prod[3] > 0 ){
document.form1.GPtotal.value=formatNum(prod[3],2)
		  } else {
				document.form1.GPtotal.value=""
		  }
if (prod[4] > 0) {
document.form1.OBPtotal.value=formatNum(prod[4],2)
		  } else {
document.form1.OBPtotal.value=""
		  }
if (prod[5] > 0 ){
document.form1.OBTTtotal.value=formatNum(prod[5],2);
		  } else {
document.form1.OBTTtotal.value=""
		  }
if (prod[6] > 0 ){
document.form1.PPtotal.value=formatNum(prod[6],2);
		  } else {
document.form1.PPtotal.value=""
		  }
if (prod[7] > 0){
document.form1.PTTtotal.value=formatNum(prod[7],2);
		  } else {
document.form1.PTTtotal.value=""
		  }
if (prod[8] > 0) {
document.form1.FPtotal.value=formatNum(prod[8],2);
		  } else {
document.form1.FPtotal.value=""
		  }
if (prod[9] > 0) {
document.form1.FTTtotal.value=formatNum(prod[9],2);
		  } else {
document.form1.FTTtotal.value=""
		  }
if (prod[10] > 0 ){
document.form1.WPtotal.value=formatNum(prod[10],2);
		  } else {
document.form1.WPtotal.value=""
		  }
if (prod[11] > 0) {
document.form1.WTTtotal.value=formatNum(prod[11],2);
		  } else {
document.form1.WTTtotal.value=""
		  }
if (prod[12] > 0) {
document.form1.RGPtotal.value=formatNum(prod[12],2);
		  } else {
document.form1.RGPtotal.value=""
		  }
if (prod[13] > 0 ){
document.form1.RGTTtotal.value=formatNum(prod[13],2);
		  } else {
			  document.form1.RGTTtotal.value=""
		  }
}
//var quanDisc = prod * -.05;
//var Total = prod + quanDisc + shiptot;
//var OneTot = prod + shiptot;
//var formatTot = numberFormat(Total);
//	if (formatTot == '   $ ' + 99.91){
//		Total = 99.90
//	}
//	if (two > 1){
//		document.form1.quantitydiscount.value=numberFormat(quanDisc);
//		document.form1.shipamt.value=numberFormat(shiptot);
//		document.form1.moprice.value=numberFormat(Total);
//		}else{
//			document.form1.quantitydiscount.value="";
//			document.form1.shipamt.value=numberFormat(shiptot);
//			document.form1.moprice.value=numberFormat(OneTot);
//		}





function custRound(x,places) {
return (Math.round(x*Math.pow(10,places)))/Math.pow(10,places)
}
function calculate(that) {
   if (document.form1.moquantity.value > 1) {
		subtotal == numberFormat(document.form1.moquantity.value * 395); 
		//return formobj.subtotal
		document.form1.textfield2(subtotal);
		document.form1.textfield2.close();
		
    } else {
	return }
}
// Round all passed numbers to two 
// decimal places (hundredths place)
function round(number,decPlace) {
	decPlace = (!decPlace ? 2 : decPlace);
	return Math.round(number * Math.pow(10,decPlace)) / Math.pow(10,decPlace);
	}

// Ensure that each number printed as a string 
// is in 0.00 format
function numberFormat(amount) {
	var rawNumStr = round(amount) + '';
	rawNumStr = (rawNumStr.charAt(0) == '.' ? '0' + rawNumStr : rawNumStr);
	if (rawNumStr.charAt(rawNumStr.length - 3) == '.') {
		return '   $ ' + rawNumStr
		}
	else if (rawNumStr.charAt(rawNumStr.length - 2) == '.') {
		return '   $ ' + rawNumStr + '0';
		}
	else { return '   $ ' + rawNumStr + '.00'; }
	}

function formatNum(expr,decplaces) {
	var str = (Math.round(parseFloat(expr) * Math.pow(10,decplaces))).toString()
	while (str.length <= decplaces) {
		str = "0" + str
	} 
	var decpoint = str.length - decplaces
	return str.substring(0,decpoint) + "." + str.substring(decpoint,str.length)
}


function checkForm(that)
{
  if ((document.form1.name.value == "") || (document.form1.name.value == null))
  {
    alert("Do not press Enter until you are ready to send the form. Please enter your Name in the \"Name\" field.");
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZ.abcdefghijklmnopqrstuvwxyzfSOsoYÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ \t\r\n\f";
  var checkStr = document.form1.name.value;
  var allValid = true;
  
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters in the \"Name\" field.");
    document.form1.name.focus();
    return (false);
  }

  if (document.form1.zipcountry.value == "")
  {
    alert("Do not press Enter until you are ready to send the form. Please enter your Zip Code and Country for the \"Zip Code Country\" field.");
    document.form1.zipcountry.focus();
    return (false);
  }
  if (document.form1.citystate.value == "")
  {
    alert("Do not press Enter until you are ready to send the form. Please enter your City and State in the \"City and State\" field.");
    document.form1.citystate.focus();
    return (false);
  }
  if (document.form1.address1.value == "")
  {
    alert("Do not press Enter until you are ready to send the form. Please enter your Street Address for the \"Address 1\" field.");
    document.form1.address1.focus();
    return (false);
  }
  if (document.form1.phone.value == "")
  {
    alert("Do not press Enter until you are ready to send the form. Please enter your Telephone Number for the \"Phone\" field.");
    document.form1.phone.focus();
    return (false);
  }
if (document.form1.totalenclosed.value == "")
  {
    alert("Do not press Enter until you are ready to send the form. Please select at least one item of Jewelry");
    document.form1.BFPtotal.focus();
    return (false);
  }
 if (document.form1.email.value == "")
  {
    alert("Do not press Enter until you are ready to send the form. Please enter your E-Mail address.");
    document.form1.email.focus();
    return (false);
  }
  
return (true);
}


