I have a link on a page containing frames. The link is OK, except when I have opened a new window. What could be wrong? Do I have to activate the window with the frames or...?

Link code:
Code:
<a href="pipedim.asp?pageID=<%=pageID%>" target="venstre" onclick="pipedim();" style="font-size: 12pt">This is the link</a>
function:
Code:
function pipedim() {
   window.parent.frames("right").location = "blank.htm";	
   parent.frames[0].navform.dim.disabled=false; 
   return;
}
An error occurs if I hit "This is the link" after activating a new window with this form:
Code:
<form name=pipe_res method="post" action="print.asp?pageID=<%=pageID%>" target="_blank">
The error occurs happen in the right frame, left is OK