Centered Popup




Gadget Code
<?xml version="1.0" encoding="UTF-8" ?>  
<Module> 
  <ModulePrefs title="centered_popup" />  
  <Content type="html"> 
     <![CDATA[  
       <script type="text/javascript">

function open_window(url, width, height) {
var my_window;

//screen.width = Desktop Width
//screen.height = Desktop Height

var center_left = (screen.width / 2) - (width / 2);
var center_top = (screen.height / 2) - (height / 2);

my_window = window.open(url, "Title", "scrollbars=1, width="+width+", height="+height+", left="+center_left+", top="+center_top);
my_window.focus();
}
</script>

<p>
<a href="javascript:open_window('http://www.google.com',900,600);">Open New Centered Window</a>
</p>

     ]]>
  </Content>  
</Module>