
// ..................................................................

function openWindow(href, title, scroll, resizable, width, height, position)
{
	if(scroll != "yes")
	{
		scroll = "no";
	}

	if(resizable != "yes")
	{
		resizable = "no";
	}

	if(position != 'center')
	{
		xx = window.open(href, title, 'toolbar=no, scrollbars=' + scroll + ', menubar=no, directories=no, status=no, resizable=' + resizable + ', width=' + width + ', height=' + height);
	}
	else
	{
		this_top = (screen.height - height) / 2;
		this_left = (screen.width - width) / 2;
		xx = window.open(href, title, 'toolbar=no, scrollbars=' + scroll + ', menubar=no, directories=no, status=no, resizable=' + resizable + ', width=' + width + ', height=' + height + ', top=' + this_top + ', left=' + this_left);
	}

	xx.focus();

	return false;
}

// ..................................................................

function selectWallpaper(that, number)
{
	if(that.options[that.selectedIndex].value)
	{
		resolution = that.options[that.selectedIndex].value;

		x = resolution.indexOf('x');
		if(x)
		{
			width = resolution.substring(0, x);
			height = resolution.substring(x + 1, resolution.length);
			if(width && height)
			{
				this_left = (screen.width < 2000) ? (screen.width / 2 - (width / 2)) : (screen.width / 4 - (width / 2));
				this_top = screen.height / 2 - (height / 2);
				xx = window.open('/images/wallpapers/show.php?number=' + number + '&resolution=' + resolution, 'wallpapers' + number, 'toolbar=no, scrollbars=yes, menubar=no, directories=no, status=no, resizable=no, width=' + width + ', height=' + height + ', top=' + this_top + ', left=' + this_left);
				xx.focus();
			}
		}
	}

	return false;
}

// ..................................................................
