// JavaScript Document


///////////////////////firstline
function a1_times_b1(form) {
a1=eval(form.a1.value)
b1=eval(form.b1.value)
c1=a1*b1
c1=result=Math.round(c1*100)/100
form.ans1.value=c1
}

function a2_times_ans1(form) {
a2=eval(form.a2.value)
b2=eval(form.ans1.value)
c2=a2*b2
c2=result=Math.round(c2*100)/100
form.ans2.value=c2
}
///////////////////////secondline
function a3_times_b3(form) {
a3=eval(form.a3.value)
b3=eval(form.b3.value)
c3=a3*b3
c3=result=Math.round(c3*100)/100
form.ans3.value=c3
}

function a4_times_ans3(form) {
a4=eval(form.a4.value)
b4=eval(form.ans3.value)
c4=a4*b4
c4=result=Math.round(c4*100)/100
form.ans4.value=c4
}

///////////////////////thirdline
function a5_times_b5(form) {
a5=eval(form.a5.value)
b5=eval(form.b5.value)
c5=a5*b5
c5=result=Math.round(c5*100)/100
form.ans5.value=c5
}

function a6_times_ans5(form) {
a6=eval(form.a6.value)
b6=eval(form.ans5.value)
c6=a6*b6
c6=result=Math.round(c6*100)/100
form.ans6.value=c6
}

///////////////////////fourthline
function a7_times_b7(form) {
a7=eval(form.a7.value)
b7=eval(form.b7.value)
c7=a7*b7
c7=result=Math.round(c7*100)/100
form.ans7.value=c7
}

function a8_times_ans7(form) {
a8=eval(form.a8.value)
b8=eval(form.ans7.value)
c8=a8*b8
c8=result=Math.round(c8*100)/100
form.ans8.value=c8
}

///////////////////////fifthline
function a9_times_b9(form) {
a9=eval(form.a9.value)
b9=eval(form.b9.value)
c9=a9*b9
c9=result=Math.round(c9*100)/100
form.ans9.value=c9
}

function a10_times_ans9(form) {
a10=eval(form.a10.value)
b10=eval(form.ans9.value)
c10=a10*b10
c10=result=Math.round(c10*100)/100
form.ans10.value=c10
}

///////////////////////sixthline
function a11_times_b11(form) {
a11=eval(form.a11.value)
b11=eval(form.b11.value)
c11=a11*b11
c11=result=Math.round(c11*100)/100
form.ans11.value=c11
}

function a12_times_ans11(form) {
a12=eval(form.a12.value)
b12=eval(form.ans11.value)
c12=a12*b12
c12=result=Math.round(c12*100)/100
form.ans12.value=c12
}

////////////////////////total

function a_plus_b(form) {
a2=eval(form.ans2.value)
a4=eval(form.ans4.value)
a6=eval(form.ans6.value)
a8=eval(form.ans8.value)
a10=eval(form.ans10.value)
a12=eval(form.ans12.value)
totala=a2+a4+a6+a8+a10+a12
totala=result=Math.round(totala*100)/100

num = totala.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+
num.substring(num.length-(4*i+3));
totala = (((sign)?'':'-') + '$' + num + '.' + cents);


form.ans13.value = totala
}


function popitup(url) {
	newwindow=window.open(url,'name','height=500,width=650,scrollbars=yes,toolbar=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}