var
	o_window_wndcount = 0;

// ourl - открываемая страница
// cl - класс окна, FALSE для автоматического создания класса
// l, r - положение, левая граница и верхняя граница
// w, h - высота и ширина
// s - показать скроллбар (1, 0)
// sz - изменение размеров окна (1, 0)

function	o_window_Rand() {
	return Math.round(Math.random(100) * 100000);
}

function	o_window_basic(ourl, cl, l, t, w, h, s, sz) {
	o_window_wndcount++;

	if (!cl) cl = 'o_window_js' + o_window_Rand() + 'count' + o_window_wndcount;

	return window.open(ourl, cl, "toolbar = 0, location = 0, directories = 0, status = 0, menubar = 0, scrollbars = " + s + ", resizable = " + sz + ", top = " + t + ", left = " + l + ", width = " + w + ", height = " + h);
}

function	o_window_Center(ourl, cl, w, h, s, sz) {
	l = (screen.width / 2) - (w / 2);
	t = (screen.height / 2) - (h / 2);

	return o_window_basic(ourl, cl, l, t, w, h, s, sz);
}

function	o_window_Center_Size(ourl, cl, w, h) {
	return o_window_Center(ourl, cl, w, h, 1, 1);
}

function	o_window_LT(ourl, cl, w, h, s, sz) {
	l = 50;
	t = 50;

	return o_window_basic(ourl, cl, l, t, w, h, s, sz);
}

function	o_window_LT_Size(ourl, cl, w, h) {
	l = 50;
	t = 50;

	return o_window_basic(ourl, cl, l, t, w, h, 1, 1);
}

