
 function initialize() {
 	divId = 'sample';
	thedivId = document.getElementById(divId);
	//el valor del porcentaje de la barra sobre 100
	var percentage = thedivId.innerHTML;
	
	var nu1 = new String(percentage);
	var num1 = nu1.replace(/,/g,".");
	var num12 = parseFloat(num1);
	//el valor del porcentaje de la barra sobre 10
	var perc2 = redondea(num12/10,2);
	document.getElementById(divId).innerHTML = perc2;
	thedivId.style.backgroundColor="#52A6BF";
	brim(divId,parseInt(percentage),parseInt(percentage));

	divId1 = 'sample0';
	thedivId1 = document.getElementById(divId1);
	var percentage1 = thedivId1.innerHTML;
	var nu = new String(percentage1);
	var num = nu.replace(/,/g,".");
	var num2 = parseFloat(num);
	var perc1 = redondea(num2/10,2);
	document.getElementById(divId1).innerHTML = perc1;
	thedivId1.style.backgroundColor="#52A6BF";
	brim(divId1,parseInt(percentage1),parseInt(percentage1));

	divId2 = 'sample2';
	thedivId2 = document.getElementById(divId2);
	var percentage2 = thedivId2.innerHTML;
	var nu2 = new String(percentage2);
	var num2 = nu2.replace(/,/g,".");
	var num22 = parseFloat(num2);
	var perc3 = redondea(num22/10,2);
	document.getElementById(divId2).innerHTML = perc3;
	thedivId2.style.backgroundColor="#52A6BF";
	brim(divId2,parseInt(percentage2),parseInt(percentage2));

	divId3 = 'sample3';
	thedivId3 = document.getElementById(divId3);
	var percentage3 = thedivId3.innerHTML;
	var nu3 = new String(percentage3);
	var num3 = nu3.replace(/,/g,".");
	var num32 = parseFloat(num3);
	var perc4 = redondea(num32/10,2);
	document.getElementById(divId3).innerHTML = perc4;
	thedivId3.style.backgroundColor="#52A6BF";
	brim(divId3,parseInt(percentage3),parseInt(percentage3));

	divId4 = 'sample4';
	thedivId4 = document.getElementById(divId4);
	var percentage4 = thedivId4.innerHTML;
	var nu4 = new String(percentage4);
	var num4 = nu4.replace(/,/g,".");
	var num42 = parseFloat(num4);
	var perc5 = redondea(num42/10,2);
	document.getElementById(divId4).innerHTML = perc5;
	thedivId4.style.backgroundColor="#52A6BF";
	brim(divId4,parseInt(percentage4),parseInt(percentage4));

	divId5 = 'sample5';
	thedivId5 = document.getElementById(divId5);
	var percentage5 = thedivId5.innerHTML;
	var nu5 = new String(percentage5);
	var num5 = nu5.replace(/,/g,".");
	var num52 = parseFloat(num5);
	var perc6 = redondea(num52/10,2);
	document.getElementById(divId5).innerHTML = perc6;
	thedivId5.style.backgroundColor="#52A6BF";
	brim(divId5,parseInt(percentage5),parseInt(percentage5));

	divId6 = 'sample6';
	thedivId6 = document.getElementById(divId6);
	var percentage6 = thedivId6.innerHTML;
	var nu6 = new String(percentage6);
	var num6 = nu6.replace(/,/g,".");
	var num62 = parseFloat(num6);
	var perc7 = redondea(num62/10,2);
	document.getElementById(divId6).innerHTML = perc7;
	thedivId6.style.backgroundColor="#52A6BF";
	brim(divId6,parseInt(percentage6),parseInt(percentage6));


}


function setWidth(o, start) {
	o.style.width = start+"%";
}


function brim(Id,start,percentage) {
	if (document.getElementById) {
		o = document.getElementById(Id);
		if (start <= percentage) {
			setWidth(o, start);
			start += 1;
			window.setTimeout("brim('"+Id+"',"+start+","+percentage+")", 50);
		}
	}
}

function redondea(sVal, nDec){
	var n = parseFloat(sVal);
    var s = "0.00";
    if (!isNaN(n)){
     n = Math.round(n * Math.pow(10, nDec)) / Math.pow(10, nDec);
     s = String(n);
     s += (s.indexOf(".") == -1? ".": "") + String(Math.pow(10, nDec)).substr(1);
     s = s.substr(0, s.indexOf(".") + nDec + 1);
    }
    return s;
} 
