<!--

// ----------------------------------------------------------------------------
//
// TrolleyBox - Copyright (C) 1999-2006 Spanner Sofware Ltd. All rights reserved.
// 
// This code is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// version 2.0 as published by the Free Software Foundation. See
// http://www.gnu.org/copyleft/gpl.html for full details.
// 
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// Please notify us of any improvements by sending them to
// dev@spannersoftware.com
// 
// Filename:  popup.js
// Version:   1.01
// Purpose:   Pop-up dialog functions
// 
// Version  Date        Author  Action
// 1.00     28-11-2002  VJS     Created
// 1.01     08-01-2003  VJS     Added WHOIS pop-up
// 
// ----------------------------------------------------------------------------

function openChild(filename, windowname, width, height, option_list) {
  x = (640 - width)/2, y = (480 - height)/2;
	
	if (screen) {
		y = (screen.availHeight - height)/2;
		x = (screen.availWidth - width)/2;
  }
	
	if (screen.availWidth > 1800) { 
		x = ((screen.availWidth/2) - width)/2;
	}
	
	if (option_list != '') {
	  option_list = ',' + option_list;
	}
	
	childWindow = window.open(filename, windowname, 'resizable=no,width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x+option_list);
	if (childWindow.opener == null) childWindow.opener = self;
}

function openCalendar(width, height) {
  x = (640 - width)/2, y = (480 - height)/2;
	
	if (screen) {
		y = (screen.availHeight - height)/2;
		x = (screen.availWidth - width)/2;
  }
	
	if (screen.availWidth > 1800) { 
		x = ((screen.availWidth/2) - width)/2;
	}

	top.newWin = window.open('calendar.html', 'cal', 'dependent=yes,resizable=no,width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
}

// legacy
function oWin(filename, windowname, width, height) {
  x = (640 - width)/2, y = (480 - height)/2;
	
	if (screen) {
		y = (screen.availHeight - height)/2;
		x = (screen.availWidth - width)/2;
  }
	
	if (screen.availWidth > 1800) { 
		x = ((screen.availWidth/2) - width)/2;
	}
	
	childWindow = window.open(filename, windowname, 'resizable=no,width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
	if (childWindow.opener == null) childWindow.opener = self;
}

function oWinScr(filename, windowname, width, height) {
  x = (640 - width)/2, y = (480 - height)/2;
	
	if (screen) {
		y = (screen.availHeight - height)/2;
		x = (screen.availWidth - width)/2;
  }
	
	if (screen.availWidth > 1800) { 
		x = ((screen.availWidth/2) - width)/2;
	}
	
	childWindow = window.open(filename, windowname, 'resizable=no,scrollbars=yes,width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
	if (childWindow.opener == null) childWindow.opener = self;
}

//-->
