Centered popup window

Posted: April 16th, 2008 | Author: admin | Filed under: Developers, Javascript | No Comments »

<SCRIPT TYPE="text/javascript">
<!–
function popUp(theURL, myWidth, myHeight) {
    var winName = 'feedback';
    var features='toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0';
    //var myWidth = 290;
    //var myHeight = 360;
    var isCenter = 'true';
    if(window.screen)
        if(isCenter && isCenter=="true"){  
            var myLeft = (screen.width-myWidth)/2;  
            var myTop = (screen.height-myHeight)/2;  
            features+=(features!=")?',':";  
            features+=',left='+myLeft+',top='+myTop;
        }
    var handle = window.open(theURL,winName,features+((features!=")?',':")+'width='+myWidth+',height='+myHeight);
    handle.opener = window;  handle.focus(); return handle;
}
//–></SCRIPT>