﻿ function calcBalance2() {    if(document.form1.fpiston.value == "") {		alert("Please enter front piston (bare) weight in grams")		document.form1.fpiston.focus()		return false	}    if(document.form1.fpin.value == "") {		alert("Please enter front piston pin weight in grams")		document.form1.fpin.focus()		return false	}	if(document.form1.fclip.value == "") {		alert("Please enter front piston pin clips weight in grams")		document.form1.fclip.focus()		return false	}	if(document.form1.fbutton.value == "") {		alert("Please enter front piston buttons weight in grams")		document.form1.fbutton.focus()		return false	}	if(document.form1.ftopring.value == "") {		alert("Please enter front piston top ring weight in grams")		document.form1.ftopring.focus()		return false	}	if(document.form1.f2ring.value == "") {		alert("Please enter front piston 2nd ring weight in grams")		document.form1.f2ring.focus()		return false	}	if(document.form1.f3ring.value == "") {		alert("Please enter front piston 3rd ring  weight in grams")		document.form1.f3ring.focus()		return false	}	if(document.form1.crankpin.value == "") {		alert("Please enter crankpin  weight in grams")		document.form1.crankpin.focus()		return false	}	if(document.form1.nuts.value == "") {		alert("Please enter crankpin nuts in grams")		document.form1.nuts.focus()		return false	}	if(document.form1.cages.value == "") {		alert("Please enter all three bearing cages weight in grams")		document.form1.cages.focus()		return false	}	if(document.form1.bearings.value == "") {		alert("Please enter all three sets of loose needle bearings weight in grams")		document.form1.bearings.focus()		return false	}	if(document.form1.nutlock.value == "") {		alert("Please enter nutlocks (if any) weight in grams")		document.form1.nutlock.focus()		return false	}	if(document.form1.fsmall.value == "") {		alert("Please enter small end front rod (male) weight in grams")		document.form1.fsmall.focus()		return false	}	if(document.form1.fbig.value == "") {		alert("Please enter big end front rod (male) weight in grams")		document.form1.fbig.focus()		return false	}	if(document.form1.frodweight.value == "") {		alert("Please enter front rod (male) weight in grams")		document.form1.frodweight.focus()		return false	}	if(document.form1.rsmall.value == "") {		alert("Please enter rear rod (male) small end weight in grams")		document.form1.rsmall.focus()		return false	}	if(document.form1.rbig.value == "") {		alert("Please enter rear rod (male) big end weight in grams")		document.form1.rbig.focus()		return false	}	if(document.form1.rrodweight.value == "") {		alert("Please enter rear rod (female) weight in grams")		document.form1.rrodweight.focus()		return false	}	if(document.form1.dbalance.value == "") {		alert("Please enter desired balance factor 55 to 65 (typically 60)")		document.form1.dbalance.focus()		return false	}	if(document.form1.rpiston.value == "") {		alert("Please enter rear piston (bare) weight in grams")		document.form1.rpiston.focus()		return false	}	if(document.form1.rpin.value == "") {		alert("Please enter rear piston pin weight in grams")		document.form1.rpin.focus()		return false	}	if(document.form1.rclip.value == "") {		alert("Please enter piston pin clips weight in grams")		document.form1.rclip.focus()		return false	}	if(document.form1.rbutton.value == "") {		alert("Please enter buttons (if any) weight in grams")		document.form1.rbutton.focus()		return false	}	if(document.form1.rtopring.value == "") {		alert("Please enter rear piston top ring weight in grams")		document.form1.rtopring.focus()		return false	}	if(document.form1.r2ring.value == "") {		alert("Please enter rear piston 2nd ring weight in grams")		document.form1.r2ring.focus()		return false	}	if(document.form1.r3ring.value == "") {		alert("Please enter rear piston 3rd ring weight in grams")		document.form1.r3ring.focus()		return false	}		    fpistonx = document.form1.fpiston.value * 1    fpinx = document.form1.fpin.value * 1    fclipx = document.form1.fclip.value * 1    fbuttonx = document.form1.fbutton.value * 1    ftopringx = document.form1.ftopring.value * 1    f2ringx = document.form1.f2ring.value * 1    f3ringx = document.form1.f3ring.value * 1    crankpinx = document.form1.crankpin.value * 1    nutsx = document.form1.nuts.value * 1    cagesx = document.form1.cages.value * 1    bearingsx = document.form1.bearings.value * 1    nutlockx = document.form1.nutlock.value * 1    fsmallx = document.form1.fsmall.value * 1    fbigx = document.form1.fbig.value * 1    frodweightx = document.form1.frodweight.value * 1    rsmallx = document.form1.rsmall.value * 1    rbigx = document.form1.rbig.value * 1    rrodweightx = document.form1.rrodweight.value * 1    dbalancex = document.form1.dbalance.value * 1    rpistonx = document.form1.rpiston.value *1    rpinx = document.form1.rpin.value * 1    rclipx = document.form1.rclip.value * 1    rbuttonx = document.form1.rbutton.value * 1    rtopringx = document.form1.rtopring.value *1    r2ringx = document.form1.r2ring.value * 1    r3ringx = document.form1.r3ring.value * 1                                                                    	                                     boxx = fpistonx + fpinx + fclipx + fbuttonx + ftopringx + f2ringx + f3ringx	box1x = rpistonx + rpinx + rclipx + rbuttonx + rtopringx + r2ringx + r3ringx	box2x = crankpinx + nutsx + cagesx + bearingsx + nutlockx	box3x = fsmallx + fbigx	box4x = frodweightx - (fsmallx + fbigx)	box5x =  fsmallx + (box4x / 3)	box6x = frodweightx - box5x	box7x = rsmallx + rbigx	box8x = rrodweightx - box7x	box9x = rsmallx + (box8x / 3)	box10x = rrodweightx - box9x	box11x = boxx + box1x + box9x + box5x	box12x = boxx + box5x	box13x = box1x + box9x	box14x = box2x + box6x + box10x	box15x = box15x = (((dbalancex * box11x) / 100) + box14x) / 2															tempj = Math.round(boxx * 100)	tempj1 = Math.round(box1x * 100)	tempj2 = Math.round(box2x * 100)	tempj3 = Math.round(box3x * 100)	tempj4 = Math.round(box4x * 100)	tempj5 = Math.round(box5x * 100)	tempj6 = Math.round(box6x * 100)	tempj7 = Math.round(box7x * 100)	tempj8 = Math.round(box8x * 100)	tempj9 = Math.round(box9x * 100)	tempj10 = Math.round(box10x * 100)	tempj11 = Math.round(box11x * 100)	tempj12 = Math.round(box12x * 100)	tempj13 = Math.round(box13x * 100)	tempj14 = Math.round(box14x * 100)	tempj15 = Math.round(box15x * 100)														tempk = tempj * .01	tempk1 = tempj1 * .01	tempk2 = tempj2 * .01	tempk3 = tempj3 * .01	tempk4 = tempj4 * .01	tempk5 = tempj5 * .01	tempk6 = tempj6 * .01	tempk7 = tempj7 * .01	tempk8 = tempj8 * .01	tempk9 = tempj9 * .01	tempk10 = tempj10 * .01	tempk11 = tempj11 * .01	tempk12 = tempj12 * .01	tempk13 = tempj13 * .01	tempk14 = tempj14 * .01	tempk15 = tempj15 * .01												daRatio = parseInt(tempk * 100) / 100	daRatio1 = parseInt(tempk1 * 100) / 100	daRatio2 = parseInt(tempk2 * 100) / 100	daRatio3 = parseInt(tempk3 * 100) / 100	daRatio4 = parseInt(tempk4 * 100) / 100	daRatio5 = parseInt(tempk5 * 100) / 100	daRatio6 = parseInt(tempk6 * 100) / 100	daRatio7 = parseInt(tempk7 * 100) / 100	daRatio8 = parseInt(tempk8 * 100) / 100	daRatio9 = parseInt(tempk9 * 100) / 100	daRatio10 = parseInt(tempk10 * 100) / 100 	daRatio11 = parseInt(tempk11 * 100) / 100	daRatio12 = parseInt(tempk12 * 100) / 100	daRatio13 = parseInt(tempk13 * 100) / 100	daRatio14 = parseInt(tempk14 * 100) / 100	daRatio15 = parseInt(tempk15 * 100) / 100														document.form1.box.value = daRatio	document.form1.box1.value = daRatio1 	document.form1.box2.value = daRatio2	document.form1.box3.value = daRatio3	document.form1.box4.value = daRatio4	document.form1.box5.value = daRatio5	document.form1.box6.value = daRatio6	document.form1.box7.value = daRatio7	document.form1.box8.value = daRatio8	document.form1.box9.value = daRatio9	document.form1.box10.value = daRatio10	document.form1.box11.value = daRatio11	document.form1.box12.value = daRatio12 	document.form1.box13.value = daRatio13	document.form1.box14.value = daRatio14	document.form1.box15.value = daRatio15}