function calculateTotal(frm)
{	
	var price1 = frm.mat1.options[frm.mat1.selectedIndex].value.split(':')[1];
	var price2 = frm.mat2.options[frm.mat2.selectedIndex].value.split(':')[1];
	var price3= frm.mat3.options[frm.mat3.selectedIndex].value.split(':')[1];
	var price4 = frm.mat4.options[frm.mat4.selectedIndex].value.split(':')[1];
	var price5 = frm.mat5.options[frm.mat5.selectedIndex].value.split(':')[1];
	
	var sqft1 = (frm.width1.value*frm.length1.value)/144;
	var sqft2 = (frm.width2.value*frm.length2.value)/144;
	var sqft3 = (frm.width3.value*frm.length3.value)/144;
	var sqft4 = (frm.width4.value*frm.length4.value)/144;
	var sqft5 = (	frm.width5.value*frm.length5.value)/144;
	
	var total1 = sqft1*price1;	
	var total2 = sqft2*price2;	
	var total3 = sqft3*price3;	
	var total4 = sqft4*price4;	
	var total5 = sqft5*price5;
	
	frm.sqft1.value = sqft1.toFixed(2);
	frm.sqft2.value = sqft2.toFixed(2);
	frm.sqft3.value = sqft3.toFixed(2);
	frm.sqft4.value = sqft4.toFixed(2);
	frm.sqft5.value = sqft5.toFixed(2);
	
	frm.price1.value = price1;
	frm.price2.value = price2;
	frm.price3.value = price3;
	frm.price4.value = price4;
	frm.price5.value = price5;
	
	frm.total1.value = total1.toFixed(2);
	frm.total2.value = total2.toFixed(2);
	frm.total3.value = total3.toFixed(2);
	frm.total4.value = total4.toFixed(2);
	frm.total5.value = total5.toFixed(2);
	
	
	var total = total1+total2+total3+total4+total5;
	frm.total.value = total.toFixed(2);
	return;
}
