// This Javascript Doccument Contains All Header Functions For The Volumetric Weight Conversion Calculator

// THIS FUNCTION CONVERTS FRESHWATER VOL GALLONS INTO WEIGHT
function FWVol2WtGAL(gallon, form)
{
// This defines the number of Decimal Places in the Displayed Answers. 10 = 1 dec pl, 100 = 2 dec pl... etc
var DecPl = 1000;	
var a = parseFloat(gallon);
var sg = 1.000
// This rounds and returns Cubic Feet
form.FWv2wFT3.value = Math.round(a * 0.1336806 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Inches
form.FWv2wINCH3.value = Math.round(a * 231.0 * sg * DecPl) / DecPl;
// This rounds and returns Pounds
form.FWv2wLB.value = Math.round(a * 8.345404 * sg * DecPl) / DecPl;
// This rounds and returns Liters
form.FWv2wLIT.value = Math.round(a * 3.785412 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Meters
form.FWv2wM3.value = Math.round(a * 0.003785412 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Centimeters
form.FWv2wCM3.value = Math.round(a * 3785.412 * sg * DecPl) / DecPl;
// This rounds and returns Kilograms
form.FWv2wKG.value = Math.round(a * 3.785412 * sg * DecPl) / DecPl;
// This rounds and returns Gallons
form.FWv2wUSgal.value = Math.round(a * DecPl) / DecPl;
}

// THIS FUNCTION CONVERTS FRESHWATER VOL CUBIC FEET INTO WEIGHT
function FWVol2WtFT3(feet3, form)
{
// This defines the number of Decimal Places in the Displayed Answers. 10 = 1 dec pl, 100 = 2 dec pl... etc
var DecPl = 1000;	
var a = parseFloat(feet3);
var sg = 1.000
// This rounds and returns Gallons
form.FWv2wUSgal.value = Math.round(a * 7.480519 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Inches
form.FWv2wINCH3.value = Math.round(a * 1728 * sg * DecPl) / DecPl;
// This rounds and returns Pounds
form.FWv2wLB.value = Math.round(a * 62.42796 * sg * DecPl) / DecPl;
// This rounds and returns Liters
form.FWv2wLIT.value = Math.round(a * 28.31685 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Meters
form.FWv2wM3.value = Math.round(a * 0.02831685 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Centimeters
form.FWv2wCM3.value = Math.round(a * 28316.85 * sg * DecPl) / DecPl;
// This rounds and returns Kilograms
form.FWv2wKG.value = Math.round(a * 28.31685 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Feet
form.FWv2wFT3.value = Math.round(a * DecPl) / DecPl;
}


// THIS FUNCTION CONVERTS FRESHWATER VOL CUBIC INCH INTO WEIGHT
function FWVol2WtINCH3(inch3, form)
{
// This defines the number of Decimal Places in the Displayed Answers. 10 = 1 dec pl, 100 = 2 dec pl... etc
var DecPl = 100000;	
var a = parseFloat(inch3);
var sg = 1.000
// This rounds and returns Gallons
form.FWv2wUSgal.value = Math.round(a * 0.004329004 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Feet
form.FWv2wFT3.value = Math.round(a * 0.0005787037 * sg * DecPl) / DecPl;
// This rounds and returns Pounds
form.FWv2wLB.value = Math.round(a * 0.03612728 * sg * DecPl) / DecPl;
// This rounds and returns Liters
form.FWv2wLIT.value = Math.round(a * 0.01638706 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Meters
form.FWv2wM3.value = Math.round(a * 0.00001638706 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Centimeters
form.FWv2wCM3.value = Math.round(a * 16.38706 * sg * DecPl) / DecPl;
// This rounds and returns Kilograms
form.FWv2wKG.value = Math.round(a * 0.01638706 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Inches
form.FWv2wINCH3.value = Math.round(a * DecPl) / DecPl;
}

// THIS FUNCTION CONVERTS FRESHWATER WEIGHT POUNDS INTO VOLUME
function FWVol2WtLB(pounds, form)
{
// This defines the number of Decimal Places in the Displayed Answers. 10 = 1 dec pl, 100 = 2 dec pl... etc
var DecPl = 1000;	
var a = parseFloat(pounds);
var sg = 1.000
// This rounds and returns Gallons
form.FWv2wUSgal.value = Math.round(a * 0.1198264 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Feet
form.FWv2wFT3.value = Math.round(a * 0.01601846 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Inches
form.FWv2wINCH3.value = Math.round(a * 27.6799 * sg * DecPl) / DecPl;
// This rounds and returns Liters
form.FWv2wLIT.value = Math.round(a * 0.4535923 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Meters
form.FWv2wM3.value = Math.round(a * 0.0004535923 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Centimeters
form.FWv2wCM3.value = Math.round(a * 453.5923 * sg * DecPl) / DecPl;
// This rounds and returns Kilograms
form.FWv2wKG.value = Math.round(a * 0.4535924 * sg * DecPl) / DecPl;
// This rounds and returns Pounds
form.FWv2wLB.value = Math.round(a * DecPl) / DecPl;
}

// THIS FUNCTION CONVERTS FRESHWATER VOL LITERS INTO WEIGHT
function FWVol2WtLIT(liters, form)
{
// This defines the number of Decimal Places in the Displayed Answers. 10 = 1 dec pl, 100 = 2 dec pl... etc
var DecPl = 1000;	
var a = parseFloat(liters);
var sg = 1.000
// This rounds and returns Gallons
form.FWv2wUSgal.value = Math.round(a * 0.2641721 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Feet
form.FWv2wFT3.value = Math.round(a * 0.03531467 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Inches
form.FWv2wINCH3.value = Math.round(a * 61.02374 * sg * DecPl) / DecPl;
// This rounds and returns Pounds
form.FWv2wLB.value = Math.round(a * 2.204623 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Meters
form.FWv2wM3.value = Math.round(a * 0.001 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Centimeters
form.FWv2wCM3.value = Math.round(a * 1000 * sg * DecPl) / DecPl;
// This rounds and returns Kilograms
form.FWv2wKG.value = Math.round(a * 1 * sg * DecPl) / DecPl;
// This rounds and returns Liters
form.FWv2wLIT.value = Math.round(a * DecPl) / DecPl;
}

// THIS FUNCTION CONVERTS FRESHWATER VOL CUBIC METERS INTO WEIGHT
function FWVol2WtM3(M3, form)
{
// This defines the number of Decimal Places in the Displayed Answers. 10 = 1 dec pl, 100 = 2 dec pl... etc
var DecPl = 1000;	
var a = parseFloat(M3);
var sg = 1.000
// This rounds and returns Gallons
form.FWv2wUSgal.value = Math.round(a * 264.1721 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Feet
form.FWv2wFT3.value = Math.round(a * 35.31467 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Inches
form.FWv2wINCH3.value = Math.round(a * 61023.74 * sg * DecPl) / DecPl;
// This rounds and returns Pounds
form.FWv2wLB.value = Math.round(a * 2204.623 * sg * DecPl) / DecPl;
// This rounds and returns Liters
form.FWv2wLIT.value = Math.round(a * 1000 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Centimeters
form.FWv2wCM3.value = Math.round(a * 1000000 * sg * DecPl) / DecPl;
// This rounds and returns Kilograms
form.FWv2wKG.value = Math.round(a * 1000 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Meters
form.FWv2wM3.value = Math.round(a * DecPl) / DecPl;
}

// THIS FUNCTION CONVERTS FRESHWATER VOL CUBIC CM INTO WEIGHT
function FWVol2WtCM3(CM3, form)
{
// This defines the number of Decimal Places in the Displayed Answers. 10 = 1 dec pl, 100 = 2 dec pl... etc
var DecPl = 10000;	
var a = parseFloat(CM3);
var sg = 1.000
// This rounds and returns Gallons
form.FWv2wUSgal.value = Math.round(a * 0.000264172 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Feet
form.FWv2wFT3.value = Math.round(a * 0.00003531467 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Inches
form.FWv2wINCH3.value = Math.round(a * 0.06102374 * sg * DecPl) / DecPl;
// This rounds and returns Pounds
form.FWv2wLB.value = Math.round(a * 0.002204623 * sg * DecPl) / DecPl;
// This rounds and returns Liters
form.FWv2wLIT.value = Math.round(a * 0.001 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Meters
form.FWv2wM3.value = Math.round(a * 0.000001 * sg * DecPl) / DecPl;
// This rounds and returns Kilograms
form.FWv2wKG.value = Math.round(a * 0.001 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Centimeters
form.FWv2wCM3.value = Math.round(a * DecPl) / DecPl;
}

// THIS FUNCTION CONVERTS FRESHWATER WEIGHT KILOGRAMS INTO VOL
function FWVol2WtKG(KG, form)
{
// This defines the number of Decimal Places in the Displayed Answers. 10 = 1 dec pl, 100 = 2 dec pl... etc
var DecPl = 1000;	
var a = parseFloat(KG);
var sg = 1.000
// This rounds and returns Gallons
form.FWv2wUSgal.value = Math.round(a * 0.2641721 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Feet
form.FWv2wFT3.value = Math.round(a * 0.03531467 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Inches
form.FWv2wINCH3.value = Math.round(a * 61.02374 * sg * DecPl) / DecPl;
// This rounds and returns Pounds
form.FWv2wLB.value = Math.round(a * 2.204623 * sg * DecPl) / DecPl;
// This rounds and returns Liters
form.FWv2wLIT.value = Math.round(a * 1 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Meters
form.FWv2wM3.value = Math.round(a * 0.001 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Centimeters
form.FWv2wCM3.value = Math.round(a * 1000 * sg * DecPl) / DecPl;
// This rounds and returns Kilograms
form.FWv2wKG.value = Math.round(a * DecPl) / DecPl;
}

// THIS FUNCTION CONVERTS SALTWATER VOL GALLONS INTO WEIGHT
function SWVol2WtGAL(gallon, form)
{
// This defines the number of Decimal Places in the Displayed Answers. 10 = 1 dec pl, 100 = 2 dec pl... etc
var DecPl = 1000;	
var a = parseFloat(gallon);
var sg = 1.023
// This rounds and returns Cubic Feet
form.SWv2wFT3.value = Math.round(a * 0.1336806 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Inches
form.SWv2wINCH3.value = Math.round(a * 231.0 * sg * DecPl) / DecPl;
// This rounds and returns Pounds
form.SWv2wLB.value = Math.round(a * 8.345404 * sg * DecPl) / DecPl;
// This rounds and returns Liters
form.SWv2wLIT.value = Math.round(a * 3.785412 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Meters
form.SWv2wM3.value = Math.round(a * 0.003785412 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Centimeters
form.SWv2wCM3.value = Math.round(a * 3785.412 * sg * DecPl) / DecPl;
// This rounds and returns Kilograms
form.SWv2wKG.value = Math.round(a * 3.785412 * sg * DecPl) / DecPl;
// This rounds and returns Gallons
form.SWv2wUSgal.value = Math.round(a * DecPl) / DecPl;
}

// THIS FUNCTION CONVERTS SALTWATER VOL CUBIC FEET INTO WEIGHT
function SWVol2WtFT3(feet3, form)
{
// This defines the number of Decimal Places in the Displayed Answers. 10 = 1 dec pl, 100 = 2 dec pl... etc
var DecPl = 1000;	
var a = parseFloat(feet3);
var sg = 1.023
// This rounds and returns Gallons
form.SWv2wUSgal.value = Math.round(a * 7.480519 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Inches
form.SWv2wINCH3.value = Math.round(a * 1728 * sg * DecPl) / DecPl;
// This rounds and returns Pounds
form.SWv2wLB.value = Math.round(a * 62.42796 * sg * DecPl) / DecPl;
// This rounds and returns Liters
form.SWv2wLIT.value = Math.round(a * 28.31685 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Meters
form.SWv2wM3.value = Math.round(a * 0.02831685 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Centimeters
form.SWv2wCM3.value = Math.round(a * 28316.85 * sg * DecPl) / DecPl;
// This rounds and returns Kilograms
form.SWv2wKG.value = Math.round(a * 28.31685 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Feet
form.SWv2wFT3.value = Math.round(a * DecPl) / DecPl;
}


// THIS FUNCTION CONVERTS SALTWATER VOL CUBIC INCH INTO WEIGHT
function SWVol2WtINCH3(inch3, form)
{
// This defines the number of Decimal Places in the Displayed Answers. 10 = 1 dec pl, 100 = 2 dec pl... etc
var DecPl = 100000;	
var a = parseFloat(inch3);
var sg = 1.023
// This rounds and returns Gallons
form.SWv2wUSgal.value = Math.round(a * 0.004329004 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Feet
form.SWv2wFT3.value = Math.round(a * 0.0005787037 * sg * DecPl) / DecPl;
// This rounds and returns Pounds
form.SWv2wLB.value = Math.round(a * 0.03612728 * sg * DecPl) / DecPl;
// This rounds and returns Liters
form.SWv2wLIT.value = Math.round(a * 0.01638706 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Meters
form.SWv2wM3.value = Math.round(a * 0.00001638706 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Centimeters
form.SWv2wCM3.value = Math.round(a * 16.38706 * sg * DecPl) / DecPl;
// This rounds and returns Kilograms
form.SWv2wKG.value = Math.round(a * 0.01638706 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Inches
form.SWv2wINCH3.value = Math.round(a * DecPl) / DecPl;
}

// THIS FUNCTION CONVERTS SALTWATER WEIGHT POUNDS INTO VOLUME
function SWVol2WtLB(pounds, form)
{
// This defines the number of Decimal Places in the Displayed Answers. 10 = 1 dec pl, 100 = 2 dec pl... etc
var DecPl = 1000;	
var a = parseFloat(pounds);
var sg = 1.023
// This rounds and returns Gallons
form.SWv2wUSgal.value = Math.round(a * 0.1198264 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Feet
form.SWv2wFT3.value = Math.round(a * 0.01601846 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Inches
form.SWv2wINCH3.value = Math.round(a * 27.6799 * sg * DecPl) / DecPl;
// This rounds and returns Liters
form.SWv2wLIT.value = Math.round(a * 0.4535923 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Meters
form.SWv2wM3.value = Math.round(a * 0.0004535923 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Centimeters
form.SWv2wCM3.value = Math.round(a * 453.5923 * sg * DecPl) / DecPl;
// This rounds and returns Kilograms
form.SWv2wKG.value = Math.round(a * 0.4535924 * sg * DecPl) / DecPl;
// This rounds and returns Pounds
form.SWv2wLB.value = Math.round(a * DecPl) / DecPl;
}

// THIS FUNCTION CONVERTS SALTWATER VOL LITERS INTO WEIGHT
function SWVol2WtLIT(liters, form)
{
// This defines the number of Decimal Places in the Displayed Answers. 10 = 1 dec pl, 100 = 2 dec pl... etc
var DecPl = 1000;	
var a = parseFloat(liters);
var sg = 1.023
// This rounds and returns Gallons
form.SWv2wUSgal.value = Math.round(a * 0.2641721 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Feet
form.SWv2wFT3.value = Math.round(a * 0.03531467 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Inches
form.SWv2wINCH3.value = Math.round(a * 61.02374 * sg * DecPl) / DecPl;
// This rounds and returns Pounds
form.SWv2wLB.value = Math.round(a * 2.204623 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Meters
form.SWv2wM3.value = Math.round(a * 0.001 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Centimeters
form.SWv2wCM3.value = Math.round(a * 1000 * sg * DecPl) / DecPl;
// This rounds and returns Kilograms
form.SWv2wKG.value = Math.round(a * 1 * sg * DecPl) / DecPl;
// This rounds and returns Liters
form.SWv2wLIT.value = Math.round(a * DecPl) / DecPl;
}

// THIS FUNCTION CONVERTS SALTWATER VOL CUBIC METERS INTO WEIGHT
function SWVol2WtM3(M3, form)
{
// This defines the number of Decimal Places in the Displayed Answers. 10 = 1 dec pl, 100 = 2 dec pl... etc
var DecPl = 1000;	
var a = parseFloat(M3);
var sg = 1.023
// This rounds and returns Gallons
form.SWv2wUSgal.value = Math.round(a * 264.1721 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Feet
form.SWv2wFT3.value = Math.round(a * 35.31467 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Inches
form.SWv2wINCH3.value = Math.round(a * 61023.74 * sg * DecPl) / DecPl;
// This rounds and returns Pounds
form.SWv2wLB.value = Math.round(a * 2204.623 * sg * DecPl) / DecPl;
// This rounds and returns Liters
form.SWv2wLIT.value = Math.round(a * 1000 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Centimeters
form.SWv2wCM3.value = Math.round(a * 1000000 * sg * DecPl) / DecPl;
// This rounds and returns Kilograms
form.SWv2wKG.value = Math.round(a * 1000 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Meters
form.SWv2wM3.value = Math.round(a * DecPl) / DecPl;
}

// THIS FUNCTION CONVERTS SALTWATER VOL CUBIC CM INTO WEIGHT
function SWVol2WtCM3(CM3, form)
{
// This defines the number of Decimal Places in the Displayed Answers. 10 = 1 dec pl, 100 = 2 dec pl... etc
var DecPl = 10000;	
var a = parseFloat(CM3);
var sg = 1.023
// This rounds and returns Gallons
form.SWv2wUSgal.value = Math.round(a * 0.000264172 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Feet
form.SWv2wFT3.value = Math.round(a * 0.00003531467 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Inches
form.SWv2wINCH3.value = Math.round(a * 0.06102374 * sg * DecPl) / DecPl;
// This rounds and returns Pounds
form.SWv2wLB.value = Math.round(a * 0.002204623 * sg * DecPl) / DecPl;
// This rounds and returns Liters
form.SWv2wLIT.value = Math.round(a * 0.001 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Meters
form.SWv2wM3.value = Math.round(a * 0.000001 * sg * DecPl) / DecPl;
// This rounds and returns Kilograms
form.SWv2wKG.value = Math.round(a * 0.001 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Centimeters
form.SWv2wCM3.value = Math.round(a * DecPl) / DecPl;
}

// THIS FUNCTION CONVERTS SALTWATER WEIGHT KILOGRAMS INTO VOL
function SWVol2WtKG(KG, form)
{
// This defines the number of Decimal Places in the Displayed Answers. 10 = 1 dec pl, 100 = 2 dec pl... etc
var DecPl = 1000;	
var a = parseFloat(KG);
var sg = 1.023
// This rounds and returns Gallons
form.SWv2wUSgal.value = Math.round(a * 0.2641721 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Feet
form.SWv2wFT3.value = Math.round(a * 0.03531467 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Inches
form.SWv2wINCH3.value = Math.round(a * 61.02374 * sg * DecPl) / DecPl;
// This rounds and returns Pounds
form.SWv2wLB.value = Math.round(a * 2.204623 * sg * DecPl) / DecPl;
// This rounds and returns Liters
form.SWv2wLIT.value = Math.round(a * 1 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Meters
form.SWv2wM3.value = Math.round(a * 0.001 * sg * DecPl) / DecPl;
// This rounds and returns Cubic Centimeters
form.SWv2wCM3.value = Math.round(a * 1000 * sg * DecPl) / DecPl;
// This rounds and returns Kilograms
form.SWv2wKG.value = Math.round(a * DecPl) / DecPl;
}
