so gehts, "this" ist nicht in Fkt ansprechbar.
function refer(link) {
link=escape(link);
this.document.location.href="index.php?site=refer&url="+ link;
}
im body:
<a href="#" onClick="javascript:refer(this.href)">
<img src="images/refer.gif" width="12" height="12" border="0" alt=""></a>