function camwindow(cam,name,content,path,w,h)
	{
	if(w > window.screen.width || h > window.screen.height)
		{
		if(content == "picture")
			{
			if(window.screen.height > 1024)
				{
				w = 1280;
				h = 1024;
				}
			else if(window.screen.height > 600)
				{
				w = 800;
				h = 600;
				}
			}
		else
			{
			alert("Rozlíšenie Vášho monitora nezodpovedá potrebám pre zobrazované médium.\n\nRozlíšenie Vášho monitora:\t" + window.screen.width + " x " + window.screen.height + "\nPožadované min. rozlíšenie:\t" + w + " x " + h);
			return;
			}
		}
	/* calculate center position on screen */
	iMyWidth = (window.screen.width / 2) - ((w / 2) + 14);
	iMyHeight = (window.screen.height / 2) - ((h / 2) + 50);

	/* generate html code */
	Okno = window.open("", name, "width=" + w + ", height=" + h + ", left=" + iMyWidth + ", top=" + iMyHeight + ", screenX=" + iMyWidth + ", screenY=" + iMyHeight + ", resizable=no, scrollbars=no, toolbar=no, location=no, menubar=no, channelmode=no, directories=no, status=no");
	Okno.document.write("<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n");
	Okno.document.write("<title>Kamera " + cam + "<"+"/title>\n");
	Okno.document.write("<"+"/head>\n\n");
	Okno.document.write("<body topmargin=\"0\" leftmargin=\"0\" marginheight=\"0\" marginwidth=\"0\">\n\n");

	/* select media object by content */
	switch(content)
		{
		case "picture":
		if(w > window.screen.width || h > window.screen.height)
			//resize to default user size
			Okno.document.write('<img src="php/image.php?path=/home/users/letnet/campics/' + path + '"&height=' + h + '&quality=100" width="' + w + '" height="' + h + '" alt="Zatvor okno" onclick="javascript: window.close();">');
		else
			//put original file
			Okno.document.write('<img src="http://letnet.letnet.sk/campics/' + path + '" width="' + w + '" height="' + h + '" alt="Zatvor okno" onclick="javascript: window.close();">');
		break;

		case "rtsp":
		if (navigator.appName == "Microsoft Internet Explorer")
			{
			Okno.document.write('<object type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2" width="' + w + '" height="' + h + '" events="True" classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921">');
			Okno.document.write('<param name="MRL" value="' + path + '" />');
			Okno.document.write('</object>');
			}
		else
			{
			Okno.document.write('<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2" width="' + w + 'px" height="' + h + 'px" align="center" target="' + path + '"></embed>');
			}
		break;

		case "activex":
		if ((navigator.appName != "Microsoft Internet Explorer") || (navigator.platform == "MacPPC"))
			{
			alert("Upozornenie !\n\nIP kamera ViVotek využíva ActiveX modul, ktorý je produktom spoločnosti Microsoft,\na je implementovaný iba do prehliadačov Internet Explorer.");
			}
		Okno.document.write('<OBJECT ID="VAtCtrl" WIDTH=' + w + ' HEIGHT=' + h + ' name="VAtCtrl" CLASSID=CLSID:210D0CBC-8B17-48D1-B294-1A338DD2EB3A CODEBASE="http://letnet.sk/download/VatDec.cab#version=1,0,0,65">' + "\n");
		Okno.document.write('<PARAM NAME="VSize" VALUE="SIF">' + "\n");
		Okno.document.write('<PARAM NAME="Language" VALUE="en">' + "\n");
		Okno.document.write('<PARAM NAME="Deblocking" VALUE="true">' + "\n");
		Okno.document.write('<PARAM NAME="ClickEventHandler" VALUE=1>' + "\n");
		Okno.document.write('<PARAM NAME="DisplayTimeFormat" VALUE="0">' + "\n");
		Okno.document.write('<PARAM NAME="DigitalZoomEnableChk" VALUE="true">' + "\n");
		Okno.document.write('<PARAM NAME="DigitalZoomEdit" VALUE="true">' + "\n");
		Okno.document.write('<PARAM NAME="Url" VALUE="' + path + '">' + "\n");
		Okno.document.write('</OBJECT>');
		break;
		}
	Okno.document.write("\n\n<"+"/body>\n<"+"/html>");
	}
