﻿/* 
* Popup Window
* 
* Usage example: 
*  <script type="text/javascript" src="js/PopupWindow.js"></script>
*  ...
*  <asp:HyperLink runat="server" NavigateUrl="javascript:void(0);" OnClick="PopupWindow(200, 400, 'page_name.aspx')" Text="Test here" />
*/
function PopupWindow(width, height, url) {
    var left = (screen.width - width) / 4;
    var top = (screen.height - height) / 2;
    var params = 'width=' + width + ', height=' + height;
    params += ', top=' + top + ', left=' + left;
    params += ', screenY=' + top + ', screenX=' + left;
    params += ', directories=no';
    params += ', location=no';
    params += ', menubar=no';
    params += ', resizable=no';
    params += ', scrollbars=no';
    params += ', status=no';
    params += ', toolbar=no';
    params += ', dependent=yes';
    params += ', alwaysRaised=yes';
    newwin = window.open(url, 'SecurityCodeInfo', params);
    if (window.focus) { newwin.focus() }
    return false;
}

