function SSWindow(){

var Method;
var Params;
var Splits;
var Href;
var Name;
var ToolBar;
var MenuBar;
var ScrollBar;
var UrlBar;
var Status;
var FullScreen;
var Resize;
var Width;
var Height;
var Place;
var Top;
var Left;
var ReturnValue;
var TextValue;
var ConfirmTrue;
var ConfirmFalse;
var Raise;


this.Method = Method;
this.Params = Params;
this.Splits = Splits;
this.Href = Href;
this.Name = Name;
this.ToolBar = ToolBar;
this.MenuBar = MenuBar;
this.ScrollBar = ScrollBar;
this.UrlBar = UrlBar;
this.Status = Status;
this.FullScreen = FullScreen;
this.Resize = Resize;
this.Width = Width;
this.Height = Height;
this.Place = Place;
this.Top = Top;
this.left = Left;
this.ReturnValue = ReturnValue;
this.TextValue = TextValue;
this.ConfirmTrue = ConfirmTrue;
this.ConfirmFalse = ConfirmFalse;
this.Raise = Raise;
}

SSWindow.prototype.Init = function()
{
this.Method = this.Method?this.Method:'open';
this.Params = this.Params?this.Params:'';
this.Splits = this.Splits?this.Splits:'|';
this.Href = this.Href?this.Href:'about:blank';
this.Name = this.Name?this.Name:Math.round(Math.random() * 100000);
this.ToolBar = this.ToolBar?this.ToolBar:'no';
this.MenuBar = this.MenuBar?this.MenuBar:'no';
this.ScrollBar = this.ScrollBar?this.ScrollBar:'no';
this.UrlBar = this.UrlBar?this.UrlBar:'no';
this.Status = this.Status?this.Status:'no';
this.FullScreen = this.FullScreen?this.FullScreen:'no';
this.Resize = this.Resize?this.Resize:'no';
this.Width = this.Width?this.Width:parseInt(screen.width/2);
this.Height = this.Height?this.Height:parseInt(screen.height/2);
this.Place = this.Place?this.Place:'center';
this.Top = this.Top?this.Top:'30';
this.Left = this.Left?this.Left:'30';
this.ReturnValue = this.ReturnValue?this.ReturnValue:'';
this.TextValue = this.TextValue?this.TextValue:'';
this.ConfirmTrue = this.ConfirmTrue?this.ConfirmTrue:true;
this.ConfirmFalse = this.ConfirmFalse?this.ConfirmFalse:false;
}

SSWindow.prototype.Open = function()
{
// .toLowerCase()
switch (this.Method)
{

case 'open':
if (this.Place == 'center')
{
OpenWinTopXY = 'top='+((screen.availHeight-this.Height)/2)+',left='+((screen.availWidth-this.Width)/2);
}else if (this.Place == 'top'){
OpenWinTopXY = 'top=0,left=0';
}else{
OpenWinTopXY = 'top='+this.Top+',left='+this.Left+'';
}

window.open (this.Href,''+this.Name+'','location=no;toolbar='+this.ToolBar+',menubar='+this.MenuBar+',scrollbars='+this.ScrollBar+',resizable='+this.Resize+',directories='+this.UrlBar+',fullscreen='+this.FullScreen+',status='+this.Status+',titlebar=no,width='+this.Width+',height='+this.Height+','+OpenWinTopXY+'alwaysRaised='+this.Raise+'');
break;

case 'showModalDialog':
var DialogObj;
DialogObj = window.showModalDialog (this.Href,'','dialogWidth:'+this.Width+';dialogHeight:'+this.Height+';status:'+this.Status+';scroll='+this.ScrollBar+';help:no');
return (''+DialogObj+'');
break;

case 'showHelp':
window.showHelp(this.Href);
break;

case 'confirm':
var msgbox = window.confirm(this.TextValue);
if (msgbox)
{
eval(this.ConfirmTrue);
}else{
eval(this.ConfirmFalse);
}
break;

case 'popup':
if (this.ie)
{
this.PopTop=50;
this.oPopup = window.createPopup();
var html=this.TextValue;
this.oPopup.document.body.innerHTML = html;
popshow();
}
break;

default:
top.location=this.Href;
break;
}
}

var SSWindow = new SSWindow;


function NewWindow(url,name,w,h,scrolls,stat,loc,resize,menu,tools,dirs)
{
// check for width; default 640
if( !w ){
w = 640;
}

// check for height; default 480
if( !h ){
h = 480;
}

// check for scrolls; default on
if( scrolls=="off" ){
scrolls = 0;
}
else{
scrolls = 1;
}

// check for status; default on
if( !stat ){
stat = 1;
}

// check for location bar; default off
if( !loc ){
loc = 0;
}

// check for resize; default off
if( !resize ){
resize = 0;
}

// check for menu bar; default off
if( !menu ){
menu = 0;
}

// check for toolbar; default off
if( !tools ){
tools = 0;
}

// check for directories; default off
if( !dirs ){
dirs = 0;
}


// figure out the width keyword
if( window.innerWidth ){
width_keyword = "innerWidth";
height_keyword = "innerHeight";
}
else{
width_keyword = "width";
height_keyword = "height";
}
width_keyword = "width";
height_keyword = "height";


SSWindow.Raise = 'on';

SSWindow.Method='open';
SSWindow.Href=url;
SSWindow.Name=name;
SSWindow.Width=w;
SSWindow.Height=h;
SSWindow.ScrollBar=scrolls;
SSWindow.Status=stat;
SSWindow.UrlBar=dirs;
SSWindow.Resize=resize;
SSWindow.MenuBar=menu;
SSWindow.ToolBar=tools;

SSWindow.Init();
SSWindow.Open();
}
