
function toDecimal2(number){ 
var number = Math.round(number*100).toString();
number = number.substring(0,number.length-2)+'.'+
number.substring(number.length-2,number.length);
if(number == 0){ number = '0.00' };
return number;
}
	
function totalpricereg(form) {	
var a = parseFloat(form.tf_num_total.value, 10);
var b = parseFloat(form.sb_num_sat_1_total.value, 10);
var c = parseFloat(form.sb_num_sat_2_total.value, 10);
var d = parseFloat(form.sb_num_sun_1_total.value, 10);
var e = parseFloat(form.sb_num_sun_2_total.value, 10);
var f = parseFloat(form.hb_num_sat_1_total.value, 10);
var g = parseFloat(form.hb_num_sat_2_total.value, 10);
var h = parseFloat(form.hb_num_sun_1_total.value, 10);
var i = parseFloat(form.hb_num_sun_2_total.value, 10);
var j = parseFloat(form.bt_num_sat_1_total.value, 10);
var k = parseFloat(form.bt_num_sat_2_total.value, 10);
var l = parseFloat(form.bt_num_sun_1_total.value, 10);
var m = parseFloat(form.bt_num_sun_2_total.value, 10);
var n = parseFloat(form.re_num_sat_1_total.value, 10);
var o = parseFloat(form.re_num_sun_1_total.value, 10);

TotalPrice = (a + b + c + d + e + f + g + h + i + j + k + l + m + n + o) ;
  form.amount.value = toDecimal2(TotalPrice);	

}


// Copyright information must stay intact
// FormCheck v1.10
// Copyright NavSurf.com 2002, all rights reserved
// Creative Solutions for JavaScript navigation menus, scrollers and web widgets
// Affordable Services in JavaScript consulting, customization and trouble-shooting
// Visit NavSurf.com at http://navsurf.com

function formCheck(formobj){
	// name of mandatory fields
	var fieldRequired = Array("contactname", "phone", "email", "address", "city", "state", "zip", "amount");
	// field description to appear in the dialog box
	var fieldDescription = Array("Contact Name", "Phone", "Email", "Street Address", "City", "State", "Zip", "Total Amount Due");
	// dialog message
	var alertMsg = "Please complete the following fields:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			if (obj.type == null){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				continue;
			}

			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}
