with that function $pagenum will ALWAYS equal 1. $pagenum is not passed to the function, nor is it referenced globally, so $pagenum will always appear empty and will be given a value of one here:
if ($pagenum == "") { $pagenum = 1 ; }
$pagenum is no where to be found before that, so it will ALWAYS be empty, and be set to 1. I don't know the rest of your code, but I'm guessing that the page number should either be passed to your function, or should be globally referenced (like $link is).
You might want to change how you check to see if $pagenum is empty too, since that way could cause warnings if its not set. This is generally preferred over your method:
if (empty($pagenum)) { $pagenum = 1; }
Also, "SELECT * FROM inews" is a bad way to count the number of records. This will pull ALL the data from the inews table, which would result in a huge query if there are a lot of records. A MUCH faster way of doing it would be this:
$res = mysql_query("select count(*) from inews", $link);
$numstories = mysql_result($res, 0);
$numpages = ceil($numstories / $perpage);
this query only retrieves the number of records, not the records themselves, so its MUCH faster.
Those are just some things that caught my eye, so no guaruntee that will fix all your problems, but I hope it helps.