

InitTaal();

//
//
//

var xTaalKode = 0

function getTaal()
{
	var xRet = ""
	xRet = document.getElementById("taal").innerHTML
	return(xRet)
}

function getTaalKode()
{
    var xRet = 0
	if (getTaal() == "nl")
	{
	    xRet = 1
	}
	else if (getTaal() == "fr")
	{
	    xRet = 2
	}
	else if (getTaal() == "en")
	{
	    xRet = 3
	}
	return(xRet)
}

//
//
// Form opbouwen ...
//
//

function pDoel()
{
	if (ie || ns6)
	{
        xTaalKode = getTaalKode()
		xOutput = "&nbsp;<select class='invoer235' size='1' name='iDoel' tabindex='1' onBlur='chkOut()' onChange='chkOut()' onClick='chkOut()'>" 

		for (i = 1; i < tarief.length; i++)
		{
		    xOutput = xOutput + "<option value='" + "" + i + "'>" + tarief[i][xTaalKode] + "</option>";
		}
		xOutput = xOutput + "</select>"
	}
	else
	{
        xTaalKode = getTaalKode()
		xOutput = "&nbsp;<select size='1' name='iDoel' tabindex='1' onBlur='document.frm.iKapitaalEUR.focus();chkOut()' onChange='chkOut()' onClick='chkOut()'>" 

		for (i = 1; i < tarief.length; i++)
		{
		    xOutput = xOutput + "<option value='" + "" + i + "'>" + tarief[i][xTaalKode] + "</option>";
		}
		xOutput = xOutput + "</select>"
	}

	document.write(xOutput);
}

function pKapitaalEur()
{
	if (ie || ns6)
	{
	xOutput = "<input class='invoer85' type='text' name='iKapitaalEUR' size='10' value='0,00' tabindex='2' onblur='this.form.iKapitaalEUR.value=fn(this.form.iKapitaalEUR.value,2);chkOut();' onfocus='this.select()' onChange='chkOut()' onkeypress='Wissen()' >";
	}
	else
	{
	xOutput = "<input type='text' name='iKapitaalEUR' size='10' value='0,00' tabindex='2' onblur='document.frm.iKapitaalEUR.value=fn(document.frm.iKapitaalEUR.value,2);chkOut();' onfocus='this.select()' onChange='chkOut()'>";
	}
	document.write(xOutput);
}

function pLooptijd()
{
	if (ie || ns6)
	{
	xOutput = "<input class='invoer50' type='text' name='iLooptijd' tabindex='3' size='10' value='0' onBlur='this.form.iDoel.focus();chkOut()' onChange='chkOut()' onFocus='this.select()' onkeypress='Wissen()'>";
	}
	else
	{
	xOutput = "<input type='text' name='iLooptijd' tabindex='3' size='5' value='0' onBlur='chkOut()' onFocus='this.select()'>";
	}
	document.write(xOutput);
}

function pMaxLooptijd()
{
	if (ie || ns6)
	{
	xTekst = ls[10]
	xTekst = xTekst + "<br>"
	xTekst = xTekst + ls[11]
	xTekst = xTekst + "<br>"
	xTekst = xTekst + ls[12]
	xOutput = "<div id='maxlooptijd' class='tekstzn'>" + xTekst + "</div>";
	}
	else
	{
	xOutput = "&nbsp;";
	}
	document.write(xOutput);
}

function pJRentevoet()
{
	if (ie || ns6)
	{
	xOutput = "<div id='iJRentevoet' class='invoer50'>&nbsp;0,00</div>";
	}
	else
	{
	xOutput = "<input type='text' name='iJRentevoet' tabindex='5' size='7' value='0' onBlur='chkOut()' onChange='chkOut()' onFocus='this.select()'>";	
	}
	document.write(xOutput);
}

function pPmtEur()
{
	if (ie || ns6)
	{
	xOutput = "<div id='iPmtEur' class='invoer85'>&nbsp;</div>";
	}
	else
	{
	xOutput = "<input type='text' name='iPmtEur' size='10' value='0,00' tabindex='8' onblur='chkOut();' onfocus='chkOut()'";	
	}
	document.write(xOutput);
}

//

function btnBerekenen()
{
	if (ie || ns6)
	{
	xOutput = "<input class='invoerbutton80' type='button' value='Berekenen' name='btnWissen' tabindex='6' onclick='chkOut()'>";
	}
	else
	{
	xOutput = "<input type='button' value='Berekenen' name='btnWissen' tabindex='6' onclick='chkOut()'>";
	}
	document.write(xOutput);
}

function btnAfdruk()
{
	xOutput = "<input class='invoerbutton' type='button' value='Afdruk tabel' name='btnAfdruk' tabindex='5' onClick='AfdrukTabel()';>";
	document.write(xOutput);
}

