
//FUNZIONE DI SELEZIONE PAGINA DA TEMPLATE
function comboRedirect(selection){
	document.location.href=selection.options[selection.selectedIndex].value;
}


function changeProv(selection){
	
	var nom=$('#combo_regione').val();
	$('#provincia_combo_container').load("../include-combo/reg_prov_"+nom+".shtml")
	
}


function progressBar(container_id, perc_class, bar_class,maxValue){
	


	var max=0.0;
	if(maxValue>0.0) max=maxValue;
	$("#"+container_id+" ."+perc_class).each(function (i) {
        //alert($(this)+"--"+$(this).text());
		var p=$(this).text();
		p=p.replace(/%/g,"");
		p=p.replace(/,/g,".");
		p=parseFloat(p);
		if(p>max){max=p}
		
	});

	$("#"+container_id+" ."+bar_class).each(function (i) {
		/*
		var stepTogether = function(step){	
			var perc1= parseFloat((step*max/100));
			perc1=roundNumber(perc1,2);
			perc_str=perc1+'';
			perc_str=perc_str.replace(/\./g,",")
			 perc_div.text(perc_str)
	    }; 
		 */   
		
		var perc_div=$(this).parent().next()
		var perc=perc_div.text();
		perc=perc.replace(/,/g,".");
		perc=parseFloat(perc);
	
	    //alert($(this)+"--"+perc); 
		
		var val=perc/max*100;

		val=val+"%";
		//$(this).animate( { width: val}, {duration:3000,step:stepTogether} );
		if($(this).attr("class")=='party app'){
		$(this).animate( { width: val}, {duration:3000} );
		}
		
	});

}


