function openWindow(id1, id2, width, height)
{
	if ((document.body.clientWidth < width) || (document.body.clientHeight < height))
	{
		if (document.body.clientWidth < width)
		{
			width = document.body.clientWidth;
		}
		if (document.body.clientHeight < height)
		{
			height = document.body.clientHeight;
		}
		autoScroll = 'yes';
	}
	else
	{
		height = height+5;
		autoScroll = 'no';
	}
	posLeft = parseInt(screen.width / 2 - width / 2);
	posTop = parseInt(screen.height / 2 - height / 2);
	newWindow = window.open('http://marketon.pl/index.php?m=System&f=Picture&id1='+id1+'&id2='+id2,'Marketon'+width+'x'+height,'top='+posTop+',left='+posLeft+',toolbar=no,scrollbars='+autoScroll+',directories=no,status=no,menubar=no,resizable=no,width='+width+',height='+height);
	newWindow.focus();
}

function getElement(id)
{
	with (document) var element = getElementById ? getElementById(id) : all ? all[id] : layer[id];
	if(!element.style) element.style = element;
	return element;
}

function hideElement(name)
{
	getElement(name).style.display = 'none';
}

function viewElement(name)
{
	getElement(name).style.display = 'block';
}

function elementOnOff(name)
{
	if (getElement(name).style.display == 'none')
		getElement(name).style.display = 'block';
	else
		getElement(name).style.display = 'none';
}
