popwin=null;

pStart='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n<html><head><title>TCC</title></head><body style="margin: 0; padding: 0;"><img src="';
pEnd='" id="image" style="cursor:pointer;" alt="Zavřít" title="Zavřít" onclick="window.close();" /></body></html>';

function alertSize()
{
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' )
	{
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	}
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
	{
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	}
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
	{
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	window.alert( 'Width = ' + myWidth +'\n'+'Height = ' + myHeight );
}

function popopen (url)
{
	popwin=window.open ('','a','location=no,menubar=no,resizable=yes,scrollbares=no,toolbar=no,status=no',true);
	popwin.document.write (pStart+url+pEnd);
	popwin.document.close();
	img=popwin.document.getElementById('image');
	img.onload=function ()
	{
		do
		{} while (!img.width);
		popwin.focus();
		popwin.resizeTo (1000,800);
		var myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' )
		{
			//Non-IE
			myWidth = popwin.innerWidth;
			myHeight = popwin.innerHeight;
		}
		else if( popwin.document.documentElement && ( popwin.document.documentElement.clientWidth || popwin.document.documentElement.clientHeight ) )
		{
			//IE 6+ in 'standards compliant mode'
			myWidth = popwin.document.documentElement.clientWidth;
			myHeight = popwin.document.documentElement.clientHeight;
		}
		else if( popwin.document.body && ( popwin.document.body.clientWidth || popwin.document.body.clientHeight ) )
		{
			//IE 4 compatible
			myWidth = popwin.document.body.clientWidth;
			myHeight = popwin.document.body.clientHeight;
		}
		popwin.resizeBy (-(Math.abs(img.width-myWidth)),-(Math.abs(img.height-myHeight)));
	}
	popwin.onunload=function ()
	{ this.opener.popwin=null; }
}
