﻿// JScript File for common functions


/*
Description: Opens a window aligned centrally to the screen
Creation Date: 2 March 2007
Created By: Ajay Chalukya

Param Name:           Description
----------------------------------
url             page path
name            window name
height          window height
width           window width
openParams      window features

Modfication History
-----------------------------------
*/
function openWindowCenterScreenWithOpenParams(url,name,height,width,openParams)
{
  var w =width; //32;
  var h =height; //96;
  var wleft = (screen.width - w) / 2;
  var wtop = (screen.height - h) / 2;
  var win = window.open(url,name,
                            'width=' + w + ', height=' + h + ', ' +
                            'left=' + wleft + ', top=' + wtop + ', ' +
                            openParams);
  // Just in case width and height are ignored
  win.resizeTo(w, h);
  // Just in case left and top are ignored
  win.moveTo(wleft, wtop);
  win.focus();    
}

/*
Description: Opens a window aligned centrally to the screen
Creation Date: 16 Feb 2007
Created By: Ajay Chalukya

Param Name:           Description
----------------------------------
url             page path
name            window name
height          window height
width           window width

Modfication History
-----------------------------------
*/
function openWindowCenterScreen(url,name,height,width)
{
  var w =width; //32;
  var h =height; //96;
  var wleft = (screen.width - w) / 2;
  var wtop = (screen.height - h) / 2;
  var win = window.open(url,name,
                            'width=' + w + ', height=' + h + ', ' +
                            'left=' + wleft + ', top=' + wtop + ', ' +
                            'location=no, menubar=no, ' +
                            'status=no, toolbar=no, scrollbars=yes, resizable=no');
  // Just in case width and height are ignored
  win.resizeTo(w, h);
  // Just in case left and top are ignored
  win.moveTo(wleft, wtop);
  win.focus();    
}


/*
Description: Opens a window aligned centrally to the screen
Creation Date: 10 May 2007
Created By: Amit Lathi

Param Name:           Description
----------------------------------
url             page path
name            window name
height          window height
width           window width

Modfication History
-----------------------------------
*/
function openWindowCenterScreenResizable(url,name,height,width)
{
  var w =width; //32;
  var h =height; //96;
  var wleft = (screen.width - w) / 2;
  var wtop = (screen.height - h) / 2;
  var win = window.open(url,name,
                            'width=' + w + ', height=' + h + ', ' +
                            'left=' + wleft + ', top=' + wtop + ', ' +
                            'location=no, menubar=no, ' +
                            'status=no, toolbar=no, scrollbars=yes, resizable=yes');
  // Just in case width and height are ignored
  win.resizeTo(w, h);
  // Just in case left and top are ignored
  win.moveTo(wleft, wtop);
  win.focus();    
}
