function showCallerSnapCallsWindow(auth) { callerSnapPopupCenterCS('https://near.place/browsernotifications/callersnap_calls.php?auth=' + auth + '', '', 300, 300); } function callerSnapPopupCenterCS(url, title, w, h) { //alert('open' + url); // Fixes dual-screen position Most browsers Firefox var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left; var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top; var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width; var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height; var left = ((width / 2) - (w / 2)) + dualScreenLeft; var top = ((height / 2) - (h / 2)) + dualScreenTop; var newWindow = window.open(url, title, 'scrollbars=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left + ',menubar=no' + ',resizable=0,fullscreen=0'); if (newWindow == null || typeof (newWindow) == 'undefined') { alert('Please disable your pop-up blocker and click again.'); } else { newWindow.focus(); } }