By Clicking on an image I am opening one
jsp as a seperate window(popup1). When I close this popup window by clicking on window CLOSE button, one more window should open i.e., popup2. In this case popup window should not close.
for that I am using follwing code, but its not working...
<HTML>
<HEAD>
</HEAD>
<body onLoad="check(false);" onUnLoad="check(true);">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#A3D1FF" >
<form method="post" name="theForm">
<tr>
<td colspan=3 width="100%" height="30" align='<%=leftAlign%>'><span class="darkbluefont13"><strong> </strong></span></td>
</tr>
<tr>
<td width="10%"> </td>
<%
String s = "siebelcrm/EBI/"+campId+"/offer.html";%>
<td width="60%" align="center" style="padding:0px 0px 0px 12px"><jsp:include page="<%=s%>"/> </td>
</tr></table></td>
<td width="10%"> </td>
</tr>
<tr height="10%"><td colspan=3 width="100%" height="30" align='center'><span class="darkbluefont13"><strong> </strong></span></td></tr>
<tr>
<td width="2%" align='center'> </td>
<td align="center">
<table border="0"><tr>
<td>
<a href="#" onclick="check(false);"><img src="apply.gif" alt="banner" border="0"></a>
<a href="#" onclick="check(false);"></a>
</td>
</tr></table></td>
</tr>
<tr>
<td colspan=3 width="100%" height="30" align='<%=leftAlign%>'><span class="darkbluefont13"><strong> </strong></span></td>
</tr>
</form>
</table>
<%
}
%>
<script type="text/javascript" language="JavaScript">
var flag;
function check(f){
flag=f;
}
if(flag){
window.onbeforeunload = confirmExit;
}
function confirmExit()
{
child2=
window.open('enbdCampaignOffer2.jsp?campaignid=<%=campId%>&targetid=<%=targetId%>&contid=<%=contactId%>&treatid=<%=treatId%>','call','dependent=no,directories=no,location=no,menubar=no,status=no,titlebar=no,toolbar=no,scrollbars=yes,resizable=yes,hotkeys=no,width=500,height=110');
return child2;
}
</script>
</body>
</html>
Please suggest me correct approch to meet my requirement.
Thanks in advance.