<!-- hide script from old browsers
function update(theform) {
with(Math)
	{
	var r=parseFloat(theform.r.value);
	var v=parseFloat(theform.v.value);
	var f=parseFloat(theform.f.value);
	var d=parseFloat(theform.d.value);
	var i=parseFloat(theform.i.value);

	var tmp=(v+f+2+1.75*parseInt((d-2)/15));
    if(tmp>="100") {alert ("Variable Cost + Fixed Cost + Financing Cost can not exceed 100%"); return false};
    if(v>"90") {alert ("Variable Cost Percentage can not exceed 90%"); return false};
    if(v<"25") {alert ("Variable Cost Percentage can not be less than 25%"); return false};
    if(f>"60") {alert ("Fixed Cost Percentage can not exceed 60%"); return false};
    if(f<"05") {alert ("Fixed Cost Percentage can not be less than 5%"); return false};
    if(d>"90") {alert ("Number of Days Accounts Receivable is Outstanding can not exceed 90 Days"); return false};
    if(d<"15") {alert ("Number of Days Accounts Receivable is Outstanding can not be less than 15 Days"); return false};
    if(i>"90") {alert ("Invoice Buyer's Advance Payment Percentage can not exceed 90%"); return false};
    if(i<"40") {alert ("Invoice Buyer's Advance Payment Percentage can not be less than 40%"); return false};
	
// Before Tax Net Profit
	var tmp=(100-v-f);
	if (isNaN(tmp)) {tmp="Error"} else {tmp=round(tmp*100)/100};
	theform.z.value=tmp;
// After Tax Net Profit
	var tmp=(0.85*(100-v-f));
	if (isNaN(tmp)) {tmp="Error"} else {tmp=round(tmp*100)/100};
	theform.az.value=tmp;
// A/R Savings 
// (Revenue*Days Outstanding/365)-(Advance*{ Advance Delay Period}/365) +(Rebate*{ Post-Invoice Period+Rebate Delay Period}/365)
	var adv=(r*i/100);
	var reb=((r-adv)-r*(2+1.75*parseInt((d-2)/15))/100);
	var tmp=(r*d/365-(adv*2/365+reb*(d+7)/365));
	var ars=tmp; 
	if (isNaN(tmp)) {tmp="Error"} else {tmp=round(tmp*1)/1};
	theform.a.value=tmp;
// 1st Year Savings for Allowance for Bad Debts
//	var tmp=(0.02*r*v*d/36500); 
	var tmp=0.02*ars;
	if (isNaN(tmp)) {tmp="Error"} else {tmp=round(tmp*1)/1};
	theform.y.value=tmp;
	var tmpy=tmp;
// Working Savings
	var tmp=(r*v*(d+15)/36500-100*((3*v-i)/4/v)*r*v/120000); 
	if (isNaN(tmp)) {tmp="Error"} else {tmp=round(tmp*1)/1};
	theform.w.value=tmp;
// Financing Cost
	var tmp=(r*(-2-1.75*parseInt((d-2)/15))/100);
	if (isNaN(tmp)) {tmp="Error"} else {tmp=round(tmp*1)/1};
	theform.c.value=tmp;
// Corporate Tax Savings
	var tmp=(-0.15*r*(-2-1.75*parseInt((d-2)/15))/100);
	if (isNaN(tmp)) {tmp="Error"} else {tmp=round(tmp*1)/1};
	theform.t.value=tmp;
	var tmpt=tmp;
// Effective Net Profitability
	var tmp=(r*v*(d+15)/36500-100*((3*v-i)/4/v)*r*v/120000+r*(-2-1.75*parseInt((d-2)/15))/100)+tmpt+tmpy;
	var equ=tmp; 
	if (isNaN(tmp)) {tmp="Error"} else {tmp=round(tmp*1)/1};
	theform.p.value=tmp;
// Effective Net Profitability Percentage of Revenue
	var tmp=(100*(theform.p.value)/(theform.r.value));
	if (isNaN(tmp)) {tmp="Error"} else {tmp=round(tmp*100)/100};
	theform.x.value=tmp;
// Effective Net Profitability Percentage of Profits
	var tmp=(100*(100*(theform.p.value)/(theform.az.value)/(theform.r.value)));
	if (isNaN(tmp)) {tmp="Error"} else {tmp=round(tmp*100)/100};
	theform.ax.value=tmp;
// Total Balance Enhancement including A/R
//	var tmp=(r*v*d/36500+r*v*(d+15)/36500-100*((3*v-i)/4/v)*r*v/120000+r*(-2-1.75*parseInt((d-2)/15))/100)+tmpt;
	var tmp=(equ+ars);
	if (isNaN(tmp)) {tmp="Error"} else {tmp=round(tmp*1)/1};
	theform.n.value=tmp;
	}
}

function restart(theform) {

theform.r.value='1200000'
theform.v.value='60'
theform.f.value='30'
theform.d.value='45'
theform.i.value='70'
update(theform);
}

function popUp(page,PWidth,PHeight,id) {
 eval("designerwiz"+id+"=window.open('"+page+"','designerwiz1','toolbar=0,scrollbars=0,location=0,status=0,menubars=0,resizable=0,width="+PWidth+",height="+PHeight+"')")
}
// end hiding script from old browsers -->