
function changeOrigin() {
	var portOp = document.form1.port;
	value = document.form1.origin.value;

	if (value == "NA") {
		portOp.options.length = 1;
		portOp.options[0] = new Option("N/A", "NA");
	}
	if (value == "TBA") {
		portOp.options.length = 1;
		portOp.options[0] = new Option("TBC", "TBC");
	}
	if (value == "HONG KONG") {
		portOp.options.length = 1;
		portOp.options[0] = new Option("HONG KONG", "HONG KONG");
	}
	if (value == "CHINA") {
		portOp.options.length = 17;
		portOp.options[0] = new Option("DALIAN", "DALIAN");
		portOp.options[1] = new Option("EX-FACTORY", "EX-FACTORY");
		portOp.options[2] = new Option("FUZHOU", "FUZHOU");
		portOp.options[3] = new Option("GUANGZHOU", "GUANGZHOU");
		portOp.options[4] = new Option("HONG KONG", "HONG KONG");
		portOp.options[5] = new Option("HUANGPU", "HUANGPU");
		portOp.options[6] = new Option("NANJING", "NANJING");
		portOp.options[7] = new Option("NINGBO", "NINGBO");
		portOp.options[8] = new Option("QINGDAO", "QINGDAO");
		portOp.options[9] = new Option("SHANTOU", "SHANTOU");
		portOp.options[10] = new Option("SHANGHAI", "SHANGHAI");
		portOp.options[11] = new Option("SHUNDE/RONGQUI", "SHUNDE");
		portOp.options[12] = new Option("XINGANG/TIANJIN", "TIANJIN");
		portOp.options[13] = new Option("XIAMEN", "XIAMEN");
		portOp.options[14] = new Option("YANTIAN", "YANTIAN");
		portOp.options[15] = new Option("ZHONGSHAN", "ZHONGSHAN");
		portOp.options[16] = new Option("ZHUHAI", "ZHUHAI");
	}
	if (value == "TAIWAN") {
		portOp.options.length = 2;
		portOp.options[0] = new Option("KAOHSIUNG", "KAOHSIUNG");
		portOp.options[1] = new Option("TAICHUNG", "TAICHUNG");
	}
	if (value == "VIETNAM") {
		portOp.options.length = 3;
		portOp.options[0] = new Option("HO CHI MINH", "HO CHI MINH");
		portOp.options[1] = new Option("HAIPHONG", "HAIPHONG");
		portOp.options[2] = new Option("QUINHON", "QUINHON");
	}
	if (value == "PHILIPPINES") {
		portOp.options.length = 1;
		portOp.options[0] = new Option("MANILA", "MANILA");
	}
	if (value == "MALAYSIA") {
		portOp.options.length = 4;
		portOp.options[0] = new Option("KLANG", "KLANG");
		portOp.options[1] = new Option("PASIR GUDANG", "PASIR GUDANG");
		portOp.options[2] = new Option("PENANG", "PENANG");
		portOp.options[3] = new Option("TANJUNG PELEPAS", "TANJUNG PELEPAS");
	}
	if (value == "THAILAND") {
		portOp.options.length = 1;
		portOp.options[0] = new Option("BANGKOK", "BANGKOK");
	}
	if (value == "BRAZIL") {
		portOp.options.length = 2;
		portOp.options[0] = new Option("ITAJAI", "ITAJAI");
		portOp.options[1] = new Option("SANTOS", "SANTOS");
	}
	if (value == "INDONESIA") {
		portOp.options.length = 2;
		portOp.options[0] = new Option("JAKARTA", "JAKARTA");
		portOp.options[1] = new Option("SURABAYA", "SURABAYA");
	}
	if (value == "SOUTH AFRICA") {
		portOp.options.length = 1;
		portOp.options[0] = new Option("DURBAN", "DURBAN");
	}
	if (value == "INDIA") {
		portOp.options.length = 1;
		portOp.options[0] = new Option("MUNDRA", "MUNDRA");
	}
}

function changeCategory() {
	document.form1.subCategory.options.length = 0;
	var j = 0;
	for (var i=0; i<cateIds.length; i++) {
		if (cateIds[i] == document.form1.category.value) {
			document.form1.subCategory.options[j++] = new Option(subNames[i], subCateIds[i]);
		}
	}
	//document.form1.subCategory.options.selectedIndex = 0;
}

function changeUnit() {
	var index = document.form1.unit.options.selectedIndex;
	
	if (index == 5)
		index = 0;

	for (var i=0; i<=index; i++ ) {
		displayId("dy" + (i+1));
	}
	for (var i=index+1; i<5; i++ ) {
		hideId("dy" + (i+1));
	}

	clearDim();

}

function changeBox() {
	var index = document.form1.outerBox.options.selectedIndex;

	for (var i=0; i<=index; i++ ) {
		displayId("outer" + (i+1));
	}
	for (var i=index+1; i<4; i++ ) {
		hideId("outer" + (i+1));
	}
	
	if (index>0) {
		hideId("inner");
		clearInnerBox();
	}
	else {
		displayId("inner");
	}
	
	clearOuterBox();
//	calOuterCbm();
}

function clearDim() {
	var index = document.form1.unit.options.selectedIndex;
	if (index == 5)
		index = 0;

	var element;
	for (var i=index+2; i<6; i++) {
		document.getElementById("dimLm" + i).value="";
		document.getElementById("dimWm" + i).value="";
		document.getElementById("dimHm" + i).value="";
		document.getElementById("dimNWm" + i).value="";
		document.getElementById("dimLi" + i).value="";
		document.getElementById("dimWi" + i).value="";
		document.getElementById("dimHi" + i).value="";
		document.getElementById("dimNWi" + i).value="";
		document.getElementById("dimension" + i).value="";
		element = document.getElementById("ean" + i);
		if (element != null) {
			element.value ="";
		}
	}
}

function clearOuterBox() {
	var index = document.form1.outerBox.options.selectedIndex;

	for (var i=index+2; i<5; i++) {
		document.getElementById("outerQty" + i).value="";
		document.getElementById("outerLm" + i).value="";
		document.getElementById("outerWm" + i).value="";
		document.getElementById("outerHm" + i).value="";
		document.getElementById("outerGWm" + i).value="";
		document.getElementById("outerNWm" + i).value="";
		document.getElementById("outerLi" + i).value="";
		document.getElementById("outerWi" + i).value="";
		document.getElementById("outerHi" + i).value="";
		document.getElementById("outerGWi" + i).value="";
		document.getElementById("outerNWi" + i).value="";
		document.getElementById("outerCbm" + i).value="";
		document.getElementById("outerCuft" + i).value="";
	}
}

function clearInnerBox() {
	document.getElementById("innerQty").value="";
	document.getElementById("innerLm").value="";
	document.getElementById("innerWm").value="";
	document.getElementById("innerHm").value="";
	document.getElementById("innerGWm").value="";
	document.getElementById("innerNWm").value="";
	document.getElementById("innerLi").value="";
	document.getElementById("innerWi").value="";
	document.getElementById("innerHi").value="";
	document.getElementById("innerGWi").value="";
	document.getElementById("innerNWi").value="";
	document.getElementById("innerCbm").value="";
	document.getElementById("innerCuft").value="";
}

function clickDimUnit() {
	if (document.form1.dimUnit[0].checked) {
		//dimension
		for (var i=0; i<5; i++) {
			whiteId("dimLm"+(i+1));
			whiteId("dimWm"+(i+1));
			whiteId("dimHm"+(i+1));
			whiteId("dimNWm"+(i+1));

			grayId("dimLi"+(i+1));
			grayId("dimWi"+(i+1));
			grayId("dimHi"+(i+1));
			grayId("dimNWi"+(i+1));
		}
		//inner
		whiteId("innerLm");
		whiteId("innerWm");
		whiteId("innerHm");
		whiteId("innerGWm");
		whiteId("innerNWm");
		
		grayId("innerLi");
		grayId("innerWi");
		grayId("innerHi");
		grayId("innerGWi");
		grayId("innerNWi");

		//outer
		for (var i=0; i<4; i++) {
			whiteId("outerLm"+(i+1));
			whiteId("outerWm"+(i+1));
			whiteId("outerHm"+(i+1));
			whiteId("outerGWm"+(i+1));
			whiteId("outerNWm"+(i+1));

			grayId("outerLi"+(i+1));
			grayId("outerWi"+(i+1));
			grayId("outerHi"+(i+1));
			grayId("outerGWi"+(i+1));
			grayId("outerNWi"+(i+1));
		}
	}
	else {
		//dimension
		for (var i=0; i<5; i++) {
			grayId("dimLm"+(i+1));
			grayId("dimWm"+(i+1));
			grayId("dimHm"+(i+1));
			grayId("dimNWm"+(i+1));

			whiteId("dimLi"+(i+1));
			whiteId("dimWi"+(i+1));
			whiteId("dimHi"+(i+1));
			whiteId("dimNWi"+(i+1));
		}
		//inner
		grayId("innerLm");
		grayId("innerWm");
		grayId("innerHm");
		grayId("innerGWm");
		grayId("innerNWm");
		
		whiteId("innerLi");
		whiteId("innerWi");
		whiteId("innerHi");
		whiteId("innerGWi");
		whiteId("innerNWi");

		//outer
		for (var i=0; i<4; i++) {
			grayId("outerLm"+(i+1));
			grayId("outerWm"+(i+1));
			grayId("outerHm"+(i+1));
			grayId("outerGWm"+(i+1));
			grayId("outerNWm"+(i+1));

			whiteId("outerLi"+(i+1));
			whiteId("outerWi"+(i+1));
			whiteId("outerHi"+(i+1));
			whiteId("outerGWi"+(i+1));
			whiteId("outerNWi"+(i+1));
		}
	}

	for (var i=0; i<5; i++) {
		grayId("ean"+(i+1));
	}

}

function calDim() {
	var factor1 = 2.54;
	var factor2 = 2.2;
	if (document.form1.dimUnit[0].checked) {
		for (var i=0; i<5; i++) {
			document.getElementById("dimLi" + (i+1)).value=chDeci(getFloat(document.getElementById("dimLm" + (i+1)).value)/factor1,2);
			document.getElementById("dimWi" + (i+1)).value=chDeci(getFloat(document.getElementById("dimWm" + (i+1)).value)/factor1,2);
			document.getElementById("dimHi" + (i+1)).value=chDeci(getFloat(document.getElementById("dimHm" + (i+1)).value)/factor1,2);
			document.getElementById("dimNWi" + (i+1)).value=chDeci(getFloat(document.getElementById("dimNWm" + (i+1)).value)*factor2,2);
		}
	}
	else {
		for (var i=0; i<5; i++) {
			document.getElementById("dimLm" + (i+1)).value=chDeci(getFloat(document.getElementById("dimLi" + (i+1)).value)*factor1,2);
			document.getElementById("dimWm" + (i+1)).value=chDeci(getFloat(document.getElementById("dimWi" + (i+1)).value)*factor1,2);
			document.getElementById("dimHm" + (i+1)).value=chDeci(getFloat(document.getElementById("dimHi" + (i+1)).value)*factor1,2);
			document.getElementById("dimNWm" + (i+1)).value=chDeci(getFloat(document.getElementById("dimNWi" + (i+1)).value)/factor2,2);
		}
	}
}

function calInnerDim() {
	var factor1 = 2.54;
	var factor2 = 2.2;
	if (document.form1.dimUnit[0].checked) {
		document.getElementById("innerLi").value=chDeci(getFloat(document.getElementById("innerLm").value)/factor1,2)
		document.getElementById("innerWi").value=chDeci(getFloat(document.getElementById("innerWm").value)/factor1,2)
		document.getElementById("innerHi").value=chDeci(getFloat(document.getElementById("innerHm").value)/factor1,2)
		document.getElementById("innerGWi").value=chDeci(getFloat(document.getElementById("innerGWm").value)*factor2,2)
		document.getElementById("innerNWi").value=chDeci(getFloat(document.getElementById("innerNWm").value)*factor2,2)
	}
	else {
		document.getElementById("innerLm").value=chDeci(getFloat(document.getElementById("innerLi").value)*factor1,2)
		document.getElementById("innerWm").value=chDeci(getFloat(document.getElementById("innerWi").value)*factor1,2)
		document.getElementById("innerHm").value=chDeci(getFloat(document.getElementById("innerHi").value)*factor1,2)
		document.getElementById("innerGWm").value=chDeci(getFloat(document.getElementById("innerGWi").value)/factor2,2)
		document.getElementById("innerNWm").value=chDeci(getFloat(document.getElementById("innerNWi").value)/factor2,2)
	}
}

