﻿// Popup Window Script
//  Accepts a href and a windowname and loads
//  the href page in a popup window of a fixed size
// 
//=====================================================
// Input Parameters
//-----------------------------------------------------
// URL - URL of the page to open, if empty: about:blank
// Name - name of window or target attribute
//      * _blank - new window (default)
//      * _parent - parent frame
//      * _self - replaces current page
//      * _top - replaces any framesets
// Specs - comma-separated list of items
//      * channelmode=yes|no|1|0 - Display the window in theater mode (default=no)
//      * directories=yes|no|1|0 - Add directory buttons (default=yes)
//      * fullscreen=yes|no|1|0 - Display in fullscreen mode (default=no) channelmode must be 1
//      * height=pixels - The height of the window. Min. value is 100
//      * left=pixels - The left position of the window
//      * location=yes|no|1|0 - Show Address Field (default=yes)
//      * menubar=yes|no|1|0 - Show Menu Bar (default=yes)
//      * resizable=yes|no|1|0 - Window resizable (default=yes)
//      * scrollbars=yes|no|1|0 - Show scroll bars (default=yes)
//      * status=yes|no|1|0 - Show status bar (default=yes)
//      * titlebar=yes|no|1|0 - Show title bar (default=yes)
//      * toolbar=yes|no|1|0 - Show browser tool bar (default=yes)
//      * top=pixels - The top position of the window. 
//      * width=pixels - The width of the window. Min. value is 100
// Replace - Replace current entry in browser history list.  (true or false) 


function popup(URL, windowname, specs, replace )
{

//set default value of specs if undefined
//specs = (typeof specs == 'undefined') ? 'width=750,height=500,scrollbars=auto' : specs;
    specs = (typeof specs == 'undefined') ? 'width=980,height=760,resizable=1,scrollbars=1' : specs;


if (! window.focus)return true;
var href;
if (typeof(URL) == 'string')
   href=URL;
else
   href=URL.href;
 newwindow = window.open(href, windowname, specs);

//restore window if minimized
if (window.focus) {newwindow.focus()}
return false;
}



