All of your links have the same id
id="pgNum"
So
var rel = $("#pgNum");
will always return:
<a href="#" id="pgNum" rel="1 Front Cover"></a>
and
var rel = $("#pgNum").attr("rel");
will always return:
rel="1 Front Cover"
Your strange parsing code will because of that always return 1. See my comment.
Change your click event handler code to take attribute not from element with id #pgNum, but from element that was clicked:
$("#pgNum").live("click, tap", function(e){
{...}
$(e.target).attr("rel");
{...}
});