function btnWissen()
{
	if (ie || ns6)
	{
	xOutput = "<input class='invoerbutton' type='button' value='Herbeginnen' name='btnWissen' tabindex='6' onclick='Wissen()'>";
	}
	else
	{
	xOutput = "<input type='button' value='Herbeginnen' name='btnWissen' tabindex='6' onclick='Wissen()'>";
	}
	document.write(xOutput);
}

// tekst looptijden ...

function piInfoHoofding()
{
	if (ie || ns6)
	{
	    xOutput = "<div class='tekstz'><u>" + ls[13] + "</u><br>" + ls[14] + "</div>"
	}
	else
	{
	    xOutput = "";
	}
	document.write(xOutput);
}

function piInfo()
{
	if (ie || ns6)
	{
	    xOutput = "<div id='iInfo' class='tekstz'>&nbsp;</div>";
	}
	else
	{
	    xOutput = "<div id='xInfo' class='tekstz'>&nbsp;</div>";
	}
	document.write(xOutput);
}

// bullet ...

function pBullet()
{
	if (ie)
	{
	xOutput = "<IMG src='bmp_bullet_rood.gif' border=0 width='12' height='12'>"
	}
	else
	{
	xOutput = "";
	}
	document.write(xOutput);
}

// favorieten ?

function pFavorieten()
{
	if (ie)
	{
	xOutput = "<a class=tekstb href='javascript:register()'>Toevoegen aan favorieten</a>"
	}
	else
	{
	xOutput = "";
	}
	document.write(xOutput);
}

// datum onderaan ...

function piDatum()
{
	if (ie || ns6)
	{
	xOutput = "<div id='iDatum' class='voettekst'>&nbsp;</div>";
	}
	else
	{
	xOutput = "<div id='xDatum' class='voettekst'>&nbsp;</div>";
	}
	document.write(xOutput);
}

// Bij opstart ...

function setFocus()
{
	document.frm.iDoel.focus()
}

//

function getSelectValue(selectObject)
{
	return selectObject.options[selectObject.selectedIndex].value
}

//
// end form 
//
//
// Berekening afbetaling ...
//

