var window_c = function()
{
	this.name_s;
	this.location_s;

	this.query_a = new Array();
	this.property_a = new Array();
};

/**/

window_c.prototype.setName = function(name_s)
{
	this.name_s = name_s;
};

window_c.prototype.getName = function()
{
	return this.name_s ? this.name_s : 'unnamed';
};

/**/

window_c.prototype.setLocation = function(url_s)
{
	this.location_s = url_s;
};

window_c.prototype.getLocation = function()
{
	return this.location_s;
};

/**/

window_c.prototype.setQuery = function(name_s, value_u)
{
	this.query_a[name_s] = value_u;
};

window_c.prototype.getQuery = function(name_s)
{
	return this.query_a[name_s];
};

window_c.prototype.getQueryString = function()
{
	var query_a = new Array();

	for (var index_s in this.query_a)
		query_a[query_a.length] = index_s + '=' + this.query_a[index_s];

	return query_a.join('&');
};

/**/

window_c.prototype.setProperty = function(name_s, value_u)
{
	this.property_a[name_s] = value_u;
};

window_c.prototype.getProperty = function(name_s)
{
	return this.property_a[name_s];
};

window_c.prototype.getPropertyString = function()
{
	var property_a = new Array();

	for (var index_s in this.property_a)
		property_a[property_a.length] = index_s + '=' + this.property_a[index_s];

	return property_a.join(',');
};

/**/

window_c.prototype.setMinimal = function()
{
	this.setProperty('toolbar', 'no');
	this.setProperty('scrollbars', 'no');
	this.setProperty('resizable', 'no');
	this.setProperty('menubar', 'no');
	this.setProperty('status', 'no');
	this.setProperty('directories', 'no');
	this.setProperty('location', 'no');
};

window_c.prototype.setCentered = function()
{
	this.setProperty('top', (screen.height / 2) - (this.getProperty('height') / 2));
	this.setProperty('left', (screen.width / 2) - (this.getProperty('width') / 2));
};

window_c.prototype.setOpen = function()
{
	var url_s = this.getLocation() + (this.query_a ? '?' + this.getQueryString() : '');

	return window.open(url_s, this.getName(), this.getPropertyString());
};
