function ScreenSize() {
	if (parseInt(navigator.appVersion)>3) {
		screenW = screen.width;
		screenH = screen.height;
	} else if (navigator.appName == "Netscape" 	&& parseInt(navigator.appVersion)==3 && navigator.javaEnabled()) {
		// stare browsery
		var jToolkit = java.awt.Toolkit.getDefaultToolkit();
		var jScreenSize = jToolkit.getScreenSize();
		screenW = jScreenSize.width;
		screenH = jScreenSize.height;
	}
	
	return Array(screenW, screenH);
}



// oteven okna s kurzem
function openPopup(url) {
	
  var width = 800;
	var height = 600;
	
	// vycentrovani
	var screenSize = ScreenSize();
	var left = (screenSize[0] - width) / 2;
	var top = (screenSize[1] - height) / 2;
	
	window.open(url, 'popup', 'location=no, status=no, toolbar=no, menubar=no, resizable=yes, scrollbars=yes, width=' + width + ', height=' + height + ', top=' + top + ', left=' + left + '');
	
	return false;
}


	function openPage(url, target, width, height) {
		lefti = (window.screen.width / 2) - (width / 2);
		topi = (window.screen.height / 2) - (height / 2);

		options = 'margin=5,scrollbars=yes,toolbar=0,resizable=yes,menubar=0'+(width>0&&height>0?',top=' + topi + ',left=' + lefti + ',width=' + width + ',height=' + height:'');
		win = window.open(url, target, options);
		win.focus();

		//zastaveni pripadneho probublavani
		click_dis = true;

		return (typeof(win) != 'object');
	}




	function openImage3(imgSrc) {
	    var img = new Image();
	    img.src = imgSrc;
	    width = img.width+40;
	    height = img.height+40;
	
		lefti = (window.screen.width / 2) - (width / 2);
		topi = (window.screen.height / 2) - (height / 2);

		options = 'margin=0,scrollbars=yes,toolbar=0,resizable=yes,menubar=0'+(width>0&&height>0?',top=' + topi + ',left=' + lefti + ',width=' + width + ',height=' + height:'');
		
		win = window.open(imgSrc, '', options);
		win.focus();

		//zastaveni pripadneho probublavani
		click_dis = true;

		return (typeof(win) != 'object');
	}






	function openImage2(img_href)
	{
		/*
    if (!img_href) {
			var img = this;
		}
		else {
			var img = img_href;
		}
		*/
		
		var img = this;
		
		var width  = img.width  + 10;
		var height = img.height + 10;

		var lefti = (window.screen.width / 2) - (width / 2);
		var topi = (window.screen.height / 2) - (height / 2);


		options = 'margin=0,scrollbars=yes,toolbar=0,resizable=yes,menubar=0'+(width>0&&height>0?',top=' + topi + ',left=' + lefti + ',width=' + width + ',height=' + height:'');

		html = '<html><body style="margin:0;padding:0;text-align:center;"><a href="javascript:window.close();"><img src="' + img.src + '" width="'+width+'" height="'+height+'" border="0"></a></body></html>';
		//html = '<html><body style="margin:0;padding:0;text-align:center;"><a href="javascript:window.close();"><img src="' + img.src + '" border="0"></a></body></html>';

		win = window.open('', '', options);
		win.document.write(html);
		win.focus();

		//zastaveni pripadneho probublavani
		click_dis = true;

	}


	function openImage(imgSrc) {
	    var img = new Image();
		img.onload = openImage2;
	    img.src = imgSrc;

		return false;
	}