function chkOut()
{

	xMin = 0;
	xMax = 0;

	xFormule = cn(getSelectValue(document.frm.iDoel));
	xKapitaal = cn(document.frm.iKapitaalEUR.value);
	
	document.frm.iKapitaalEUR.value = fn(xKapitaal,2);
	
	// Controle kapitaal ...
	
	xMin = parseFloat(tarief[xFormule][0].substr(34,6));
	xMinimumKap = fn(xMin,2)
	
	xMax = parseFloat(tarief[xFormule][0].substr(42,6));
	
    //

	if (xKapitaal == 0)
    { 	
        xKapitaal = cn(xMinimumKap)
		document.frm.iKapitaalEUR.value = fn(xMin,2);
	}	
	else if (xKapitaal > 0 && xKapitaal < xMin)
	{
	    xKapitaal = cn(xMinimumKap)
		document.frm.iKapitaalEUR.value = fn(xMin,2);
	}
	else if (xKapitaal > 0 && xKapitaal > xMax)
	{
	    
	    xKapitaal = xMax
		document.frm.iKapitaalEUR.value = fn(xMax,2)
	}
	
	//
	// Controle looptijd ...
	//

	xMin = parseFloat(tarief[xFormule][0].substr(29,3));
	xMax = MaximaleLooptijd(xKapitaal, xFormule)

	// Tekst info kapitaal en looptijd ...		

    xTekst = ""
	xTekst = ls[15] + xMinimumKap + " EUR"
	xTekst = xTekst + "<br>"
	xTekst = xTekst + ls[16] + xMin + ls[18]
	xTekst = xTekst + "<br>"
	xTekst = xTekst + ls[17] + xMax + ls[18]
	
	if (ie)
	{
		document.all.maxlooptijd.innerHTML = xTekst;
	}
	else if (ns6)
	{
		document.getElementById("maxlooptijd").innerHTML = xTekst;
	}

	// Eventueel looptijd aanpassen ...
	
	if (cn(document.frm.iLooptijd.value) > xMax)
	{
		document.frm.iLooptijd.value = "" + xMax
	}
	
	if (cn(document.frm.iLooptijd.value) < xMin)
	{
		document.frm.iLooptijd.value = "" + xMax
	}

	// Controle tarief ...

	xKapitaal = cn(document.frm.iKapitaalEUR.value);
	xAantal = cn(document.frm.iLooptijd.value);
	t = BasisTarief(xFormule, xKapitaal, xAantal);

    //
    //
	
	if (ie)
	{
		document.all.iJRentevoet.innerHTML = "&nbsp;" + fp(t,2);
	}
	else if (ns6)
	{
		document.getElementById("iJRentevoet").innerHTML = "&nbsp;" + fp(t,2);
	}
	else
	{
		document.frm.iJRentevoet.value = "" + fp(t,2);
	}
	
	// pmt berekenen
	
	xKapitaal = cn(document.frm.iKapitaalEUR.value)
	xLooptijd = cn(document.frm.iLooptijd.value)
	e = loa_pmt(xKapitaal, t, xLooptijd)

	// afdruk ...

	if (ie)
	{
		document.all.iPmtEur.innerHTML = "&nbsp;" + fn(e,2);
	}
	else if (ns6)
	{
		document.getElementById("iPmtEur").innerHTML = "&nbsp;" + fn(e,2);
	}	
	else
	{
		document.frm.iPmtEur.value = "" + fn(e,2);
	}
	
	//
	// Andere looptijden ...
	//
	
	k = "";
	r = 0;
	
	xKapitaal = cn(document.frm.iKapitaalEUR.value);
	xMin = parseFloat(tarief[xFormule][0].substr(29,3));
	xMax = MaximaleLooptijd(xKapitaal, xFormule)
	
	t = BasisTarief(xFormule, xKapitaal, xAantal);
	
	k = ""
	k = k + "<table border='0' width='100%'>"
	
	for (i = xMin; i <= xMax; i=i+6)
	{
	
        if (i > 48 && i < 60)
        {
			i = 60;
        }
        
        if (i > 60 && i < 84)
        {
        	i = 84;
        }
        
        if (i > 84 && i < 120)
        { 
        	i = 120;
        }

        if (i > 120 && i < 240)
        { 
        	i = 240;
        }


		t = BasisTarief(xFormule, xKapitaal, i);
		r = loa_pmt(xKapitaal, t, i)
		
		//

        if (ie || ns6)
        {
	        k = k + "<tr>"
	        k = k + "<td width='50%' class='tekstz' style='border-bottom:1px solid peru'>" + "<img border='0' src='images/bmp_bullet_vierkant.gif' WIDTH='8' HEIGHT='8'>" + "&nbsp;" + i + "&nbsp;" + ls[42] + "</td>"
	        k = k + "<td width='2%' class='tekstz'>&nbsp;=&nbsp;</td>"
	        k = k + "<td width='48%' align='right' class='tekstz' style='border-bottom:1px solid peru'>" + fn(r,2) + " " + "EUR" + "</td>"
	        k = k + "</tr>"
        }
        else
        {
	        k = k + "<tr>"
	        k = k + "<td width='100%' class='tekstz'>" + "<img border='0' src='images/bmp_bullet_vierkant.gif' WIDTH='8' HEIGHT='8'>" + "&nbsp;" + i + "&nbsp;" + ls[42] + " = "
	        k = k + " " + fn(r,2) + " " + "EUR" + "</td>"
	        k = k + "</tr>"
        }
	}

	k = k + "</table>"
	
	if (ie)
	{
		document.all.iInfo.innerHTML = k 
	}
	else if (ns6)
	{
		document.getElementById("iInfo").innerHTML = k 
	}	
}

//
//
//

function loa_pmt(wKapitaal, wRentevoet, wLooptijd)
{
	// maandrentevoet 
	xTarief = Math.pow(1 + (wRentevoet/100),1/12) - 1
		
	// aantal betalingen
	xAantal = wLooptijd;
	
	// mensualiteit
	xPmt = wKapitaal * (xTarief / (1 - Math.pow(1 + xTarief,-xAantal)));
		
	return(xPmt)
}

//
//
//

function Wissen()
{
	document.all.iJRentevoet.innerHTML = "0,00"
    document.all.iPmtEur.innerHTML = "0,00"
    
   	if (ie)
	{
		document.all.iInfo.innerHTML = "" 
	}
	else if (ns6)
	{
		document.getElementById("iInfo").innerHTML = "" 
	}	
}


function chkWissen()
{
	document.frm.iKapitaalEUR.value = "0,00";
	document.frm.iLooptijd.value = "0";
	document.all.iJRentevoet.innerHTML = "0,00"
    document.all.iPmtEur.innerHTML = "0,00"

	xMin = 0;
	xFormule = cn(getSelectValue(document.frm.iDoel));
	xMin = parseFloat(tarief[xFormule][0].substr(34,6));
	xMinimumKap = fn(xMin,2)

	// Tekst info kapitaal en looptijd ...		

    xTekst = ""
	xTekst = ls[15] + xMinimumKap + " EUR"
	xTekst = xTekst + "<br>"
	xTekst = xTekst + ls[11]
	xTekst = xTekst + "<br>"
	xTekst = xTekst + ls[12]
	
    if (ie)
	{
		document.all.maxlooptijd.innerHTML = xTekst
	}
	else if (ns6)
	{
		document.getElementById("maxlooptijd").innerHTML = xTekst
	}	
	
	if (ie)
	{
		document.all.iInfo.innerHTML = "" 
	}
	else if (ns6)
	{
		document.getElementById("iInfo").innerHTML = "" 
	}	
}

