Pagination Links using jQuery

Pagination Links using jQuery

hi guys,
i am stuck with a problem here.... i am trying to form pagination links from a list.. the exisiting formation is something like this

<li class="first"><a href='VIEWUSERONLINE?&ival=5'> First Page</a></li>
<li class="previous"><a href='VIEWUSERONLINE?&ival=5'>Prev Page</a>  </li>
<li class="next"><a href='VIEWUSERONLINE?&ival=11'>Next Page</a>  </li>
<li class="last"><a href='VIEWUSERONLINE?&ival=11'>Last Page</a></li>


Using this as a reference i need to replace the list with paginated links that looks likes this

[First Page] [5] [6] [7] [8] [9] [10] [11] [Last Page]

Can anyone guide me as to how i should approach this ??
Thanks in advance