kleiner fehler gut versteckt?

hennieliminator
Hallo.
Ich habe von Homepage-Total den PopUp Generator gefunden, der genau so aussieht wie der von ehmig.net, und ich wollte die funktion mit radiobuttons und generatoren zusammenbringen und machen. Leider zeigt er immer an mylink ist undefiniert??? Hier mal der Code: Ich weiß einfach nicht weiter!

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Button</title>
<script>
function GenCode() {
if(document.frm.rdlink.checked){mylink='formbutton';}
if(document.frm.rdlink.checked){mylink='formload';}
if(mylink=='formbutton')
{
 document.frm.txtLink.value="<input type=\"button\" name=\"B1\" value=\"Click Me\" onClick=\"NewWindow('" + document.frm.txtPopupURL.value + "','" + document.frm.txtPopupname.value + "','" + mywidth + "','" + myheight + "','" + posval + "','" + infocus + "');\"" + mywinfocus + ">";
}
if(mylink=='formload')
{
 document.frm.txtLink.value="<body onLoad=\"NewWindow('" + document.frm.txtPopupURL.value + "','" + document.frm.txtPopupname.value + "','" + mywidth + "','" + myheight + "','" + posval + "','" + infocus + "');\"" + mywinfocus + ">";
}
}
</script>
</head>

<body>
<form name="frm" action="javascript:GenCode()">
<tABLE cellPadding=0 cellSpacing=0 ><tBODY><tR><tD noWrap align="left"><p><FONT face=Verdana, Arial size=2><INPUT
 name=rdlink type=radio
 value=formbutton></FONT></P></TD><tD noWrap><p align="left"><FONT Arial> Button</FONT></TD></TR></TBODY></TABLE></TD></TR><tR><tD align=left width="159"><tABLE border=0 cellPadding=0 cellSpacing=0><tBODY><tR><tD noWrap><p align=right><FONT face=Verdana, Arial size=2><INPUT
 name=rdlink type=radio
 value=formload></FONT></P></TD><tD noWrap>Beim Laden der Seite </TD></TR></TBODY></TABLE>
	<p><textarea rows="10" name="txtLink" cols="45"></textarea></p>
	<p><input type="submit" value="Absenden" name="B1"></p>
	</TD><tD align=left width="183">
</body>

</html>