//
// Afdruk op papier ...
//

function chkAfdrukken()
{

    chkOut();

    //
    //

    var m = 0
    var d = ""
    var k = 0

	m = getSelectValue(document.frm.iDoel);
    d = tarief[m][xTaalKode];
    d = d.toLowerCase();
    
    //
    //	

    nw = window.open("","","toolbar=yes,status=no,menubar=no,scrollbars=yes,alwaysraised=yes,width=700,height=450")

    nw.document.write("<html>");
    nw.document.write("<head>");
    nw.document.write("<title>" + ls[41] + "</title>");
    nw.document.write("<LINK href='css/afdruk.css' rel=stylesheet>");
    nw.document.write("<style TYPE='text/css'></style>");
    nw.document.write("<script Language='JavaScript' src='../_dev/devNorightClick.js'></script>");
    nw.document.write("</head>");

    nw.document.write("<body bgcolor='#FFFFFF' leftmargin='25' oncontextmenu='cutBubble()' onselectstart='cutBubble()'>");

    nw.document.write("<table border='0' style='border-right:2px dotted silver' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width='625'>");
    nw.document.write("<tr>");
    nw.document.write("<td width='100%' valign='top'>");

		// hoofding

  	    nw.document.write("<table border='0' width='585' cellspacing='0' cellpadding='0'>");

	    nw.document.write("<tr>");
	    nw.document.write("<td width='60%' valign='top'><img border='0' src='images/citibank_logo.gif' width='122' height='32'></td>");
	    nw.document.write("<td width='40%' rowspan='2' align='right'><img border='0' src='images/bmp_loa.gif' width='171' height='111'></td>");
	    nw.document.write("</tr>");
	    nw.document.write("<tr>");
	    
	   	nw.document.write("<tr>");
	    nw.document.write("<td width='60%' valign='bottom' class='titelu'>" + ls[23] + "</td>");
	    nw.document.write("</tr>");

	    nw.document.write("</table>");
  
  		//
  
        nw.document.write("<br>");
        nw.document.write("<br>");
        nw.document.write("<br>");
        nw.document.write("<table border='1' style='border-collapse:collapse' style='border:2px solid silver' cellspacing='1' style='border-collapse: collapse' bordercolor='#C0C0C0' width='500' cellpadding='2'>");
        nw.document.write("<tr>");
        nw.document.write("<td width='500' colspan='3' height='30' bgcolor='#F0F8FF'>&nbsp;" + ls[24] + "&nbsp;" + d + "</td>");
        nw.document.write("</tr>");
        nw.document.write("<tr>");
        nw.document.write("<td width='250'>");
        nw.document.write("<table border='0' cellspacing='1' style='border-collapse: collapse' bordercolor='#111111' width='100%'>");
        nw.document.write("<tr>");
        nw.document.write("<td width='10%'><img src='images/bmp_bullet.gif' width='12' height='12'></td>");
        nw.document.write("<td width='90%'>" + ls[25] + "</td>");
        nw.document.write("</tr>");
        nw.document.write("</table>");
        nw.document.write("</td>");
        nw.document.write("<td width='150' align='right'>&nbsp;" + fn(xKapitaal,2) + " EUR.</td>");
        nw.document.write("<td width='100'>&nbsp;</td>");
        nw.document.write("</tr>");
        nw.document.write("<tr>");
        nw.document.write("<td width='250'>");
        nw.document.write("<table border='0' cellspacing='1' style='border-collapse: collapse' bordercolor='#111111' width='100%'>");
        nw.document.write("<tr>");
        nw.document.write("<td width='10%'><img src='images/bmp_bullet.gif' width='12' height='12'></td>");
        nw.document.write("<td width='90%'>" + ls[26] + "</td>");
        nw.document.write("</tr>");
        nw.document.write("</table>");
        nw.document.write("</td>");
        nw.document.write("<td width='150' align='right'>&nbsp;" + fn(xLooptijd,0) + ls[18] + ".</td>");
        nw.document.write("<td width='100'>&nbsp;</td>");
        nw.document.write("</tr>");
        nw.document.write("<tr>");
        nw.document.write("<td width='250'>");
        nw.document.write("<table border='0' cellspacing='1' style='border-collapse: collapse' bordercolor='#111111' width='100%'>");
        nw.document.write("<tr>");
        nw.document.write("<td width='10%'><img src='images/bmp_bullet.gif' width='12' height='12'></td>");
        nw.document.write("<td width='90%'>" + ls[27] + "</td>");
        nw.document.write("</tr>");
        nw.document.write("</table>");
        nw.document.write("</td>");
        nw.document.write("<td width='150' align='right'>&nbsp;" + fp(t,2) + " %.</td>");
        nw.document.write("<td width='100'>&nbsp;</td>");
        nw.document.write("</tr>");
        nw.document.write("<tr>");
        nw.document.write("<td width='250' bgcolor='#FFFFF0'>");
        nw.document.write("<table border='0' cellspacing='1' style='border-collapse: collapse' bordercolor='#111111' width='100%'>");
        nw.document.write("<tr>");
        nw.document.write("<td width='10%'><img src='images/bmp_bullet.gif' width='12' height='12'></td>");
        nw.document.write("<td width='90%'>" + ls[28] + "</td>");
        nw.document.write("</tr>");
        nw.document.write("</table>");
        nw.document.write("</td>");
        nw.document.write("<td width='150' bgcolor='#FFFFF0' align='right'>&nbsp;" + fn(e,2) + " EUR.</td>");
        nw.document.write("<td width='100' bgcolor='#FFFFF0'>&nbsp;</td>");
        nw.document.write("</tr>");
        nw.document.write("</table>");
        nw.document.write("<br><br>");

        e = e*100
        e = Int(e)
        e = e /100
        xTotaal = roundit(e * xLooptijd, 2)
        xInteresten = roundit(xTotaal - xKapitaal, 2)
        
        nw.document.write("<table border='1' style='border-collapse:collapse' style='border:2px solid silver' cellspacing='1' style='border-collapse: collapse' bordercolor='#C0C0C0' width='500' cellpadding='2'>");
        nw.document.write("<tr>");
        nw.document.write("<td width='500' colspan='3' bgcolor='#F0F8FF'>");
        nw.document.write("<table border='0' cellspacing='1' style='border-collapse:collapse' bordercolor='#111111' width='100%' bordercolorlight='#C0C0C0' bordercolordark='#C0C0C0'>");
        nw.document.write("<tr>");
        nw.document.write("<td width='5%' height='30'><img border='0' src='images/bmp_info.gif' width='20' height='20'> </td>");
        nw.document.write("<td width='95%' height='30'>" + ls[29] + "</td>");
        nw.document.write("</tr>");
        nw.document.write("</table>");
        nw.document.write("</td>");
        nw.document.write("</tr>");
        nw.document.write("<tr>");
        nw.document.write("<td width='250'>");
        nw.document.write("<table border='0' cellspacing='1' style='border-collapse: collapse' bordercolor='#111111' width='100%'>");
        nw.document.write("<tr>");
        nw.document.write("<td width='10%'><img src='images/bmp_bullet.gif' width='12' height='12'></td>");
        nw.document.write("<td width='90%'>" + ls[30] + "</td>");
        nw.document.write("</tr>");
        nw.document.write("</table>");
        nw.document.write("</td>");
        nw.document.write("<td width='150' align='right'>&nbsp;" + fn(xKapitaal,2) + " EUR</td>");
        nw.document.write("<td width='100'>&nbsp;</td>");
        nw.document.write("</tr>");
        nw.document.write("<tr>");
        nw.document.write("<td width='250' style='border-bottom:2px solid tan'>");
        nw.document.write("<table border='0' cellspacing='1' style='border-collapse: collapse' bordercolor='#111111' width='100%'>");
        nw.document.write("<tr>");
        nw.document.write("<td width='10%'><img src='images/bmp_bullet.gif' width='12' height='12'></td>");
        nw.document.write("<td width='90%'>" + ls[31] + "</td>");
        nw.document.write("</tr>");
        nw.document.write("</table>");
        nw.document.write("</td>");
        nw.document.write("<td width='150' align='right' style='border-bottom:2px solid tan'>&nbsp;" + fn(xInteresten, 2) + " EUR</td>");
        nw.document.write("<td width='100' style='border-bottom:2px solid tan'>&nbsp;</td>");
        nw.document.write("</tr>");
        nw.document.write("<tr>");
        nw.document.write("<td width='250' bgcolor='#FFFFF0'>");
        nw.document.write("<table border='0' cellspacing='1' style='border-collapse: collapse' bordercolor='#111111' width='100%'>");
        nw.document.write("<tr>");
        nw.document.write("<td width='10%'><img src='images/bmp_bullet.gif' width='12' height='12'></td>");
        nw.document.write("<td width='90%'>" + ls[32] + "</td>");
        nw.document.write("</tr>");
        nw.document.write("</table>");
        nw.document.write("</td>");
        nw.document.write("<td width='150' bgcolor='#FFFFF0' align='right'>&nbsp;" + fn(xTotaal,2) + " EUR</td>");
        nw.document.write("<td width='100' bgcolor='#FFFFF0'>&nbsp;</td>");
        nw.document.write("</tr>");
        nw.document.write("</table>");
        
        nw.document.write("<br>");
        nw.document.write("<br>");
        
        //
        // Andere looptijden ...
        //
        
        nw.document.write("<table border='1' style='border-collapse:collapse' style='border:2px solid silver' style='border-collapse: collapse' bordercolor='#C0C0C0' width='500' cellpadding='2'>");

        nw.document.write("<tr>");
        nw.document.write("<td width='500' colspan='4' bgcolor='#F0F8FF'>");
            nw.document.write("<table border='0' cellpadding='1' style='border-collapse:collapse' bordercolor='#111111' width='100%' bordercolorlight='#C0C0C0' bordercolordark='#C0C0C0'>");
            nw.document.write("<tr>");
            nw.document.write("<td width='5%' height='30'><img border='0' src='images/bmp_info.gif' width='20' height='20'> </td>");
            nw.document.write("<td width='95%' height='30'>" + ls[33] + "</td>");
            nw.document.write("</tr>");
            nw.document.write("</table>");
        nw.document.write("</td>");
        nw.document.write("</tr>");

        nw.document.write("<tr>");
        nw.document.write("<td width='95'  align='right' style='border-bottom:2px solid tan;background:ivory;'>" + ls[36] + "</td>");
        nw.document.write("<td width='115' align='right' style='border-bottom:2px solid tan;background:ivory;'>" + ls[34] + "<br>" + ls[35] + "</td>");
        nw.document.write("<td width='120' align='right' style='border-bottom:2px solid tan;background:ivory;'>" + ls[43] + "<br>" + ls[44] + "</td>");
        nw.document.write("<td width='70'  align='right' style='border-bottom:2px solid tan;background:ivory;'>" + ls[45] + "&nbsp;&nbsp;</td>");
        nw.document.write("</tr>");

        //

	    xKapitaal = cn(document.frm.iKapitaalEUR.value);
	    xMin = parseFloat(tarief[xFormule][0].substr(29,3));
	    xMax = MaximaleLooptijd(xKapitaal, xFormule)
    	
	    t = BasisTarief(xFormule, xKapitaal, xAantal);
    	
	    for (i = xMin; i <= xMax; i=i+6)
	    {
    	
            if (i > 48 && i < 60)
            {
			    i = 60;
            }
            
            if (i > 60 && i < 84)
            {
        	    i = 84;
            }
            
            if (i > 84 && i < 120)
            { 
        	    i = 120;
            }
    		
    		if (i > 120 && i < 240)
            { 
        	    i = 240;
            }
    		
		    t = BasisTarief(xFormule, xKapitaal, i);
    		
		    //

		    r = loa_pmt(xKapitaal, t, i)
		    
		    //
		    
		    r = r*100
            r = Int(r)
            r = r /100
            k = roundit(r * i, 2)
		    
		    //
		    //
		    nw.document.write("<tr>");
            nw.document.write("<td width='95' align='right'>" + fn(i,0) + ls[18] + "</td>");
            nw.document.write("<td width='115' align='right'>" + fn(r,2) + " EUR</td>");
            nw.document.write("<td width='120' align='right'>" + fn(k,2) + " EUR</td>");
            nw.document.write("<td width='70' align='right'>" + fn(t,2) + "%&nbsp;&nbsp;</td>");
            nw.document.write("</tr>");
		    //
		    //
		    
	    }

        nw.document.write("</table>");        

	    // voettekst

	    nw.document.write("<br><br><br>");
    	
	    var xVoettekst = createVoettekst()	
    	
	    nw.document.write("<table border='0' width='585' cellspacing='0' cellpadding='0'><tr><td width='100%' class='voettekst' style='border-top:1px solid tan'>" + xVoettekst + "</td></tr></table>");
	    nw.document.write("<br><br>");
        

    nw.document.write("</td>");
    nw.document.write("</tr>");
    nw.document.write("</table>");

    nw.document.write("</body>");

    nw.document.write("</html>");

}


//
// Algemene functies ...
//

function roundit(Number,NumDigitsAfterDecimal)
{
    var xRet = 0
    xRet = Int(0.5 + Number * (Math.pow(10,NumDigitsAfterDecimal))) / (Math.pow(10,NumDigitsAfterDecimal))
    return(xRet)
}

function Int(x)
{
  return Math.floor(x+(x < 0 ? 1 : 0))
}

//
// Reactie combobox ...

function getSelectValue(selectObject)
{
	return selectObject.options[selectObject.selectedIndex].value
}

//
//

function fn(val, dec)  
{
	val = replace(val+""," ","");
	val = replace(val+"",",",".");

	if (isNaN(parseFloat(val)))
	{
		if (dec==2)
		{
			return ("0,00");
	  } 
	  else 
	  {
			return ("0");
	  }    

	} 
	else 
	{
		if (val != "")
		{
	    val=""+val;
	    if (val.indexOf (".", 0)!=-1) 
	    {
	    	valuta = val.substring(0, val.indexOf (".", 0));
				cents = val.substring(val.indexOf (".", 0)+1, val.indexOf (".", 0)+3);
				if (cents.length==0 && dec==2) 
					cents="00";
				if (cents.length==1 && dec==2)
					cents=cents+"0";
				if (cents.length>=3 && dec==2)			
					cents = val.substring(val.indexOf (".", 0)+1, val.indexOf (".", 0)+3);
				if (dec==0) 
					cents="";
			} 
			else 
			{
		  	valuta = val
		  	if (dec==2) 
	    	{
				cents = "00";
			} 
			else 
			{
				cents = "";
			}
	    }
	        
	    outstr="";
	    len=valuta.length;

	    if (len>=3) 
	    {
				while (len>0) 
				{
					tempstr=valuta.substring(len-3, len)
	                
	    		if (tempstr.length==3) 
	    		{
	    			if (len-3==0)
	    			{
                      outstr=tempstr+outstr;
                      len=len-3;
	    			} 
	    			else 
	    			{
                      outstr=" "+tempstr+outstr;
                      len=len-3;
					}
	        } 
	        else 
	        {
              outstr=tempstr+outstr;
              len=0;
	        }
				}       
				valuta=outstr;
	    } 
	    if (dec==2)
	    {
		    return (valuta+","+cents);
	    } 
	    else 
	    {
		    return (valuta);
	    }    

		} 
		else 
		{
          if (dec==2)
          {
           	return ("0,00");
          } 
          else 
          {
			return ("0");
          }    
		}

	} // end endif

} // end function 

