function fixDecimal(arg) {
	var str=""+Math.round(eval(arg)*Math.pow(10,2));
	while(str.length<=2){str="0"+str;}
	var decpoint=str.length-2;
	return str.substring(0,decpoint)+"."+str.substring(decpoint,str.length);
}
function computeTotal() {
var plans=new Array(2);for(i=0;i<6;i++){plans[i]=new Array(6);}
 plans[0][0]="Annual Subscription $30+GST/PST"; plans[0][1]= 30; plans[0][2]=1; plans[0][3]=1;
 plans[1][0]="One Panel Ad $125+GST";  plans[1][1]= 125; plans[1][2]=1; plans[1][3]=0;
 plans[2][0]="Two Panel Ad $275+GST";  plans[2][1]= 275; plans[2][2]=1; plans[2][3]=0;
 plans[3][0]="Three Panel Ad $425+GST";  plans[3][1]= 425; plans[3][2]=1; plans[3][3]=0;
 plans[4][0]="Four Panel Ad $575+GST";  plans[4][1]= 575; plans[4][2]=1; plans[4][3]=0;
 plans[5][0]="Five Panel Ad $725+GST";  plans[5][1]= 725; plans[5][2]=1; plans[5][3]=0;
var calcOK=false;
var ordersubtotal=0;
var gstsubtotal=0;
var pstsubtotal=0;
var subtotal=0;
document.form.ordertotal.value="";
document.form.gsttotal.value="";
document.form.psttotal.value="";
document.form.total.value="";
for(i=0;i<6;i++) {
	if(plans[i][0]==document.form.order.value) {
		ordersubtotal=Math.round(plans[i][1]);
		gstsubtotal=plans[i][2]*Math.round(ordersubtotal*7)/100;
		pstsubtotal=plans[i][3]*Math.round(ordersubtotal*8)/100;
	}
}
subtotal=ordersubtotal + gstsubtotal + pstsubtotal;
document.form.ordertotal.value=fixDecimal(ordersubtotal);
document.form.gsttotal.value=fixDecimal(gstsubtotal);
document.form.psttotal.value=fixDecimal(pstsubtotal);
document.form.total.value=fixDecimal(subtotal);
calcOK=true;}
