function imageWindow(path,title)
{
	var wnd = window.open(path,title,'width=512,height=384,menubar=no,toolbar=no,location=no,scrollbars=no,status=no,resizable=no');
	wnd.focus();
}

function fitPic()
{
	if (window.innerWidth) {
		alert("inerWIdth");
		iWidth  = window.innerWidth;
		iHeight = window.innerHeight;
	} else {
		alert("clientWidth");
		iWidth  = document.body.clientWidth;
		iHeight = document.body.clientHeight;
	}
	iWidth  = document.images[0].width  - iWidth;
	iHeight = document.images[0].height - iHeight;
	window.resizeBy(iWidth, iHeight);
}

function resizeWindow(imageWindow)
{
	if (imageWindow.document.images) {
		if (imageWindow.document.images.length == 1) {
			if (imageWindow.document.layers) windowHandle.resizeTo(imageWindow.document.images[0].width+20,imageWindow.document.images[0].height+20)
			else if (imageWindow.document.all) windowHandle.resizeTo(imageWindow.document.images[0].width+30,imageWindow.document.images[0].height+50)
	} else 
            setTimeout('resizeWindow()',1000);
	}
}

function openImage(imageUrl)
{
	var url = "./bin/"+imageUrl;
	var imageWindow = window.open(url, "obrazek", "width=400,height=400,scrollbars=yes");
	//resizeWindow(imageWindow);
}