hi,
I am having an application in VB .NET, which has many links to a pop window .... this window comes from the backend java script ... the javascript is shown here
this function might look too long but it has defines the size for many other pop up windows. now if i close my application , the applcation is getting closed but these pop ups are not closing. Appreciated if anyone gives suggestions or coding techniques.



function winPopUp(strUrl,strWinSize)
{
var strWindSize = strWinSize.toUpperCase();
var windowWidth; // window width
var windowHeight;// window height
if (strWinSize == 'OR')//Large window - used for Order Information For Run Popup
{
windowWidth = 925;
windowHeight = 350;
}
if (strWinSize == 'XXXL')//Small window - used for Change Printer Popup
{
windowWidth = 320;
windowHeight = 210;
}
if(strWinSize == 'XXL') // Extra large window - used for QTE details
{
windowWidth = 700;
windowHeight = 400;
}
if(strWinSize == 'XL') // Extra large window - used for Pallet details
{
windowWidth = 400;
windowHeight = 275;
}
if(strWinSize == 'N') // Extra large window - used for USER details
{
windowWidth = 600;
windowHeight = 500;
}

if(strWinSize == 'L') // large window - used for Master roll details
{
windowWidth = 700;
windowHeight = 480;
}

if(strWinSize == 'M')// medium window - used for Order details
{
windowWidth = 710;
windowHeight = 290;
}

if(strWinSize == 'S')// small window - used for slit roll details
{
windowWidth = 680;
windowHeight = 390;
}
if(strWinSize == 'SH') //very large window - used for Slit Roll Hardness Test
{
windowWidth = 900;
windowHeight = 500;
}
if(strWinSize == 'V')// View window - used for View User details
{
windowWidth = 400;
windowHeight = 400;
}


var windowToPositionX=window.event.clientX; //client x co-ordinate
var windowToPositionY=window.event.clientY; //client y co-ordinate
var windowTop = window.screenTop
//If window display exceeds screen right
//Modified the code to display within the screen limits.
if((windowToPositionX + windowWidth + 6) > screen.width)
{
//Negate window width with screen width which returns an X co-oridinate.
//Add the co-ordinate with 30 just to avoid the positioning of window in
//scrollbar.
windowToPositionX=screen.width - (windowWidth + 30);
//Add the Y co-ordinate to 10 to avoid the overlapped display of
//window on date control text box.
windowToPositionY=windowToPositionY + 10;
}
//If window display exceeds bottom screen.
//Subtraction of 100 with screen height is to eliminate explore statusbar,window explore bar etc.,
if((windowToPositionY + windowHeight + 170) > (screen.height))
{
//Negate Y co-ordinate with (window height + 48). Negating along with 48
//is to avoid the overlapped display of window on date control text box.
windowToPositionY=windowToPositionY - windowHeight - 48;
}
//var strWinStyles

if(strWinSize == 'V')
{
var strWinStyles = "top=" + parseInt(window.screenTop + windowToPositionY) + ",left=" + windowToPositionX + ",width=" + windowWidth + ",height=" + windowHeight + ",menubar=no,resizable=no,scrollbars=yes,toolbars=no,modal=yes";
//var strWinStyles = "dialogTop: " + parseInt(windowTop + windowToPositionY) + "px;dialogleft: " + windowToPositionX + "px;dialogWidth: " + windowWidth + "px;dialogHeight: " + windowHeight +"px;center: 0;resizable: 0;edge: sunken;scroll: no;"
// var strWinStyles = "dialogTop: " + parseInt(windowTop + windowToPositionY) + "pt;dialogleft: " + windowToPositionX + "pt;dialogWidth: " + windowWidth + "pt;dialogHeight: " + windowHeight +"pt;center: off;resizable: 0;edge: sunken;scroll: no;"
}
else
{
var strWinStyles = "top=" + parseInt(window.screenTop + windowToPositionY) + ",left=" + windowToPositionX + ",width=" + windowWidth + ",height=" + windowHeight + ",menubar=no,resizable=no,scrollbars=yes,toolbars=no,modal=yes";
}
view_window=window.open(strUrl,'ViewDetails',strWinStyles);
//var view_window = window.showModalDialog(strUrl,"",strWinStyles);
view_window.focus();
return false;
}

function MM_popupMsg(msg)
{
//this.alert(msg);
this.confirm(msg);
}


function GoBack()
{
history.go(-1);
}

function ResetFormControls()
{
document.frmMain.reset();
}

function CheckKey(sCtrlName)
{
if(window.event.keyCode==13)
{
event.returnValue=false;
event.cancel = true;
var btn = document.getElementById(sCtrlName);
btn.click();
}
return true
}


thanks anr regards
Usha