function calOuterDim() {
	var factor1 = 2.54;
	var factor2 = 2.2;
	if (document.form1.dimUnit[0].checked) {
		for (var i=0; i<4; i++) {
			document.getElementById("outerLi" + (i+1)).value=chDeci(getFloat(document.getElementById("outerLm" + (i+1)).value)/factor1,2);
			document.getElementById("outerWi" + (i+1)).value=chDeci(getFloat(document.getElementById("outerWm" + (i+1)).value)/factor1,2);
			document.getElementById("outerHi" + (i+1)).value=chDeci(getFloat(document.getElementById("outerHm" + (i+1)).value)/factor1,2);
			document.getElementById("outerGWi" + (i+1)).value=chDeci(getFloat(document.getElementById("outerGWm" + (i+1)).value)*factor2,2);
			document.getElementById("outerNWi" + (i+1)).value=chDeci(getFloat(document.getElementById("outerNWm" + (i+1)).value)*factor2,2);
		}
	}
	else {
		for (var i=0; i<4; i++) {
			document.getElementById("outerLm" + (i+1)).value=chDeci(getFloat(document.getElementById("outerLi" + (i+1)).value)*factor1,2);
			document.getElementById("outerWm" + (i+1)).value=chDeci(getFloat(document.getElementById("outerWi" + (i+1)).value)*factor1,2);
			document.getElementById("outerHm" + (i+1)).value=chDeci(getFloat(document.getElementById("outerHi" + (i+1)).value)*factor1,2);
			document.getElementById("outerGWm" + (i+1)).value=chDeci(getFloat(document.getElementById("outerGWi" + (i+1)).value)/factor2,2);
			document.getElementById("outerNWm" + (i+1)).value=chDeci(getFloat(document.getElementById("outerNWi" + (i+1)).value)/factor2,2);
		}
	}
}

function calAll() {
	calInner();
	calOuter();
}

function calInner() {
	setGrayField();
	calInnerDim();
	calInnerCbm();
}

function calOuter() {
	setGrayField();
	calOuterDim();
	calOuterCbm();
}

function calInnerCbm() {
	var innerL = getFloat(document.form1.innerLm.value);
	var innerW = getFloat(document.form1.innerWm.value);
	var innerH = getFloat(document.form1.innerHm.value);

	var innerCbm = eval(innerL * innerW * innerH / 1000000);
	var innerCuft = roundMore(innerCbm * 35.315, 2);
	innerCbm = roundMore(innerCbm, 3);

	document.form1.innerCbm.value = innerCbm;
	document.form1.innerCuft.value = innerCuft;
}

