var factores = new Array();

// factores actualizados al 01Abr2010
factores[ 3 ]  = new Array( 0.3586400471674440, 0.3576162115154040, 0.3576162115154040, 0.3576162115154040, 0.3576162115154040, 0.3576162115154040 );
factores[ 4 ]  = new Array( 0.2738687481735660, 0.2728977394254950, 0.2728977394254950, 0.2728977394254950, 0.2728977394254950, 0.2728977394254950 );
factores[ 5 ]  = new Array( 0.2230518855552930, 0.2221090110289740, 0.2221090110289740, 0.2221090110289740, 0.2221090110289740, 0.2221090110289740 );
factores[ 6 ]  = new Array( 0.1892121945084510, 0.1882851147888000, 0.1882851147888000, 0.1882851147888000, 0.1882851147888000, 0.1882851147888000 );
factores[ 7 ]  = new Array( 0.1650736956020370, 0.1641553668337130, 0.1641553668337130, 0.1641553668337130, 0.1641553668337130, 0.1641553668337130 );
factores[ 8 ]  = new Array( 0.1469983914610780, 0.1460844186994320, 0.1460844186994320, 0.1460844186994320, 0.1460844186994320, 0.1460844186994320 );
factores[ 9 ]  = new Array( 0.1329651656674040, 0.1320526265808190, 0.1320526265808190, 0.1320526265808190, 0.1320526265808190, 0.1320526265808190 );
factores[ 10 ] = new Array( 0.1217613423257080, 0.1208481990372930, 0.1208481990372930, 0.1208481990372930, 0.1208481990372930, 0.1208481990372930 );
factores[ 11 ] = new Array( 0.1126152131441900, 0.1116999914084440, 0.1116999914084440, 0.1116999914084440, 0.1116999914084440, 0.1116999914084440 );
factores[ 12 ] = new Array( 0.1050123009795260, 0.1040939030255250, 0.1040939030255250, 0.1040939030255250, 0.1040939030255250, 0.1040939030255250 );
factores[ 13 ] = new Array( 0.0985964248268373, 0.0976740141748168, 0.0976740141748168, 0.0976740141748168, 0.0976740141748168, 0.0976740141748168 );
factores[ 14 ] = new Array( 0.0931131655320718, 0.0921860929368731, 0.0921860929368731, 0.0921860929368731, 0.0921860929368731, 0.0921860929368731 );
factores[ 15 ] = new Array( 0.0883759452229287, 0.0874436992928463, 0.0874436992928463, 0.0874436992928463, 0.0874436992928463, 0.0874436992928463 );
factores[ 16 ] = new Array( 0.0842448269563766, 0.0833070001934809, 0.0833070001934809, 0.0833070001934809, 0.0833070001934809, 0.0833070001934809 );
factores[ 17 ] = new Array( 0.0806127968464426, 0.0796690616649128, 0.0796690616649128, 0.0796690616649128, 0.0796690616649128, 0.0796690616649128 );
factores[ 18 ] = new Array( 0.0773966188187470, 0.0764467102146769, 0.0764467102146769, 0.0764467102146769, 0.0764467102146769, 0.0764467102146769 );
factores[ 19 ] = new Array( 0.0745305773397447, 0.0735742801114702, 0.0735742801114702, 0.0735742801114702, 0.0735742801114702, 0.0735742801114702 );
factores[ 20 ] = new Array( 0.0719620973294428, 0.0709992364827973, 0.0709992364827973, 0.0709992364827973, 0.0709992364827973, 0.0709992364827973 );
factores[ 21 ] = new Array( 0.0696486155296885, 0.0686790489578089, 0.0686790489578089, 0.0686790489578089, 0.0686790489578089, 0.0686790489578089 );
factores[ 22 ] = new Array( 0.0675553051375367, 0.0665789179545327, 0.0665789179545327, 0.0665789179545327, 0.0665789179545327, 0.0665789179545327 );
factores[ 23 ] = new Array( 0.0656533940142470, 0.0646700941109697, 0.0646700941109697, 0.0646700941109697, 0.0646700941109697, 0.0646700941109697 );
factores[ 24 ] = new Array( 0.0589838268629347, 0.0589838268629347, 0.0589838268629347, 0.0589838268629347, 0.0558510692252016, 0.0558510692252016 );
factores[ 25 ] = new Array( 0.0573639008879774, 0.0573639008879774, 0.0573639008879774, 0.0573639008879774, 0.0542138588645025, 0.0542138588645025 );
factores[ 26 ] = new Array( 0.0558739346736853, 0.0558739346736853, 0.0558739346736853, 0.0558739346736853, 0.0527063683360002, 0.0527063683360002 );
factores[ 27 ] = new Array( 0.0544994657323485, 0.0544994657323485, 0.0544994657323485, 0.0544994657323485, 0.0513141731943290, 0.0513141731943290 );
factores[ 28 ] = new Array( 0.0532280969139839, 0.0532280969139839, 0.0532280969139839, 0.0532280969139839, 0.0500249092496031, 0.0500249092496031 );
factores[ 29 ] = new Array( 0.0520491403261426, 0.0520491403261426, 0.0520491403261426, 0.0520491403261426, 0.0488279173553687, 0.0488279173553687 );
factores[ 30 ] = new Array( 0.0509533324700747, 0.0509533324700747, 0.0509533324700747, 0.0509533324700747, 0.0477139592390935, 0.0477139592390935 );
factores[ 31 ] = new Array( 0.0499326045121268, 0.0499326045121268, 0.0499326045121268, 0.0499326045121268, 0.0466749883333255, 0.0466749883333255 );
factores[ 32 ] = new Array( 0.0489798956295251, 0.0489798956295251, 0.0489798956295251, 0.0489798956295251, 0.0457039635761230, 0.0457039635761230 );
factores[ 33 ] = new Array( 0.0480890002935420, 0.0480890002935420, 0.0480890002935420, 0.0480890002935420, 0.0447946970660579, 0.0447946970660579 );
factores[ 34 ] = new Array( 0.0472544425029246, 0.0472544425029246, 0.0472544425029246, 0.0472544425029246, 0.0439417286017294, 0.0439417286017294 );
factores[ 35 ] = new Array( 0.0464713715775201, 0.0464713715775201, 0.0464713715775201, 0.0464713715775201, 0.0431402217288834, 0.0431402217288834 );
factores[ 36 ] = new Array( 0.0457354753198258, 0.0457354753198258, 0.0457354753198258, 0.0457354753198258, 0.0423858771131003, 0.0423858771131003 );

