Code:
<td class='alt2' align='center' width='1%'><a href="view.php?$session[sessionurl]serialid=$row[serialid]\"><img src='info.gif' alt='view!' border='0' /></a></td>
There's no reference to your javascript function there. Javascript won't work unless you call it.
link should be...
Code:
<a href="javascript: d($row=[serialid]"><img src='info.gif' alt='view!' border='0' /></a>
Since your javascript handles the file name you do not need that in the anchor. What you need is to tell the link to call the javascript and the id number in perenthesis.
You may need to make $row=[serialid] into a singular variable in your php file. i.e. $idnum = $row['serialid']; then use <a href="javascript
: d($idnum)"> for the link.
This is all untested.