


function carea(){
	
	newt1 = parseFloat(document.frm1.t1.value);

	
	if(document.frm1.arealist1.selectedIndex == 1) {newt1 *= 4046900000;}
	if(document.frm1.arealist1.selectedIndex == 2) {newt1 *= 100;}		
	if(document.frm1.arealist1.selectedIndex == 3) {newt1 *= 92900;}
	if(document.frm1.arealist1.selectedIndex == 4) {newt1 *= 10000000000;}
	if(document.frm1.arealist1.selectedIndex == 5) {newt1 *= 645.16;}
	if(document.frm1.arealist1.selectedIndex == 6) {newt1 *= 1000000000000;}
	if(document.frm1.arealist1.selectedIndex == 7) {newt1 *= 1000000;}
	if(document.frm1.arealist1.selectedIndex == 8) {newt1 *= 2590000000000;}
	if(document.frm1.arealist1.selectedIndex == 9) {newt1 *= 1;}
	if(document.frm1.arealist1.selectedIndex == 10){newt1 *= 836100;}
		
	
	if(document.frm1.arealist2.selectedIndex == 1) {newt1 /= 4046900000;}
	if(document.frm1.arealist2.selectedIndex == 2) {newt1 /= 100;}
	if(document.frm1.arealist2.selectedIndex == 3) {newt1 /= 92900;}
	if(document.frm1.arealist2.selectedIndex == 4) {newt1 /= 10000000000;}
	if(document.frm1.arealist2.selectedIndex == 5) {newt1 /= 645.16;}
	if(document.frm1.arealist2.selectedIndex == 6) {newt1 /= 1000000000000;}
	if(document.frm1.arealist2.selectedIndex == 7) {newt1 /= 1000000;}
	if(document.frm1.arealist2.selectedIndex == 8) {newt1 /= 2590000000000;}
	if(document.frm1.arealist2.selectedIndex == 9) {newt1 /= 1;}
	if(document.frm1.arealist2.selectedIndex == 10){newt1 /= 836100;}


	fnewt1 = reducedec(newt1);
	document.frm1.result.value = fnewt1;
}	

function clength(){
	
	newt1 = parseFloat(document.frm1.t1.value);
	var rslt;
	 
	if(document.frm1.list1.selectedIndex == 1) {newt1 *= 10;}
	if(document.frm1.list1.selectedIndex == 2) {newt1 *= 304.8;}		
	if(document.frm1.list1.selectedIndex == 3) {newt1 *= 25.4;}
	if(document.frm1.list1.selectedIndex == 4) {newt1 *= 1000000;}
	if(document.frm1.list1.selectedIndex == 5) {newt1 *= 1000;}
	if(document.frm1.list1.selectedIndex == 6) {newt1 *= 1609300;}
	if(document.frm1.list1.selectedIndex == 7) {newt1 *= 1;}
	if(document.frm1.list1.selectedIndex == 8) {newt1 *= 914.4;}
		
		
	 // convert to user's choice
	if(document.frm1.list2.selectedIndex == 1) {newt1 /= 10;}
	if(document.frm1.list2.selectedIndex == 2) {newt1 /= 304.8;}
	if(document.frm1.list2.selectedIndex == 3) {newt1 /= 25.4;}
	if(document.frm1.list2.selectedIndex == 4) {newt1 /= 1000000;}
	if(document.frm1.list2.selectedIndex == 5) {newt1 /= 1000;}
	if(document.frm1.list2.selectedIndex == 6) {newt1/= 1609300;}
	if(document.frm1.list2.selectedIndex == 7) {newt1 /= 1;}
	if(document.frm1.list2.selectedIndex == 8) {newt1 /= 914.4;}

	fnewt1 = reducedec(newt1);
	document.frm1.result.value = fnewt1;
}



function cvol(){
	
	newt1 = parseFloat(document.frm1.t1.value);
	
  	 // convert to cubic mm
	if(document.frm1.list1.selectedIndex == 1) {newt1 *= 1000;}
	if(document.frm1.list1.selectedIndex == 2) {newt1 *= 1000000;}		
	if(document.frm1.list1.selectedIndex == 3) {newt1 *= 28300000;}
	if(document.frm1.list1.selectedIndex == 4) {newt1 *= 100000000;}
	if(document.frm1.list1.selectedIndex == 5) {newt1 *= 16387;}
	if(document.frm1.list1.selectedIndex == 6) {newt1 *= 1000000;}
	if(document.frm1.list1.selectedIndex == 7) {newt1 *= 1000000000;}
	if(document.frm1.list1.selectedIndex == 8) {newt1 *= 1000;}
	if(document.frm1.list1.selectedIndex == 9) {newt1 *= 1;}
	if(document.frm1.list1.selectedIndex == 10){newt1 *= 29574;}
	if(document.frm1.list1.selectedIndex == 11){newt1 *= 4546100;}
	if(document.frm1.list1.selectedIndex == 12){newt1 *= 568300;}
	if(document.frm1.list1.selectedIndex == 13){newt1 *= 29574;}
	if(document.frm1.list1.selectedIndex == 14){newt1 *= 3785400;}
	if(document.frm1.list1.selectedIndex == 15){newt1 *= 473100;}


		
	 // convert to user's choice
	if(document.frm1.list2.selectedIndex == 1) {newt1 /= 1000;}
	if(document.frm1.list2.selectedIndex == 2) {newt1 /= 1000000;}		
	if(document.frm1.list2.selectedIndex == 3) {newt1 /= 28300000;}
	if(document.frm1.list2.selectedIndex == 4) {newt1 /= 100000000;}
	if(document.frm1.list2.selectedIndex == 5) {newt1 /= 16387;}
	if(document.frm1.list2.selectedIndex == 6) {newt1 /= 1000000;}
	if(document.frm1.list2.selectedIndex == 7) {newt1 /= 1000000000;}
	if(document.frm1.list2.selectedIndex == 8) {newt1 /= 1000;}
	if(document.frm1.list2.selectedIndex == 9) {newt1 /= 1;}
	if(document.frm1.list2.selectedIndex == 10) {newt1 /= 29574;}
	if(document.frm1.list2.selectedIndex == 11){newt1 /= 4546100;}
	if(document.frm1.list2.selectedIndex == 12){newt1 /= 568300;}
	if(document.frm1.list2.selectedIndex == 13){newt1 /= 29574;}
	if(document.frm1.list2.selectedIndex == 14){newt1 /= 3785400;}
	if(document.frm1.list2.selectedIndex == 15){newt1 /= 473100;}


	fnewt1 = reducedec(newt1);
	document.frm1.result.value = fnewt1;
}	


		
function cweight(){
	
	newt1 = parseFloat(document.frm1.t1.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;}
	
		
	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.t1.value)){
			document.frm1.t1.value = ""
			document.frm1.t1.focus();  
	}
}