﻿<!--
var curPopupWindow = null;

function openWindow(url, winName, width, height, args) {

   // args parameter expected to be similiar to the following string:
   // "location=0,menubar=0,resizable=1,scrollbars=1,status=0,titlebar=0,toolbar=0,hotkeys=0"

   // Center window on screen    
   xposition = (screen.width - width) / 2;
   yposition = (screen.height - height) / 2;


   // size and position Agrs
   args = "width=" + width + ","
   + "height=" + height + ","
   + "screenx=" + xposition + ","  //NN Only
   + "screeny=" + yposition + ","  //NN Only
   + "left=" + xposition + ","     //IE Only
   + "top=" + yposition + ","      //IE Only
   + args;


   // Performs the opening of the window
   if (curPopupWindow != null) {
       
        if (!curPopupWindow.closed) {
            curPopupWindow.close();
        }
        curPopupWindow = null;
    }

    curPopupWindow = window.open(url, winName, args, false);
    
    //check the focus() method is supported 
    if (window.focus) {curPopupWindow.focus()}
   
}

// -->