/****************************************************
/  
/ popup window opener, needs prototype.js
/
/****************************************************
*/
var Popup = Class.create();

Popup.prototype =
{
	name: new Date().getTime(),
	width: 100,
	height: 100, 
	toolbar: 'yes', 
	menubar: 'yes', 
	scrollbars: 'yes',
	resizable: 'yes', 
	location: 'yes', 
	directories: 'yes', 
	status: 'yes',
	
	initialize: function (name, width, height, toolbar, menubar, scrollbars, resizable, location, directories, status)
	{
		this.name 		= (name)?		name: 		this.name;
		this.width 		= (width)?		width: 		this.width;
		this.height 		= (height)? 		height: 		this.height;
		this.toolbar 	= (toolbar)? 	toolbar: 	this.toolbar;
		this.menubar 	= (menubar)?		menubar: 	this.menubar;
		this.scrollbars 	= (scrollbars)?	scrollbars: 	this.scrollbars;
		this.resizable 	= (resizable)?	resizable: 	this.resizable;
		this.location 	= (location)?	location: 	this.location;
		this.directories	= (directories)?	directories:	this.directories;
		this.status 		= (status)?		status:		this.status;
	},
	openWin: function (url, name, width, height, toolbar, menubar, scrollbars, resizable, location, directories, status)
	{
		var props = '';
		
		var _width = (width)?width: this.width;
		var _height = (height)?height: this.height;
		var _toolbar = (toolbar)?toolbar: this.toolbar;
		var _menubar = (menubar)?menubar: this.menubar;
		var _scrollbars = (scrollbars)?scrollbars: this.scrollbars;
		var _resizable = (resizable)?resizable: this.resizable;
		var _location = (location)?location: this.location;
		var _directories = (directories)?directories: this.directories;
		var _status = (status)?status: this.status;
		
		props += ' width='+_width+'px';
		props += ', height='+_height+'px';
		props += ', toolbar='+_toolbar;
		props += ', menubar='+_menubar;
		props += ', scrollbars='+_scrollbars;
		props += ', resizable='+_resizable;
		props += ', location='+_location;
		props += ', directories='+_directories;
		props += ', status='+_status;
		
		window.open(url,name,props);
	}
}