﻿

/* Constructor */
function ngd_PopupController(status, toolbar, location, menubar, directories, resizable, scrollbars, height, width, windowname)
{
	this._status = status; //The status bar at the bottom of the window. 
    this._toolbar = toolbar; //The standard browser toolbar, with buttons such as Back and Forward. 
    this._location = location; //The Location entry field where you enter the URL. 
    this._menubar = menubar; //The menu bar of the window 
    this._directories = directories; //The standard browser directory buttons, such as What's New and What's Cool 
    this._resizable = resizable; //Allow/Disallow the user to resize the window. 
    this._scrollbars = scrollbars; //Enable the scrollbars if the document is bigger than the window 
    this._height = height; //Specifies the height of the window in pixels. (example: height='350')
    this._width = width; //Specifies the width of the window in pixels.
    this._windowname = windowname; // The name of the window
}
// **************************************************


// **************************************************
// Setup all the required Objects for the menu system
ngd_PopupController.prototype.Open = function(url) {
    var winConfig = "width=" + this._width;
    winConfig += ",height=" + this._height;
    winConfig += ",status=" + this._status;
    winConfig += ",toolbar=" + this._toolbar;
    winConfig += ",location=" + this._location;
    winConfig += ",menubar=" + this._menubar;
    winConfig += ",directories=" + this._directories;
    winConfig += ",resizable=" + this._resizable;
    winConfig += ",scrollbars=" + this._scrollbars;

    var currentTime = new Date();
    var hours = currentTime.getHours()
    var minutes = currentTime.getMinutes()
    var seconds = currentTime.getSeconds()
    var month = currentTime.getMonth() + 1;
    var day = currentTime.getDate();
    var year = currentTime.getFullYear();

    var winName = this._windowname;

    try { my_window = window.open(url, winName, winConfig); }
    catch (err) { }
    if (my_window != null)
        my_window.focus();
}



/* Constructor */
function ngd_PopupControllerStats(status, toolbar, location, menubar, directories, resizable, scrollbars, height, width, windowname) {
    this._status = status; //The status bar at the bottom of the window. 
    this._toolbar = toolbar; //The standard browser toolbar, with buttons such as Back and Forward. 
    this._location = location; //The Location entry field where you enter the URL. 
    this._menubar = menubar; //The menu bar of the window 
    this._directories = directories; //The standard browser directory buttons, such as What's New and What's Cool 
    this._resizable = resizable; //Allow/Disallow the user to resize the window. 
    this._scrollbars = scrollbars; //Enable the scrollbars if the document is bigger than the window 
    this._height = height; //Specifies the height of the window in pixels. (example: height='350')
    this._width = width; //Specifies the width of the window in pixels.
    this._windowname = windowname; // The name of the window
}
// **************************************************


// **************************************************
// Setup all the required Objects for the menu system
ngd_PopupControllerStats.prototype.Open = function(url) {
    var winConfig = "width=" + this._width;
    winConfig += ",height=" + this._height;
    winConfig += ",status=" + this._status;
    winConfig += ",toolbar=" + this._toolbar;
    winConfig += ",location=" + this._location;
    winConfig += ",menubar=" + this._menubar;
    winConfig += ",directories=" + this._directories;
    winConfig += ",resizable=" + this._resizable;
    winConfig += ",scrollbars=" + this._scrollbars;

    var currentTime = new Date();
    var hours = currentTime.getHours()
    var minutes = currentTime.getMinutes()
    var seconds = currentTime.getSeconds()
    var month = currentTime.getMonth() + 1;
    var day = currentTime.getDate();
    var year = currentTime.getFullYear();

    var winName = this._windowname + '_' + year + month + day + hours + minutes + seconds;

    try { my_window = window.open(url, winName, winConfig); }
    catch (err) { }
    if (my_window != null)
        my_window.focus();
}