﻿function openWindowHidden(href, name)
{
	var width=10;
	var height=10;
	var left = window.screen.width;
	var top = window.screen.height;
	var wnd = openWindowPos(href, name, width, height, left, top);
	window.focus();
	return wnd;
}

function openWindowPopup(href, name, width, height, enableResize)
{
	var left = (window.screen.width-width)/2;
	var top = (window.screen.height-height)/2;
	var wnd = openWindowPos(href, name, width, height, left, top, enableResize);
	wnd.focus();
	return wnd;
}

function openWindowPos(href, name, width, height, left, top, enableResize)
{
	var features = 'menubar=0,toolbar=0,status=0' +
									',width=' + width + ',height=' + height + ',left=' + left + ',top=' + top;
	if(enableResize)
		features += ',scrollbars=1,resizable=1';
	else
		features += ',scrollbars=0,resizable=0';

	return openWindowGeneric(href, name, features);
}

function openWindowGeneric(href, name, features)
{
	return window.open(href, name, features)
}
