(1) is there a way to avoid the variable? Yes, change
<xsl:variable name="pcredcodestore1" select="cred"/>
<td onClick="ApplyFilter('{$pcredcodestore1}');">
to
<td onClick="ApplyFilter('{cred}');">
(2) Is there a way that I can specify here [in href] that it is not an internet address but a call to javascript?
That's an HTML question not an XSLT question. I think most browsers allow href="javascript
:......" but you'll have to look somewhere for the details.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference