Nofollow redirect, php & javascript link

(moved from javascript forum, on suggestion)

All links on my site redirect to another page. However everything is html except for (2) javascript links I need to direct to. Links are being done on the viewable pages in the fashion:

<a href="ab/dir.php?GG=2200" rel="nofollow" target="_blank">link text</a>

Going to my internal dir page, having:

if((isset($_GET['GG']))&&($_GET['GG']=='2200')) // 

Where ‘affildomain’ is the javascript link. Which of course cannot be done this way or it gives the “File Download - Security Warning…Do you want to save this file, or find a program online to open it?”

How can this be redirected (first tag above) while using nofollow or an equivalent, connecting with this javascript:

<script type="text/javascript" language="javascript" src=""></script>

Its an affiliate link with <link>link text here</link>

Is there a way to integrate on the redirect page the window location:

THREAD RESOLVED - by convincing company to change out to html link!