//
//
//

function fp(val, dec)  
{
	
	if (isNaN(parseFloat(val)))
	{
		if (dec==2)
		{
			return ("0,00");
	  } 
	  else 
	  {
			return ("0");
	  }    
	} 
	else 
	{
		if (val != "")
		{
	    val=""+val;
	    if (val.indexOf (".", 0)!=-1) 
	    {
	    	valuta = val.substring(0, val.indexOf (".", 0));
				cents = val.substring(val.indexOf (".", 0)+1, val.indexOf (".", 0)+3);
				
				if (cents.length==0 && dec==2) 
					cents="00";
				if (cents.length==1 && dec==2)
					cents=cents+"0";
				if (cents.length>=3 && dec==2)			
					cents = val.substring(val.indexOf (".", 0)+1, val.indexOf (".", 0)+3);
				if (dec==0) 
					cents="";
			} 
			else 
			{
		  	valuta = val
		  	if (dec==2) 
	    	{
	            cents = "00";
            } 
            else 
            {
	            cents = "";
            }
	    }
		  return (valuta+","+cents);
		} 
		else 
		{
			if (dec==2)
			 {
			   return ("0,00");
			 } 
			 else 
			 {
			   return ("0");
			 }    
		}

	} // end endif

} // end function 

//
//

function isNumber(xw)
{
	var anum=/(^\d+$)|(^\d+\.\d+$)/
	if (anum.test(xw))
	result=true
	else result=false;
	return (result)
}