// entrega monto de la cuota segun el monto y los intereses
// $0-$49.999	$50.000-$149.999	$150.000-$249.799	$249.800- $499.799	$499.800-$999.799	$999.800 y más
//  0           1                   2                   3                   4                   5
					
function obtieneCuota(cuotas, monto) {
	if (cuotas == 0)
		return monto;
	if (cuotas == 1 || cuotas == 2)
		return monto;
	var rango = 5;
	if (monto < 50000)
		rango = 0;
	else if (monto < 150000)
		rango = 1;
	else if (monto < 249800)
		rango = 2;
	else if (monto < 499800)
		rango = 3;
	else if (monto < 999800)
		rango = 4;
	// 3 cuotas precio contado
	var factor = 0.3333333333333333;
	if (cuotas != 3)
		factor = factores[cuotas][rango];
	var montoCuota = Math.round(monto * factor);
	//alert(monto+"(rango "+rango+")*"+factor+"= "+cuotas+" de "+montoCuota)
	return montoCuota;
}


/* hasta antes del 01Abr2010
// factores actualizados al 12Feb2010
factores[  3 ] = new Array( 0.3586400471674440, 0.3576162115154040, 0.3576162115154040, 0.3576162115154040, 0.3576162115154040, 0.3576162115154040 );
factores[  4 ] = new Array( 0.2738687481735660, 0.2728977394254950, 0.2728977394254950, 0.2728977394254950, 0.2728977394254950, 0.2728977394254950 );
factores[  5 ] = new Array( 0.2230518855552930, 0.2221090110289740, 0.2221090110289740, 0.2221090110289740, 0.2221090110289740, 0.2221090110289740 );
factores[  6 ] = new Array( 0.1667250048609390, 0.1667250048609390, 0.1667250048609390, 0.1667250048609390, 0.1667250048609390, 0.1667250048609390 );
factores[  7 ] = new Array( 0.1650736956020370, 0.1641553668337130, 0.1641553668337130, 0.1641553668337130, 0.1641553668337130, 0.1641553668337130 );
factores[  8 ] = new Array( 0.1469983914610780, 0.1460844186994320, 0.1460844186994320, 0.1460844186994320, 0.1460844186994320, 0.1460844186994320 );
factores[  9 ] = new Array( 0.1329651656674040, 0.1320526265808190, 0.1320526265808190, 0.1320526265808190, 0.1320526265808190, 0.1320526265808190 );
factores[ 10 ] = new Array( 0.1217613423257080, 0.1208481990372930, 0.1208481990372930, 0.1208481990372930, 0.1208481990372930, 0.1208481990372930 );
factores[ 11 ] = new Array( 0.1126152131441900, 0.1116999914084440, 0.1116999914084440, 0.1116999914084440, 0.1116999914084440, 0.1116999914084440 );
factores[ 12 ] = new Array( 0.0833875099300826, 0.0833875099300826, 0.0833875099300826, 0.0833875099300826, 0.0833875099300826, 0.0833875099300826 );
factores[ 13 ] = new Array( 0.0985964248268373, 0.0976740141748168, 0.0976740141748168, 0.0976740141748168, 0.0976740141748168, 0.0976740141748168 );
factores[ 14 ] = new Array( 0.0931131655320718, 0.0921860929368731, 0.0921860929368731, 0.0921860929368731, 0.0921860929368731, 0.0921860929368731 );
factores[ 15 ] = new Array( 0.0883759452229287, 0.0874436992928463, 0.0874436992928463, 0.0874436992928463, 0.0874436992928463, 0.0874436992928463 );
factores[ 16 ] = new Array( 0.0842448269563766, 0.0833070001934809, 0.0833070001934809, 0.0833070001934809, 0.0833070001934809, 0.0833070001934809 );
factores[ 17 ] = new Array( 0.0806127968464426, 0.0796690616649128, 0.0796690616649128, 0.0796690616649128, 0.0796690616649128, 0.0796690616649128 );
factores[ 18 ] = new Array( 0.0773966188187470, 0.0764467102146769, 0.0764467102146769, 0.0764467102146769, 0.0764467102146769, 0.0764467102146769 );
factores[ 19 ] = new Array( 0.0745305773397447, 0.0735742801114702, 0.0735742801114702, 0.0735742801114702, 0.0735742801114702, 0.0735742801114702 );
factores[ 20 ] = new Array( 0.0719620973294428, 0.0709992364827973, 0.0709992364827973, 0.0709992364827973, 0.0709992364827973, 0.0709992364827973 );
factores[ 21 ] = new Array( 0.0696486155296885, 0.0686790489578089, 0.0686790489578089, 0.0686790489578089, 0.0686790489578089, 0.0686790489578089 );
factores[ 22 ] = new Array( 0.0675553051375367, 0.0665789179545327, 0.0665789179545327, 0.0665789179545327, 0.0665789179545327, 0.0665789179545327 );
factores[ 23 ] = new Array( 0.0656533940142470, 0.0646700941109697, 0.0646700941109697, 0.0646700941109697, 0.0646700941109697, 0.0646700941109697 );
factores[ 24 ] = new Array( 0.0589838268629347, 0.0589838268629347, 0.0522740643123937, 0.0499241019695091, 0.0589838268629347, 0.0589838268629347 );
factores[ 25 ] = new Array( 0.0573639008879774, 0.0573639008879774, 0.0573639008879774, 0.0573639008879774, 0.0573639008879774, 0.0573639008879774 );
factores[ 26 ] = new Array( 0.0558739346736853, 0.0558739346736853, 0.0558739346736853, 0.0558739346736853, 0.0558739346736853, 0.0558739346736853 );
factores[ 27 ] = new Array( 0.0544994657323485, 0.0544994657323485, 0.0544994657323485, 0.0544994657323485, 0.0544994657323485, 0.0544994657323485 );
factores[ 28 ] = new Array( 0.0532280969139839, 0.0532280969139839, 0.0532280969139839, 0.0532280969139839, 0.0532280969139839, 0.0532280969139839 );
factores[ 29 ] = new Array( 0.0520491403261426, 0.0520491403261426, 0.0520491403261426, 0.0520491403261426, 0.0520491403261426, 0.0520491403261426 );
factores[ 30 ] = new Array( 0.0509533324700747, 0.0509533324700747, 0.0509533324700747, 0.0509533324700747, 0.0509533324700747, 0.0509533324700747 );
factores[ 31 ] = new Array( 0.0499326045121268, 0.0499326045121268, 0.0499326045121268, 0.0499326045121268, 0.0499326045121268, 0.0499326045121268 );
factores[ 32 ] = new Array( 0.0489798956295251, 0.0489798956295251, 0.0489798956295251, 0.0489798956295251, 0.0489798956295251, 0.0489798956295251 );
factores[ 33 ] = new Array( 0.0480890002935420, 0.0480890002935420, 0.0480890002935420, 0.0480890002935420, 0.0480890002935420, 0.0480890002935420 );
factores[ 34 ] = new Array( 0.0472544425029246, 0.0472544425029246, 0.0472544425029246, 0.0472544425029246, 0.0472544425029246, 0.0472544425029246 );
factores[ 35 ] = new Array( 0.0464713715775201, 0.0464713715775201, 0.0464713715775201, 0.0464713715775201, 0.0464713715775201, 0.0464713715775201 );
factores[ 36 ] = new Array( 0.0457354753198258, 0.0457354753198258, 0.0457354753198258, 0.0457354753198258, 0.0361523955359171, 0.0361523955359171 );

// entrega monto de la cuota segun el monto y los intereses
// $0-$149.999	$150.000-$249.799	$249.800- $499.799	$499.800-$999.799	$999.800 y más
//  0           1                   2                   3                   4
function obtieneCuota(cuotas, monto) {
	if (cuotas == 0)
		return monto;
	if (cuotas == 1 || cuotas == 2)
		return monto;
	var rango = 4;
	if (monto < 150000)
		rango = 0;
	else if (monto < 249800)
		rango = 1;
	else if (monto < 499800)
		rango = 2;
	else if (monto < 999800)
		rango = 3;
	// 3 cuotas precio contado
	var factor = 0.3333333333333333;
	if (cuotas != 3)
		factor = factores[cuotas][rango];
	var montoCuota = Math.round(monto * factor);
	//alert(monto+"(rango "+rango+")*"+factor+"= "+cuotas+" de "+montoCuota)
	return montoCuota;
}
*/