	function formatCurrency( a_number ) 
	{
		a_number = '$'+a_number ;
		var l_decimalindex = a_number.lastIndexOf('.') ;

		if( l_decimalindex!=-1 )
			return( a_number.substring(0,l_decimalindex) ) ;
		else
			return( a_number ) ; 
	}

	function calculateDebtRequirements( a_balance , a_monthlypayment ) 
	{	
		var l_estimatedpayment = 0.00 ;	
		var l_estimatedsavings = 0.00 ;

		l_estimatedpayment = a_balance*(0.025) ;
		l_estimatedsavings = a_monthlypayment-l_estimatedpayment ;

		a_balance = formatCurrency( a_balance ) ;
		a_monthlypayment = formatCurrency( a_monthlypayment ) ;
		l_estimatedpayment = formatCurrency( l_estimatedpayment ) ;

		document.write( '<P id=result>Currently, you have an estimated debt of '+a_balance+'<BR>and paying about '+a_monthlypayment+'.</P>' ) ;

		document.write( '<hr size="1" width="625" noshade align="left">' ) ;

		document.write( '<TABLE><TR>' ) ;

		if( a_balance=='$0' )
			document.write( '<TD><H4>Congratulations.</H4>' ) ;
		else
		{
			document.write( '<TD id=texttitle>With Debt-Management.tv,<BR>your ONE AND ONLY<BR>estimated monthly<BR>payment is '+l_estimatedpayment+'.  <BR><BR>' ) ;

			if( l_estimatedsavings>0 )
			{
				l_estimatedsavings = formatCurrency( l_estimatedsavings ) ;
				document.write( '<span id=emptext>You will save '+l_estimatedsavings+' per month, <BR>and be debt free in 48 months.</span>' ) ;
			}
		}	

		document.close();
	}
	