//volume section

			
function calcLength(){
	
	newt1 = parseFloat(document.frm1.masst1.value);
	
	 // convert to mg
	if(document.frm1.masslist1.selectedIndex == 1) {newt1 /= 0.0154;}
	if(document.frm1.masslist1.selectedIndex == 2) {newt1 *= 1000;}		
	if(document.frm1.masslist1.selectedIndex == 3) {newt1 *= 50802000000;}
	if(document.frm1.masslist1.selectedIndex == 4) {newt1 *= 1016046909;}
	if(document.frm1.masslist1.selectedIndex == 5) {newt1 *= 1000000;}
	if(document.frm1.masslist1.selectedIndex == 6) {newt1 *= 1000000000;}
	if(document.frm1.masslist1.selectedIndex == 7) {newt1 *= 1;}
	if(document.frm1.masslist1.selectedIndex == 8) {newt1 *= 28350;}
	if(document.frm1.masslist1.selectedIndex == 9) {newt1 *= 453600;}
	if(document.frm1.masslist1.selectedIndex == 10) {newt1 *= 6350300;}
	
		
	 // convert to user's choice
	if(document.frm1.masslist2.selectedIndex == 1) {newt1 *= 0.0154;}
	if(document.frm1.masslist2.selectedIndex == 2) {newt1 /= 1000;}
	if(document.frm1.masslist2.selectedIndex == 3) {newt1 /= 50802000000;}	
	if(document.frm1.masslist2.selectedIndex == 4) {newt1 /= 1016046909;}
	if(document.frm1.masslist2.selectedIndex == 5) {newt1 /= 1000000;}
	if(document.frm1.masslist2.selectedIndex == 6) {newt1 /= 1000000000;}
	if(document.frm1.masslist2.selectedIndex == 7) {newt1 /= 1;}
	if(document.frm1.masslist2.selectedIndex == 8) {newt1 /= 28350;}
	if(document.frm1.masslist2.selectedIndex == 9) {newt1 /= 453600;}
	if(document.frm1.masslist2.selectedIndex == 10) {newt1 /= 6350300;}

	fnewt1 = reducedec(newt1);
	document.frm1.result.value = fnewt1;
}	
function reducedec(newt1){

strn = newt1.toString();
if(strn.indexOf(".") != -1)
{ io = strn.indexOf(".");
  strn4 = strn.substring(io, (io+5));
  ent = strn.substring(0,io);
  fnewt1 = ent+strn4;
  if(fnewt1.indexOf(".") == 0)fnewt1 = "0"+fnewt1;
}
else {fnewt1 = newt1;}
 return fnewt1;
}


function checkt1(){
	
	if(isNaN(document.frm1.masst1.value)){
		document.frm1.masst1.value = "";
		document.frm1.masst1.focus();  
	}
}