function calOuterCbm() {
	var outerQty1 = getInt(document.form1.outerQty1.value);
	var outerQty2 = getInt(document.form1.outerQty2.value);
	var outerQty3 = getInt(document.form1.outerQty3.value);
	var outerQty4 = getInt(document.form1.outerQty4.value);
	var outerQty = outerQty1 + outerQty2 + outerQty3 + outerQty4;

	if (outerQty == 0)
		return;
	
	var outerL1 = getFloat(document.form1.outerLm1.value);
	var outerL2 = getFloat(document.form1.outerLm2.value);
	var outerL3 = getFloat(document.form1.outerLm3.value);
	var outerL4 = getFloat(document.form1.outerLm4.value);
	var outerW1 = getFloat(document.form1.outerWm1.value);
	var outerW2 = getFloat(document.form1.outerWm2.value);
	var outerW3 = getFloat(document.form1.outerWm3.value);
	var outerW4 = getFloat(document.form1.outerWm4.value);
	var outerH1 = getFloat(document.form1.outerHm1.value);
	var outerH2 = getFloat(document.form1.outerHm2.value);
	var outerH3 = getFloat(document.form1.outerHm3.value);
	var outerH4 = getFloat(document.form1.outerHm4.value);

	var outerCbm1 = eval(outerL1 * outerW1 * outerH1 / 1000000);
	var outerCbm2 = eval(outerL2 * outerW2 * outerH2 / 1000000);
	var outerCbm3 = eval(outerL3 * outerW3 * outerH3 / 1000000);
	var outerCbm4 = eval(outerL4 * outerW4 * outerH4 / 1000000);
	var outerCbm = outerCbm1 + outerCbm2 + outerCbm3 + outerCbm4;
	
	var outerCuft1 = roundMore(outerCbm1 * 35.315, 2);
	var outerCuft2 = roundMore(outerCbm2 * 35.315, 2);
	var outerCuft3 = roundMore(outerCbm3 * 35.315, 2);
	var outerCuft4 = roundMore(outerCbm4 * 35.315, 2);

	outerCbm1 = roundMore(outerCbm1, 3);
	outerCbm2 = roundMore(outerCbm2, 3);
	outerCbm3 = roundMore(outerCbm3, 3);
	outerCbm4 = roundMore(outerCbm4, 3);
	outerCbm = roundMore(outerCbm, 3);

	document.form1.outerCbm1.value = outerCbm1;
	document.form1.outerCbm2.value = outerCbm2;
	document.form1.outerCbm3.value = outerCbm3;
	document.form1.outerCbm4.value = outerCbm4;
	document.form1.outerCuft1.value = outerCuft1;
	document.form1.outerCuft2.value = outerCuft2;
	document.form1.outerCuft3.value = outerCuft3;
	document.form1.outerCuft4.value = outerCuft4;

	//calculate loading
	if (document.form1.autoCalculate[0].checked) {
		var outerGW1 = getFloat(document.form1.outerGWm1.value);
		var outerGW2 = getFloat(document.form1.outerGWm2.value);
		var outerGW3 = getFloat(document.form1.outerGWm3.value);
		var outerGW4 = getFloat(document.form1.outerGWm4.value);
		var outerGW = outerGW1 + outerGW2 + outerGW3 + outerGW4;
	
		var carton20 = 0;
		var qty20 = 0;
		var weight20 = 0;
		var carton40 = 0;
		var qty40 = 0;
		var weight40 = 0;
		var carton40hq = 0;
		var qty40hq = 0;
		var weight40hq = 0;
		
		var boxNo = getInt(document.form1.outerBox.value);
		if (boxNo == 1) {
			carton20 = Math.round(27 / outerCbm);
			qty20 = outerQty * carton20;
			weight20 = carton20 * outerGW;
			carton40 = Math.round(57 / outerCbm);
			qty40 = outerQty * carton40;
			weight40 = carton40 * outerGW;
			carton40hq = Math.round(67 / outerCbm);
			qty40hq = outerQty * carton40hq;
			weight40hq = carton40hq * outerGW;
		}
		else {
			qty20 = Math.round(27 / outerCbm);
			carton20 = outerQty * qty20;
			weight20 = qty20 * outerGW;
			qty40 = Math.round(57 / outerCbm);
			carton40 = outerQty * qty40;
			weight40 = qty40 * outerGW;
			qty40hq = Math.round(67 / outerCbm);
			carton40hq = outerQty * qty40hq;
			weight40hq = qty40hq * outerGW;
		}	

		weight20 = chDeci(weight20, 2);
		weight40 = chDeci(weight40, 2);
		weight40hq = chDeci(weight40hq, 2);

		document.form1.qty20.value = formatOutput(qty20);
		document.form1.carton20.value = formatOutput(carton20);
		document.form1.weight20.value = formatOutput(weight20);
		document.form1.qty40.value = formatOutput(qty40);
		document.form1.carton40.value = formatOutput(carton40);
		document.form1.weight40.value = formatOutput(weight40);
		document.form1.qty40hq.value = formatOutput(qty40hq);
		document.form1.carton40hq.value = formatOutput(carton40hq);
		document.form1.weight40hq.value = formatOutput(weight40hq);
		document.form1.minQty.value = formatOutput(qty40);
	}

}


function calWeight() {
	var outerGW1 = getFloat(document.form1.outerGWm1.value);
	var outerGW2 = getFloat(document.form1.outerGWm2.value);
	var outerGW3 = getFloat(document.form1.outerGWm3.value);
	var outerGW4 = getFloat(document.form1.outerGWm4.value);
	var outerGW = outerGW1 + outerGW2 + outerGW3 + outerGW4;

	var carton20 = getInt(document.form1.carton20.value);
	var carton40 = getInt(document.form1.carton40.value);
	var carton40hq = getInt(document.form1.carton40hq.value);

	var qty20 = getInt(document.form1.qty20.value);
	var qty40 = getInt(document.form1.qty40.value);
	var qty40hq = getInt(document.form1.qty40hq.value);


	var weight20 = 0;
	var weight40 = 0;
	var weight40hq = 0;
	
	var boxNo = getInt(document.form1.outerBox.value);
	if (boxNo == 1) {
		weight20 = carton20 * outerGW;
		weight40 = carton40 * outerGW;
		weight40hq = carton40hq * outerGW;
	}
	else {
		weight20 = qty20 * outerGW;
		weight40 = qty40 * outerGW;
		weight40hq = qty40hq * outerGW;
	}	

	weight20 = chDeci(weight20, 2);
	weight40 = chDeci(weight40, 2);
	weight40hq = chDeci(weight40hq, 2);

	document.form1.weight20.value = weight20;
	document.form1.weight40.value = weight40;
	document.form1.weight40hq.value = weight40hq;
}


