|| ipage<1){
ipage
= 1;
}else
if(ipage>oPaging.iTotalPages){
ipage=oPaging.iTotalPages;
}
$(this).val(ipage);
ipage--;
oSettings._iDisplayStart
= ipage * oPaging.iLength;
fnDraw(
oSettings );
});
var
els = $('a',
nPaging);
$(els[0]).bind(
'click.DT',
{
action:
"first"
},
fnClickHandler );
$(els[1]).bind(
'click.DT',
{
action:
"previous"
},
fnClickHandler );
$(els[2]).bind(
'click.DT',
{
action:
"next"
},
fnClickHandler );
$(els[3]).bind(
'click.DT',
{
action:
"last"
},
fnClickHandler );
},
"fnUpdate":
function
( oSettings, fnDraw ) {
var
iListLength = 5;
var
oPaging = oSettings.oInstance.fnPagingInfo();
var
an = oSettings.aanFeatures.p;
var
i, ien, j, sClass, iStart, iEnd, iHalf=Math.floor(iListLength/2);
if
( oPaging.iTotalPages < iListLength) {
iStart
= 1;
iEnd
= oPaging.iTotalPages;
}
else
if
( oPaging.iPage <= iHalf ) {
iStart
= 1;
iEnd
= iListLength;
}
else
if
( oPaging.iPage >= (oPaging.iTotalPages-iHalf) ) {
iStart
= oPaging.iTotalPages - iListLength + 1;
iEnd
= oPaging.iTotalPages;
}
else
{
iStart
= oPaging.iPage - iHalf + 1;
iEnd
= iStart + iListLength - 1;
}
for
( i=0, ien=an.length ; i<ien ; i++ ) {
//
Remove the middle elements
($('li:gt(1)',
an[i]).filter(':not(:last)')).filter(':not(:last)').remove();
//
Add the new list items and their event handlers
for
( j=iStart ; j<=iEnd ; j++ ) {
sClass
= (j==oPaging.iPage+1) ? 'class="active"'
: '';
$('<li
'+sClass+'><a
href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >'+j+'</a></li>')
.insertBefore(
$('.next',
an[i])[0] )
.bind('click',
function
(e) {
e.preventDefault();
oSettings._iDisplayStart
= (parseInt($('a',
this).text(),10)-1)
* oPaging.iLength;
fnDraw(
oSettings );
}
);
}
//
Add / remove disabled classes from the static elements
if
( oPaging.iPage === 0 ) {
$('li:lt(2)',
an[i]).addClass('disabled');
}
else










