// Yazan : aliaydin06[at]gmail[dot]com
// 
// en azindan kullandiktan sonra bi tesekkur maili atarsaniz mutlu olurum :)
//
function usal(taban,us)
{ sinir=parseInt(us)+1;
  sonuc=1;
  for (i=1 ; i<sinir ; i++ )
  {
   sonuc=sonuc*taban;
  }
  return sonuc;
}

function hesaptutaragore()
{
 a = parseInt(document.formtutaragore.kreditutari.value);
 k = parseFloat(document.formtutaragore.faiz2.value);
 n = parseInt(document.formtutaragore.vade2.value);
 
 b1 = a*(k/100); 
 b2 = 1+(k/100); 
 b3 = usal(b2,n); 
 c  = b1/(1-(1/b3));
 document.formtutaragore.toplam2.value = c.toFixed(2);
 return c;
}

function hesaptaksitegore()
{
 c = parseInt(document.formtaksitegore.ayliktaksittutari.value);
 k = parseFloat(document.formtaksitegore.faiz.value);
 n = parseInt(document.formtaksitegore.vade.value);
 
 b1 = c/(k/100); 
 b2 = 1+(k/100); 
 b3 = usal(b2,n);
 a  = b1*(1-(1/b3));
 
 document.formtaksitegore.toplam1.value = a.toFixed(2);
 return a.toFixed(2);
}

function tutarayarla(veri)
{
	document.formtutaragore.kreditutari.value = veri;
}

function taksitayarla(veri)
{
	document.formtaksitegore.ayliktaksittutari.value = veri;
}
	
