$(function(){	
		   
	$(".box").colorbox();
			   
	$("[title]").tooltip();
	$(".tool").tooltip();
	$(":range").rangeinput();
	$(".inputslide").rangeinput();
	resultado = {
			g1 : 0,
			g2 : {
				t : 78,
				a : 59,
				b : 19
			},
			g3 : {
				t : 20,
				a : 25,
				b : 25,
				c : 25,
				d : 25,
				e : 25
			}
		};
	//animar(resultado);

});

function addCommas(nStr)
{
	nStr += '';
	x = nStr.split(',');
	x1 = x[0];
	x2 = x.length > 1 ? ',' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	var num = x1 + x2;
	return num;
}

function animar(options) {

//Animacion

$("#graph1").animate({ height: options.g1 }, 1500 ); //Porcentaje grafico 1: (240px = 0%, 120px = 50%)
//$("#graph2").animate({ height: "0px" }, 1500 ); //Porcentaje grafico 2: (160px = 0%, 80px = 50%)
$("#conoceplan").hide();

//2
//$('a#animate').click(function() {
	$("#conoceplan").fadeIn("fast");	
$('#graph2').animate({ //192px = 0%
    height: options.g2.t
  }, 1500);
 $('#graph2a').animate({ //
    height: options.g2.a
  }, 1500);
  $('#graph2b').animate({ //
   height: options.g2.b
  }, 1500);
  
  $('#graph3').animate({ //170px = 0%
    height: options.g3.t
  }, 1500);
  $('#graph3a').animate({ //
    height: options.g3.a
  }, 1500);
  $('#graph3b').animate({ //
    height: options.g3.b
  }, 1500);
  $('#graph3c').animate({ //
    height: options.g3.c
  }, 1500);
  $('#graph3d').animate({ //
    height: options.g3.d
  }, 1500);
  $('#graph3e').animate({ //
    height: options.g3.e
  }, 1500);
//});
}

function aceptar_bono(bono) {
	$('#AlcanzaloBonoPensional').attr('value',bono);
	$('#AlcanzaloNumero').attr('value',bono);
	$.colorbox.close();
	
	
}