//

function replace(txt,z,r)
{
 if (z != r && z.length > 0 )
 {
  result = txt.indexOf(z,0);
  while (result >= 0)
  {
   txt =  txt.substr(0,result)+r+txt.substr(result+z.length,txt.length); 
   result = txt.indexOf(z,0);
  }
 }
 return txt;
}

//

function cn(w)
{
	x = replace(w," ","");
	x = parseFloat(replace(x+"",",","."));
	
	if(isNaN(x)) 
	{
		return(0)
	} 
	else 
	{
		return(x)
	}
}


//
// Hulpfuncties, specifiek loa ...
//

function BasisTarief(vFormule, vKapitaal, vAantal) {
	var RetVal = ""
	var n = 0

    if (vFormule == 1)
    {
        if (vKapitaal >= 1 && vKapitaal < 7500) 
        {
            RetVal = tarief[vFormule][0].substr(3,5);
	    }

        if (vKapitaal >= 7500 && vKapitaal < 12500) 
        {
            RetVal = tarief[vFormule][0].substr(10,5);
	    }

        if (vKapitaal >= 12500) 
        {
            RetVal = tarief[xFormule][0].substr(17,5);
	    }
	}
	else if (vFormule == 3)
	{
	    if (vKapitaal <= 1250) 
        {
            RetVal = 15 + ""
	    }
	    
	    if (vKapitaal > 1250 && vKapitaal <= 5000) 
        {
            RetVal = 15 + ""
	    }
	    
        if (vKapitaal > 5000) 
        {
            RetVal = 11.5 + ""
	    }
	}
    else 
    {
        if (vKapitaal >= 1 && vKapitaal < 7500) 
        {
            RetVal = tarief[vFormule][0].substr(3,5);
	    }

        if (vKapitaal >= 7500 && vKapitaal < 12500) 
        {
            RetVal = tarief[vFormule][0].substr(10,5);
	    }

        if (vKapitaal >= 12500) 
        {
            RetVal = tarief[xFormule][0].substr(17,5);
	    }
	}
    
    x = parseFloat(replace(RetVal,"\,","."));
	return(x);
	
}

