var reksadana = new Array(8)
var NABAwal = new Array(8);
var NABNilai_1 = new Array(8);
var NABNilai_2 = new Array(8);
var tgl_0 = new Array(8);
var tgl_1 = new Array(8);
var tgl_2 = new Array(8);
 
reksadana [0] = "pnmsy4Bln"
NABAwal[0] = 1653.67;
NABNilai_1[0] = 1823.60;
NABNilai_2[0] = 1929.05;
tgl_0[0] = "02 Januari";
tgl_1[0] = "24 Maret";
tgl_2[0] = "28 April";
 
reksadana [1] = "pnmsy12Bln"
NABAwal[1] = 1653.67;
NABNilai_1[1] = 1901.35;
NABNilai_2[1] = 2104.95;
tgl_0[1] = "02 Januari";
tgl_1[1] = "31 Mei";
tgl_2[1] = "28 Desember";
 
reksadana [2] = "pnmas4Bln"
NABAwal[2] = 848.60;
NABNilai_1[2] = 885.25;
NABNilai_2[2] = 900.81;
tgl_0[2] = "02 Januari";
tgl_1[2] = "24 Maret";
tgl_2[2] = "28 April";
 
reksadana [3] = "pnmas12Bln"
NABAwal[3] = 848.60;
NABNilai_1[3] = 912.66;
NABNilai_2[3] = 1003.42;
tgl_0[3] = "02 Januari";
tgl_1[3] = "31 Mei";
tgl_2[3] = "28 Desember";
 
reksadana [4] = "pnmds4Bln"
NABAwal[4] = 830.70;
NABNilai_1[4] = 873.85;
NABNilai_2[4] = 886.57;
tgl_0[4] = "02 Januari";
tgl_1[4] = "24 Maret";
tgl_2[4] = "28 April";
 
reksadana [5] = "pnmds12Bln"
NABAwal[5] = 830.70;
NABNilai_1[5] = 899.86;
NABNilai_2[5] = 983.15;
tgl_0[5] = "02 Januari";
tgl_1[5] = "31 Mei";
tgl_2[5] = "28 Desember";
 
reksadana [6] = "pnmpuas4Bln"
NABAwal[6] = 1585.42;
NABNilai_1[6] = 1624.42;
NABNilai_2[6] = 1654.41;
tgl_0[6] = "02 Januari";
tgl_1[6] = "24 Maret";
tgl_2[6] = "28 April";
 
reksadana [7] = "pnmpuas12Bln"
NABAwal[7] = 1585.42;
NABNilai_1[7] = 1624.42;
NABNilai_2[7] = 1654.41;
tgl_0[7] = "02 Januari";
tgl_1[7] = "24 Maret";
tgl_2[7] = "28 Desember";
 
 
function showInfo() {
var page = document.mathform;
var choice = page.statesList;
 
for (var i = 0; i <= reksadana.length; i++) {
if (choice.options[choice.selectedIndex].value  == reksadana[i]) {
page.NABAwal.value = NABAwal[i];
page.NABNilai_1.value = NABNilai_1[i];
page.NABNilai_2.value = NABNilai_2[i];
page.tgl_0.value = tgl_0[i];
page.tgl_1.value = tgl_1[i];
page.tgl_2.value = tgl_2[i];
break;
}
else {
page.NABAwal.value = "";
page.NABNilai_1.value = "";
page.NABNilai_2.value = "";
page.tgl_0.value = "";
page.tgl_1.value = "";
page.tgl_2.value = "";
      }
   }
}
function update(theform) {
with(Math)
	{
	var NABInvest=parseFloat(theform.NABInvest.value);
	var NABAwal=parseFloat(theform.NABAwal.value);
	var NABNilai_1=parseFloat(theform.NABNilai_1.value);
	var NABNilai_2=parseFloat(theform.NABNilai_2.value);
	var NABBiaya =parseFloat(theform.NABBiaya.value); 
	
		
	var	tmp1 = (NABInvest * 1 + NABBiaya);
	if (isNaN(tmp1)) {tmp1="0"} else {tmp1=round(tmp1*100)/100};
	theform.NABTotal.value=tmp1;
	
	var tmp2 = (NABInvest / NABAwal);
	if (isNaN(tmp2)) {tmp2="0"} else {tmp2=round(tmp2*100)/100};
	theform.NABUnit.value=tmp2;
	
	var tmp3 = (NABNilai_1 * (NABInvest / NABAwal));
	if (isNaN(tmp3)) {tmp3="0"} else {tmp3=round(tmp3*100)/100};
	theform.NABEval_1.value=tmp3;
	
	var tmp4 = ((NABNilai_1 * (NABInvest / NABAwal)) - (NABInvest * 1 + NABBiaya));
	if (isNaN(tmp4)) {tmp4="0"} else {tmp4=round(tmp4*100)/100};
	theform.NABRevenue_1.value=tmp4;
	
	var tmp5 = (((NABNilai_1 * (NABInvest / NABAwal)) - (NABInvest * 1 + NABBiaya)) / (NABInvest * 1 + NABBiaya) * 100);
	if (isNaN(tmp5)) {tmp5="0"} else {tmp5=round(tmp5*100)/100};
	theform.NABResult_1.value=tmp5;
	
	var tmp6 = (NABNilai_2 * (NABInvest / NABAwal));
	if (isNaN(tmp6)) {tmp6="0"} else {tmp6=round(tmp6*100)/100};
	theform.NABEval_2.value=tmp6;
	
	var tmp7 = ((NABNilai_2 * (NABInvest / NABAwal)) - (NABInvest * 1 + NABBiaya));
	if (isNaN(tmp7)) {tmp7="0"} else {tmp7=round(tmp7*100)/100};
	theform.NABRevenue_2.value=tmp7;
	
	var tmp8 = (((NABNilai_2 * (NABInvest / NABAwal)) - (NABInvest * 1 + NABBiaya)) / (NABInvest)) * 100;
	if (isNaN(tmp8)) {tmp8="0"} else {tmp8=round(tmp8*100)/100};
	theform.NABResult_2.value=tmp8;	
	}
}
 
function restart(theform) {
theform.NABInvest.value='100000000'
theform.NABBiaya.Value='1000000'
theform.NABAwal.value=''
theform.NABNilai_1.value=''
theform.NABNilai_2.value=''
update(theform);
}

