<!--

function chgPrice(field, form, id) {

	// check to find out how much the price should change by
	switch (field.value) {
		
		case "None":
			var price = 0;
			break;
		case "Home":
			var price = form.stn.value;
			break;
		case "Business Professional":
			var price = form.pro.value;
			break;
	}

	// find the systems base price
	var newPrice = parseFloat(form.base.value) + parseFloat(price);

	// Find the new price
	newPrice = decimal(2, newPrice);

	// Update the total price
	//form.total.value = newPrice;
	writeLayer('pricetag'+id, newPrice)
}


function decimal(num, val) {
   var num = parseInt(num);
   // make a multiplier based on the num (to round down if too many decimal points)
   var multiplier = "1";
   for (var i=1; i<=num; i++) {
      multiplier = multiplier + "0";
   }
   // round it to the proper number of significant places
   var newVal = Math.round(parseFloat(val) * parseFloat(multiplier))/parseFloat(multiplier);
   var string = "" + newVal;
   // find out where the decimal place is
   var curDecLocal = string.indexOf(".");
   // find out how many decimal places now
   var curNumDeci = string.length - curDecLocal - 1;
   if (curDecLocal == -1) { // there is no decimal point
      string = string + ".";
      curNumDeci = 0;
   }
   if (curNumDeci < num) {
      // append the correct number of 0s.
      for (var i=curNumDeci; i<num; i++) {
         string = string + "0";
      }
   }
   if (num == 0) { //get rid of the decimal place
      string = string.substring(0,string.length - 1);
   }
   return(string);
}

//-->