            /*
                popupCenter
                ( 
                    sUrl, 
                    optional iWidth = 480, 
                    optional iHeight = 640, 
                    optional iLeft = (screen.width / 2) - (iWidth / 2), 
                    optional iTop = (screen.height / 2) - (iHeight /2),
                    optional sName = 'popupCenter',
                    optional sOptions = 'scrollbars=yes,resizable=no,toolbar=no,statusbar=no',
                    optional bReturnObject = true,
                    optional bGiveFocus = true
                ) 
                
                Example:
                var o = popupCenter('[url]?id=x',null,null,null,null,'naam',null,true);
                
            */
            function popupCenter(sUrl)
            {                     
                var sArguments_ar = popupCenter.arguments;
                var iArgumentsCount = popupCenter.arguments.length;
        
                // resolution 480*640 is the perfect printout resolution (for print popups)        
                var iWidth          = (iArgumentsCount > 1) ? ((sArguments_ar[1] == null) ? 480 : sArguments_ar[1]) : 480;
                var iHeight         = (iArgumentsCount > 2) ? ((sArguments_ar[2] == null) ? 640 : sArguments_ar[2]) : 640;
                var iLeft           = (iArgumentsCount > 3) ? ((sArguments_ar[3] == null) ? ((screen.width / 2) - (iWidth / 2)) : sArguments_ar[3]) : ((screen.width / 2) - (iWidth / 2));
                var iTop            = (iArgumentsCount > 4) ? ((sArguments_ar[4] == null) ? ((screen.height / 2) - (iHeight / 2)) : sArguments_ar[4]) : ((screen.height / 2) - (iHeight / 2));
                var sPopupName      = (iArgumentsCount > 5) ? ((sArguments_ar[5] == null) ? 'popupCenter' : sArguments_ar[5]) : 'popupCenter';
                var sOptions        = (iArgumentsCount > 6) ? ((sArguments_ar[6] == null) ? 'scrollbars=yes,resizable=no,toolbar=no,statusbar=no' : sArguments_ar[6]) : 'scrollbars=yes,resizable=no,toolbar=no,statusbar=no';
                var bReturnObject   = (iArgumentsCount > 7) ? ((sArguments_ar[7] == null) ? true : sArguments_ar[7]) : true;
                var bGiveFocus      = (iArgumentsCount > 8) ? ((sArguments_ar[8] == null) ? true : sArguments_ar[8]) : true;
                          
                var oPopup = window.open(sUrl, sPopupName, 'height='+iHeight+',width=' + iWidth + ',left=' + iLeft + ',top=' + iTop + ',' + sOptions);
                
                if (!oPopup.opener)
                {
                    oPopup.opener = self;
                }          
                            
                if ((iLeft < 1) || (iTop < 1))
                {
                    oPopup.moveTo(iLeft, iTop);
                }
                                   
                if (bGiveFocus)
                {
                    oPopup.focus();
                }

                if (bReturnObject)                
                {
                    return oPopup;
                }                   
            }     
            
            function ResizeAndCenter(iWidth, iHeight)
            {                
                var iTop = (screen.height / 2) - (iHeight /2);
                var iLeft = (screen.width / 2) - (iWidth /2);
                
                window.moveTo(iLeft, iTop);
                window.resizeTo(iWidth, iHeight);
            }            

