var window_c = function()
{
	this.is_modal_b = false;

	this.name_s;
	this.location_s;

	this.query_a = [];
	this.property_a = [];

	/**/

	this.setName = function(name_s)
	{
		this.name_s = name_s;
	};

	this.getName = function()
	{
		return this.name_s ? this.name_s : 'unnamed';
	};

	/**/

	this.setLocation = function(url_s)
	{
		this.location_s = url_s;
	};

	this.getLocation = function()
	{
		return this.location_s;
	};

	/**/

	this.setQuery = function(name_s, value_u)
	{
		this.query_a[name_s] = value_u;
	};

	this.getQuery = function(name_s)
	{
		return this.query_a[name_s];
	};

	this.getQueryString = function()
	{
		var query_a = [];

		for (var index_s in this.query_a)
			if (typeof this.query_a[index_s] != 'function')
				query_a[query_a.length] = index_s + '=' + this.query_a[index_s];

		return query_a.join('&');
	};

	/**/

	this.setProperty = function(name_s, value_u)
	{
		this.property_a[name_s] = value_u;
	};

	this.getProperty = function(name_s)
	{
		return this.property_a[name_s];
	};

	this.getPropertyString = function()
	{
		var property_a = [];

		for (var index_s in this.property_a)
			property_a[property_a.length] = index_s + '=' + this.property_a[index_s];

		return property_a.join(',');
	};

	this.getModalPropertyString = function()
	{
		var property_a = [];
			property_a[0] = 'dialogWidth: ' + this.getProperty('width') + 'px';
			property_a[1] = 'dialogHeight: ' + this.getProperty('height') + 'px';
			property_a[2] = 'scroll: ' + this.getProperty('scrollbars');

		return property_a.join(';');
	};

	/**/

	this.setModal = function()
	{
		this.is_modal_b = true;
	}

	this.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');
	};

	this.setCentered = function()
	{
		this.setProperty('top', (screen.height / 2) - (this.getProperty('height') / 2));
		this.setProperty('left', (screen.width / 2) - (this.getProperty('width') / 2));
	};

	this.setOpen = function()
	{
		var url_s = this.getLocation() + '?' + this.getQueryString();

		return (navigator.appName.indexOf('Microsoft') != -1) ? this.is_modal_b ? window.showModalDialog(url_s, '', this.getModalPropertyString()) : window.open(url_s, this.getName(), this.getPropertyString()) : window.open(url_s, this.getName(), this.getPropertyString());
	};
};
