function calcRoundHole(){	
	//diameter*thickness*3.14159*0.8333333*tensile/2000
	var errors, diam, thick, tensile, retVal;
	//first check the validity of all the numbers
	errors = '';
	diam = parseFloat(document.Round.RoundDiameter.value);
	if (document.Round.RoundDiameter.value != ''+diam) errors += ' '+document.Round.RoundDiameter.name+' must contain a valid number. View directions above.\n';
	if (document.Round.RoundDiameter.value < document.Round.RoundThickness.value) errors += 'Hole Diameter must be greater than Material Thickness.\n';
	thick = parseFloat(document.Round.RoundThickness.value);
	if (document.Round.RoundThickness.value != ''+thick) errors += 'Material Thickness must contain a valid number. View directions above.\n';
	tensile = parseFloat(document.Round.RoundTensile.value);
	if (document.Round.RoundTensile.value != ''+tensile) errors += 'Material Tensil Strength must contain a valid number. View directions above.\n';
	if( errors != '' ){
		alert(errors);
		return;
	}
	retVal = diam * thick * 3.14159 * 0.8333333 * tensile / 2000;
	retVal *= 100.0;
	retVal = Math.round(retVal);
	retVal /= 100.0;	
	document.Round.PunchTonnage.value = retVal;
}

function calcSquareHole(){
	//(2*sideOne+2*sideTwo)*thickness*tensile*0.83333333/2000
	var errors, sideOne, sideTwo, thick, tensile, retVal;
	//first check the validity of all the numbers
	errors = '';
	sideOne = parseFloat(document.Rect.RectSideOne.value);
	if (document.Rect.RectSideOne.value != ''+sideOne) errors += 'Side one must contain a valid number. View directions above.\n';
	sideTwo = parseFloat(document.Rect.RectSideTwo.value);
	if (document.Rect.RectSideTwo.value != ''+sideTwo) errors += 'Side two must contain a valid number. View directions above.\n';
	thick = parseFloat(document.Rect.RectThickness.value);
	if (document.Rect.RectThickness.value != ''+thick) errors += 'Thickness must contain a valid number. View directions above.\n';
	tensile = parseFloat(document.Rect.RectTensile.value);
	if (document.Rect.RectTensile.value != ''+tensile) errors += 'Tensile strength must contain a valid number. View directions above.\n';
    
	if( errors != '' ){
		alert(errors);
		return;
	}
	retVal = ((2.0 * sideOne ) + ( 2.0 * sideTwo )) * thick * tensile * 0.8333333 / 2000;
	retVal *= 100.0;
	retVal = Math.round(retVal);
	retVal /= 100.0;	
	document.Round.PunchTonnage.value = retVal;
}

function calcOblongHole(){
	//(((length-width)*2+(3.14159*width))*thickness*tensile*0.8333333/2000)
	var errors, length, width, thick, tensile, retVal;
	//first check the validity of all the numbers
	errors = '';
	length = parseFloat(document.Oblong.OblongLength.value);
	if (document.Oblong.OblongLength.value != ''+length) errors += 'Length of slot must contain a valid number. View directions above.\n';
	width = parseFloat(document.Oblong.OblongWidth.value);
	if (document.Oblong.OblongWidth.value != ''+width) errors += 'Width of slot must contain a valid number. View directions above.\n';
	thick = parseFloat(document.Oblong.OblongThickness.value);
	if (document.Oblong.OblongThickness.value != ''+thick) errors += 'Material thickness must contain a valid number. View directions above.\n';
	tensile = parseFloat(document.Oblong.OblongTensile.value);
	if (document.Oblong.OblongTensile.value != ''+tensile) errors += 'Tensile strengthmust contain a valid number. View directions above.\n';    
	if( errors != '' ){
		alert(errors);
		return;
	}
	retVal = (( ((length - width) * 2.0) + (3.14159 * width) ) * thick * tensile * 0.8333333 / 2000);
	retVal *= 100.0;
	retVal = Math.round(retVal);
	retVal /= 100.0;
	document.Round.PunchTonnage.value = retVal;
}

function calcOther(){
var tonValue=document.Round.PunchTonnage.value;
var otherMetal=document.Round.metalTypes.value;
convertType=(tonValue*otherMetal)
document.Round.OtherTonnage.value=convertType
}