How to have a function to call the progressbar with out hardcodding

How to have a function to call the progressbar with out hardcodding


Hi I am using the progress bar functionality but I will have a lot of
progress bars on a page. What I am doing right now is hardcodding all
the div ID's which is fine if I have only two or three progress
bars...
I will have around 30 or so on one page and I need a function that I
can call and I pass it with the id of the div and the value for that
bar.
Any help if there is something like this?
Regards,
Zahid
<script type="text/javascript">
    $(function(){
    // Progressbar 1
    $("#progressbar1").progressbar({
    value: 89
    });
    // Progressbar 2
    $("#progressbar2").progressbar({
    value: 40
    });
    // Progressbar 3
    $("#progressbar3").progressbar({
    value: 60
    });
    // Progressbar 4
    $("#progressbar4").progressbar({
    value: 80
    });
    // Progressbar 5
    $("#progressbar5").progressbar({
    value: 10
    });
    // Progressbar 6
    $("#progressbar6").progressbar({
    value: 25
    });
    });
</script>