2 Dependent jQuery-UI Sliders

Hi!

I’m trying to develop a loan simulator using 2 jQuery-UI Sliders.

The 1st slider (prazo) represents the length of the loan in months
The 2nd slider (mensalidade) represents how much you’ll be paying each month during the loan.

The sliders are of course dependent of the amount required.

I have all the data in a MySQL database.

The first slider works OK. For an amount of 1000 there are 2 lengths: 48 and 72 months, there for 2 different loan amounts
48 months - 301.88
72 months - 188.88

First problem: the value of mensalidade (2nd slider) loses it’s decimal part - becomes 301 and 188 instead of 300.88 and 187.88

Second problem: If we start sliding the first slider, the second one freezes and vice-versa.

Third problem: Is there a better way to filter my json? Or should I alter the json structure? How?
My json file:

What I’m doing is:


$.each(data, function(key, value) {
					console.log(key,value);
					if(key > 0)
					{
						$("#partner_id").val(value.partner_id);
						$("#partner_desc").val(value.partner_desc);
						$("#oferta_id").val(value.oferta_id);
						$("#seguro_id").val(value.seguro_id);
						$("#seguro").val(value.seguro);
						$("#mtic").val(value.mtic);
						$("#tan").val(value.tan);
						$("#taeg").val(value.taeg);
					}
                });

Fourth problem: The 1st slider is fairly simple - I know the min and max and step value, because it’s more or less static and the calls to the json file are less because of the step being 6.
But for the 2nd slider, I had to place the step at 1 because it could pass a needed value. Thus, it calls the json file at each step of the slider.
I think this will cause slider update to take very long.

I’ve set up a fiddle here: http://jsfiddle.net/mjpramos/3m7wy/7/
and you can check it at http://beta.classificados.mpl.pt/clientes/cofidis/simulador.php