function setGrayField() {
	if (document.form1.autoCalculate[0].checked) {
		grayId("innerCbm");
		grayId("innerCuft");

		for (var i=0; i<4; i++) {
			grayId("outerCbm"+(i+1));
			grayId("outerCuft"+(i+1));
		}
	}
	else {
		whiteId("innerCbm");
		whiteId("innerCuft");

		for (var i=0; i<4; i++) {
			whiteId("outerCbm"+(i+1));
			whiteId("outerCuft"+(i+1));
		}
	}
}

function checkBoxDim() {
	var size = document.form1.outerBox.value;

	if (document.form1.outerQty1.value == '') {
		alert("Pls enter outer box 1 qty !");
		return false;
	}
	if (document.form1.outerLm1.value == '' || document.form1.outerWm1.value == '' || document.form1.outerHm1.value == '') {
		alert("Pls enter outer box 1 dim. !");
		return false;
	}

	if (size >= 2) {
		if (document.form1.outerQty2.value == '') {
			alert("Pls enter outer box 2 qty !");
			return false;
		}
		if (document.form1.outerLm2.value == '' || document.form1.outerWm2.value == '' || document.form1.outerHm2.value == '') {
			alert("Pls enter outer box 2 dim. !");
			return false;
		}
	}

	if (size >= 3) {
		if (document.form1.outerQty3.value == '') {
			alert("Pls enter outer box 3 qty !");
			return false;
		}
		if (document.form1.outerLm3.value == '' || document.form1.outerWm3.value == '' || document.form1.outerHm3.value == '') {
			alert("Pls enter outer box 3 dim. !");
			return false;
		}
	}

	if (size >= 4) {
		if (document.form1.outerQty4.value == '') {
			alert("Pls enter outer box 4 qty !");
			return false;
		}
		if (document.form1.outerLm4.value == '' || document.form1.outerWm4.value == '' || document.form1.outerHm4.value == '') {
			alert("Pls enter outer box 4 dim. !");
			return false;
		}
	}

	if (document.form1.innerQty.value != '') {
		if (document.form1.innerLm.value == '' || document.form1.innerWm.value == '' || document.form1.innerHm.value == '') {
			alert("Pls enter inner box dim. !");
			return false;
		}
	}
	if (document.form1.innerLm.value != '' || document.form1.innerWm.value != '' || document.form1.innerHm.value != '') {
		if (document.form1.innerQty.value == '') {
			alert("Pls enter inner box qty !");
			return false;
		}
	}
	
	return true;
}

function calMarkup() {
	var factoryCost = getFloat(document.form1.factoryCost.value);
	var fobPrice = getFloat(document.form1.asPrice.value);

	var markup = eval((fobPrice - factoryCost) * 100 / fobPrice);
	if (fobPrice != 0) {
		markup = chDeci(markup, 2);
	}
	else {
		markup = 0;
	}

	document.form1.markUp.value = markup;
	
}

function AScalFobPrice() {
	var factoryCost = getFloat(document.form1.factoryCost.value);
	var fobPrice = factoryCost * 1.15;
	fobPrice = chDeci(fobPrice, 2);

	document.form1.fobPrice.value = fobPrice;	
}

function AScalFW() {
	var asPrice = getFloat(document.form1.asPrice.value);
	var listCost = asPrice * 0.95;
	var fwPrice = asPrice / 0.8;
	listCost = chDeci(listCost, 2);
	fwPrice = chDeci(fwPrice, 2);

	document.form1.listCost.value = listCost;	
	document.form1.fwPrice.value = fwPrice;	
}

function FWcalAS() {
	var listCost = getFloat(document.form1.listCost.value);
	var factoryCost = listCost;
	var fobPrice = listCost * 1.15;
	fobPrice = chDeci(fobPrice, 2);

	document.form1.factoryCost.value = factoryCost;	
	document.form1.fobPrice.value = fobPrice;	
}

