function OpenCustomWindow(sUrl, sName, nWidth, nHeight, bScrollBars, bToolBar, bLocation, bResizable, bMenuBar, bStatus, nX, nY) {
   if ((typeof nWidth == 'undefined') || (nWidth == null)) nWidth = 600;
   if ((typeof nHeight == 'undefined') || (nHeight == null)) nHeight = 400;
   if ((typeof bScrollBars == 'undefined') || (bScrollBars == null)) bScrollBars = false;
   if ((typeof bToolBar == 'undefined') || (bToolBar == null)) bToolBar = false;
   if ((typeof bLocation == 'undefined') || (bLocation == null)) bLocation = false;
   if ((typeof bResizable == 'undefined') || (bResizable == null)) bResizable = false;
   if ((typeof bMenuBar == 'undefined') || (bMenuBar == null)) bMenuBar = false;
   if ((typeof bStatus == 'undefined') || (bStatus == null)) bStatus = false;
   if ((typeof nX == 'undefined') || (nX == null)) nX = -1;
   if ((typeof nY == 'undefined') || (nY == null)) nY = -1;
  
   var param = "width=" + nWidth + ",height=" + nHeight 
                                 + ",scrollbars=" + (bScrollBars ? "yes" : "no")
                                 + ",toolbar=" + (bToolBar ? "yes" : "no")
                                 + ",menubar=" + (bMenuBar ? "yes" : "no")
                                 + ",location=" + (bLocation ? "yes" : "no")
                                 + ",resizable=" + (bResizable ? "yes" : "no")
                                 + ",status=" + (bStatus ? "yes" : "no")
                                 + ((nX != -1) ? ",left=" + nX : "" )
                                 + ((nY != -1) ? ",top=" + nY : "" );
    
   window.open(sUrl, sName == null ? "" : sName, param);
}

