// JavaScript Document
<!--
/*
 * global.js
 *
 * Oglne strypty JS.
 *
 * Copyright (c) 2006 by Varts.PL <batter@tlen.pl>
 *
 */


function OpenWindowImg (WindowName, Resize, URL, DEBUG)
{
	var x = 0, y = 0, szer = 100, wys = 100, s_w = screen.availWidth, s_h = screen.availHeight;

	if (s_w > 0 && s_h > 0)
	{
		if (s_w <= szer) szer=s_w;
		else
		{
			x = (s_w / 2) - (szer / 2);
			if (x < 0) x = 0;
		}

		if (s_h <= wys) wys = s_h;
		else
		{
			y = (s_h / 2) - (wys / 2);
			if (y < 0) y = 0;
		}
	}

	if (DEBUG) StatusBar = 'yes';
	else       StatusBar = 'no';

	NewWindow = window.open ('./' + URL, WindowName, 'toolbar=no,location=no,directories=no,status=' + StatusBar + ',menubar=no,scrollbars='+ Resize +',resizable='+ Resize +',width='+ szer +',height='+ wys +',left='+ x +',top='+ y);
}

function OpenWindowImg2 (WindowName, URL)
{
	var x = 0, y = 0, szer = 750, wys = 1200, s_w = screen.availWidth, s_h = screen.availHeight;

	if (s_w > 0 && s_h > 0)
	{
		if (s_w <= szer) szer=s_w;
		else
		{
			x = (s_w / 2) - (szer / 2);
			if (x < 0) x = 0;
		}

		if (s_h <= wys) wys = s_h;
		else
		{
			y = (s_h / 2) - (wys / 2);
			if (y < 0) y = 0;
		}
	}

	NewWindow = window.open (URL, WindowName, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+ szer +',height='+ wys +',left='+ x +',top='+ y);
}

function OpenFullWindow (WindowName, URL)
{
	NewWindow = window.open (URL, 'NewWindow', 'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+ screen.availWidth +',height='+ screen.availHeight +',left=0,top=0');
}

function DoCmd (URL)
{
	self.location.href = '/' + URL;
}


function DoCmdWithConfirm (URL, MSG)
{
	if (!confirm (MSG))
		return;
	else
		DoCmd (URL);
}


function DoInParentWin (URL)
{
	self.opener.location.href = '/' + URL;
}
//-->

