<!--
   var TOTAL_FILA  = 36; 
   var TOTAL_COL   = 10;
   matrizTasa = new Array(TOTAL_FILA);
   tramo_monto= new Array(1);
   
   for( i = 0 ; i < TOTAL_FILA ; i++ ){
     matrizTasa[i] = new Array(TOTAL_COL);
   }

   for( i = 0 ; i < 1 ; i++ ){
     tramo_monto[i] = new Array(TOTAL_COL);
   }

function calculadoraFun(parCantCuo, parValor, parMesLib) {
	var cuotas = parseInt(parCantCuo);
	var valor = parseInt(parValor);
	var meseslibres_lk = parseInt(parMesLib);
	monto_r1 = 0;
	nuevo_valor = 0;
	vf=0;
	suma_lk=parseInt(cuotas)+parseInt(meseslibres_lk);
	sub_x="";
	
	var tramo = getTramoMonto( valor );
	tasa_cuota_monto = getTasa( cuotas , tramo );
   
	rg = 0;
	auxjc1=parseInt(valor)+parseInt(rg);
	auxjc2=parseInt(meseslibres_lk)+1;
	i = Math.round(parseInt((auxjc1)*(auxjc2))*tasa_cuota_monto);
	vcs=0;
	if (parseInt(cuotas) == 1 && parseInt(meseslibres_lk) == 0) {
		vc1=valor;
		vf=valor;
		vcs=valor;
	} else {
		if (parseInt(cuotas) == 1 && parseInt(meseslibres_lk) > 0) {
			vf=parseInt(valor+i+rg);
			vc1=vf;
		} else {
			x = tasa_cuota_monto/parseFloat((1-(1/Math.pow(1+tasa_cuota_monto, cuotas-1))));
			sub_x=x+"";
			x2=sub_x;
			vc=((((parseInt(valor)+parseInt(rg))*parseFloat(x2))-i)/(parseFloat(x2)+1))+i;
			vc=Math.round(vc);
			vf=Math.round(vc*cuotas);
			vcs=parseInt(vc);
			vc1=parseFloat(vf-(vcs*(parseInt(cuotas)-1)));
		}
	}
	return(vc1);
}

function getTramoMonto( p_monto )
{
   v_monto = parseInt(p_monto);
   tramo = -1;

          if ( v_monto <= parseInt(tramo_monto[0][0]) ) tramo = 1;
     else if ( v_monto <= parseInt(tramo_monto[0][1]) ) tramo = 2;
     else if ( v_monto <= parseInt(tramo_monto[0][2]) ) tramo = 3;
     else if ( v_monto <= parseInt(tramo_monto[0][3]) ) tramo = 4;
     else if ( v_monto <= parseInt(tramo_monto[0][4]) ) tramo = 5;
     else if ( v_monto <= parseInt(tramo_monto[0][5]) ) tramo = 6;
     else if ( v_monto <= parseInt(tramo_monto[0][6]) ) tramo = 7;
     else if ( v_monto <= parseInt(tramo_monto[0][7]) ) tramo = 8;
     else if ( v_monto <= parseInt(tramo_monto[0][8]) ) tramo = 9;
     else if ( v_monto <= parseInt(tramo_monto[0][9]) ) tramo = 10;   
     return(tramo);         
}

function getTasa(cuota,tramo)
{
   var i = parseInt(cuota) - 1;
   var j = parseInt(tramo) - 1;
   return( matrizTasa[i][j] );
}

function formatcalc(valor){
   Num = "" + parseInt(valor);
   dec = Num.indexOf(".");
   end = ((dec > -1) ? "" + Num.substring(dec,Num.length) : "");
   Num = "" + parseInt(Num);
   var temp1 = "";
   var temp2 = "";
   var count = 0;
   for (var k = Num.length-1; k >= 0; k--) {
      var oneChar = Num.charAt(k);
      if (count == 3) {
         temp1 += ".";
         temp1 += oneChar;
         count = 1;
         continue;
      } else {
         temp1 += oneChar;
         count ++;
      }
   }
   for (var k = temp1.length-1; k >= 0; k--) {
      var oneChar = temp1.charAt(k);
      temp2 += oneChar;
   }
   temp2 = "$" + temp2 + end;
   return(temp2);
}

//-->