function numval(s)
	{ret=1;
	nums="0123456789";
	decimal=0;
	slen=s.length;	
	for (j=0; j<slen; ++j) 
		{chr=s.charAt(j);
		if ((nums.indexOf(chr))<0)
			{if (chr==".") ++decimal;
			else ret=0;
			if (decimal>1) ret=0; 
			}
		}
	if (ret==1) ret=s*1;
	return ret; 
	}
function exp()
	{exptot=0;
	for (i=0; i<12; ++i)
		{t=numval(document.getElementById("exp" + i).value);
		exptot+=t;
		if (t==0) document.getElementById("exp" + i).value=0;
		}
	document.getElementById("tot0").value =exptot;
	document.getElementById("expnote").innerHTML ="<center><b>$" + exptot + " In Monthly Necessity Spending</b></center>Continue with the other worksheets to get your customized Porkjerky.com Debt Program.";
	}
function debt()
	{debttot=0;
	for (i=0; i<16; ++i)
		{t=numval(document.getElementById("debt" + i).value);
		debttot+=t;
		if (t==0) document.getElementById("debt" + i).value=0;
		}
	document.getElementById("tot1").value =debttot;
	document.getElementById("debtnote").innerHTML ="<center><b>$" + debttot + " In Total Debt</b></center>Continue with the other worksheets to get your customized Porkjerky.com Debt Program.";
	
	}
function total(n)
	{tot="<p align=\"center\"><b>Pay your fucking bills you cocksucking piece of shit thief motherfucker.</b></center>"; 
	if (n!=1)
		{tot="After running complex matrix analysis on your monthly spending, current debt balances and income, a customized ";
		tot+="program for avoiding foreclosure, stopping collections and getting out of debt has been created for your situation... &nbsp; ";
		tot+="<a href=\"javascript:void(0);\" onClick=\"total(1);\" class=\"hatelink\">View Financial Plan</a>";
		}
	document.getElementById("totnote").innerHTML =tot;



	}


