This code is ment for a product listing page.  It checks to see how many items are on the page to you can remove the "next","last".  You can find it on http://heartandstone/necklaces/