//
//
//

function WettelijkTarief(nKapitaal, nAantal)
{



}

//


function chkTarief(xcode)
{
  if (xcode == 13)
  {
  	chkOut();	
  }
  else
  {
  	if (ie)
  	{
  		document.all.iJRentevoet.innerHTML = "&nbsp;0,00";
  	}
  	else if (ns6)
  	{
  		document.getElementById("iJRentevoet").innerHTML = "&nbsp;0,00";
  	}
  }
}

//

function MaximaleLooptijd(vKapitaal, vFormule)
{
    RetVal = 0;
    xBeperkingDuur = 0;

    if (vKapitaal > 0 && vKapitaal <= 500) 
    {
      RetVal = 18;
    }
    else if (vKapitaal > 500 && vKapitaal <= 2500) 
    {
      RetVal = 24;
    }
    else if (vKapitaal > 2500 && vKapitaal <= 3700) 
    {
      RetVal = 30;
    }
    else if (vKapitaal > 3700 && vKapitaal <= 5600) 
    {
      RetVal = 36;
    }
    else if (vKapitaal > 5600 && vKapitaal <= 7500) 
    {
      RetVal = 42;
    }
    else if (vKapitaal > 7500 && vKapitaal <= 10000) 
    {
      RetVal = 48;
    }
    else if (vKapitaal > 10000 && vKapitaal <= 15000) 
    {
      RetVal = 60;
    }
    else if (vKapitaal > 15000 && vKapitaal <= 20000) 
    {
      RetVal = 84;
    }
    else if (vKapitaal > 20000 && vKapitaal <= 37000) 
    {
      RetVal = 120;
    }
    else if (vKapitaal > 37000) 
    {
      RetVal = 240;
    }

    //
    // Controle op minder ingestelde maximale looptijd.
    //

    xBeperkingDuur = parseFloat(tarief[vFormule][0].substr(24,3));
       
    if (xBeperkingDuur < RetVal)
    {
        RetVal = xBeperkingDuur
    }

    //

    return(RetVal)
}

//
//
//

//
// Informatie iconen ...
//

function TaskInfo(x)
{
	if (x == 1)
	{
		document.all.xInfo.innerHTML = ls[19]
	}
	else if (x == 2)
	{
		document.all.xInfo.innerHTML = ls[20]
	}
	else if (x == 3)
	{
		document.all.xInfo.innerHTML = ls[21]
	}
	else if (x == 4)
	{
		document.all.xInfo.innerHTML = ls[22]
	}
}

//
// Verberg info  iconen 
//

function KillTaskInfo()
{
	window.status = ""

	if (ie)
	{
		document.all.xInfo.innerHTML = ""
	}
	else if (ns6)
	{
		document.getElementById("xInfo").innerHTML = ""
	}
}

function hidestatus()
{
	window.status=""
	return true
}

//
// Voettekst aanmaken ...
//

function createVoettekst()
{
	var xt = tarief[0][0]

	
	wTekst = ls[38]
	wTekst = wTekst + ls[39] + "&nbsp;&nbsp;"

	var d = new Date()
	var xd = ""
	var dag = 0
	var maand = 0
	var jaar = 0
	
	// dag 
	
	dag = d.getDate()
	
	if (dag < 10) 
	{
		xd = "0" + dag + "/"
	}
	else
	{
		xd = dag + "/"
	}
	
	// maand 
	
	maand = d.getMonth() + 1
	
	if (maand < 10) 
	{
		xd = xd + "0" + maand + "/"
	}
	else
	{
		xd = xd + maand + "/"
	}
	
	// jaar 
	
	jaar = d.getFullYear()
	xd = xd + jaar
	
	//
	
	wTekst = wTekst + ls[40] + xd + "." + "<br>"
	xTekst = wTekst + "© TriView@"
	
	return(wTekst)
}

//

function xGetLijnTarief(mKapitaal)
{
    var mi = 0
    var ma = 0
    var ret = 0
    var w = 0

	for (w = 0; w <= 9; w=w+1)
	{    
        mi = andere[w].substr(0,6);
        ma = andere[w].substr(8,6);
        if (mKapitaal >= mi && mKapitaal <= ma)
        {
            ret = w
        }
    }
    return(ret)
}

